diff --git a/src/gpu/GridGenerator/CMakeLists.txt b/src/gpu/GridGenerator/CMakeLists.txt
index 7c4b0bece855a58c7e97730207ed653b398da0c8..46866937e2fe91e4d2eedd3cbbaf16a65ae8a6fc 100644
--- a/src/gpu/GridGenerator/CMakeLists.txt
+++ b/src/gpu/GridGenerator/CMakeLists.txt
@@ -6,4 +6,11 @@ vf_get_library_name(library_name)
 linkCUDA()
 linkOpenMP(${library_name})
 
-set_target_properties(${library_name} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
\ No newline at end of file
+
+set_target_properties(${library_name} PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
+
+# according to linker error when building static libraries.
+# https://stackoverflow.com/questions/50033435/cmake-cuda-separate-compilation-static-lib-link-error-on-windows-but-not-on-ubun
+if (NOT BUILD_SHARED_LIBRARY)
+    set_target_properties(${library_name} PROPERTIES CUDA_RESOLVE_DEVICE_SYMBOLS ON)
+endif()
\ No newline at end of file