i learn c++, OpenMP. I have tried compile my program with omp_get_wtime and it doesn't work, but when i deleted this, it works. i must add something, but what and where. In openmptryflags or Cmakelists?
snap/clion/61/bin/cmake/linux/bin/cmake --build /home/bapah/CLionProjects/omp1/cmake-build-debug --target omp1 -- -j 6 [ 50%] Linking CXX executable omp1 CMakeFiles/omp1.dir/main.cpp.o: In function `main': /home/bapah/CLionProjects/omp1/main.cpp:36: undefined reference to `omp_get_wtime' collect2: error: ld returned 1 exit status CMakeFiles/omp1.dir/build.make:83: recipe for target 'omp1' failed make[3]: *** [omp1] Error 1 CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/omp1.dir/all' failed make[2]: *** [CMakeFiles/omp1.dir/all] Error 2 CMakeFiles/Makefile2:84: recipe for target 'CMakeFiles/omp1.dir/rule' failed make[1]: *** [CMakeFiles/omp1.dir/rule] Error 2 Makefile:118: recipe for target 'omp1' failed make: *** [omp1] Error 2
-fopenmp
. Can you add the compiler or linker command lines to the question? – user4581301