c - Link a .a library with CMake -


i want link .a library cmake used : cc main.c -l/usr/lib64 -lmlx -l/usr/lib64/x11 -lxext -lx11 use clion jetbrains.

i tried in cmake :

target_link_libraries(fdf /usr/lib/x86_64-linux-gnu/libx11.a) target_link_libraries(fdf /usr/lib/x86_64-linux-gnu/libxext.a) 

rewrite your

target_link_libraries(fdf /usr/lib/x86_64-linux-gnu/libx11.a) target_link_libraries(fdf /usr/lib/x86_64-linux-gnu/libxext.a) 

as:

target_link_libraries(fdf) link_directories("/usr/lib/x86_64-linux-gnu/") target_link_libraries(x11) target_link_libraries(xext) 

as mentioned in answer, might have shuffle order of last 2 lines , on.


Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

python - Specify path of savefig with pylab or matplotlib -

c# - SharpSsh Command Execution -