Clang: warning: -lgtest: input 'linker' is not used

I am developing applications in C ++ 11, and my compiler is CLang ++ 3.3. I also use the Netbeans 7.3 IDE on Linux Mint 14.

All my tests are done using GoogleTest (gtest-1.6.0), and almost everything works fine except for the warning mentioned in the header of this post.

Here on the command line, the netbeans command is executed:

clang++ -pedantic-errors -lgtest -pthread   -c -g -Wall -std=c++11 -pedantic-errors -lgtest -pthread -MMD -MP -MF build/Debug/CLang-Linux-x86/_ext/1802678175/main.o.d -o build/Debug/CLang-Linux-x86/_ext/1802678175/main.o ../GIT_CryptoCode/src/main.cpp

I don’t know why, but the command contains twice some attributes that give the same warning twice. This is what I have done in the project properties: Properties of the project: C ++ Compiler If I remove the extra options, gtest does not work, and the command line would be something like this: clang++ -c -g -Wall -std=c++11 .... What to do in order not to duplicate some attributes?

, cmake, Clang ( :)). GCC 4.7, . cmake GCC:

set (CMAKE_CXX_FLAGS                "-Winline -Wall -Werror -pedantic-errors -pthread -std=c++11")

, Clang, , . - , , ? Clang?

.

+4
1

@Fraser , , . , -pedantic-errors -lgtest -pthread ++, , Linker . enter image description here

, ++ . -Werror - .

, cmake

target_link_libraries(${Project_Name} ${GTEST_BOTH_LIBRARIES})

. , -lgtest

set (CMAKE_CXX_FLAGS   "-Winline -Wall -Werror -pedantic-errors -pthread -std=c++11")

GCC, Clang.

+4

All Articles