Skip to content

Unable to compile my file #4129

Answered by Mahiuha
eli-yip asked this question in Community Help
Jan 25, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

It seems like the linker is unable to find the symbols for the Google Test library. This is likely because the library is not being linked to your program during the compilation process. To fix this, you should link the Google Test library to your program by adding the following flag to your compile command:

-lgtest

It should look like this:

clang++ -std=17 main.cpp -o main.out -lgtest

This flag tells the linker to link the gtest library to your program. If the library is installed in a non-standard location, you may also need to use the -L flag to specify the location of the library and the -I flag to specify the location of the gtest header files.

Also make sure that the version of the …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@eli-yip
Comment options

Answer selected by eli-yip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants