[CMake] cmake linking errors in simple project

Owen Alanzo Hogarth gurenchan at gmail.com
Mon Jul 6 03:48:37 EDT 2015


I created this simple project but I am having linking errors. Everything
builds correctly but when I try to add my lib to my main.c cmake complains
about linking errors.

Here's what the project looks like: http://pastebin.com/22bCsuiE

if i #include "time_utils.h" in my main.c I get this error:

Scanning dependencies of target launcher
[ 50%] Building C object CMakeFiles/launcher.dir/main.c.o
/Users/xx/project/main.c:2:10: fatal error: 'time_utils.h' file not found
#include "time_utils.h"

if I remove that line from the main.c it builds properly. I though adding
this line TARGET_LINK_LIBRARIES(auncher time_utils) to my cmakelists.txt it
would find the library but seems not. How can I make sure that the library
is found and properly linked?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150706/addb5f13/attachment.html>


More information about the CMake mailing list