[CMake] target_link_libraries issues

joza404 alexey.teplyakov91 at gmail.com
Thu May 30 23:34:31 EDT 2013


Hello everyone, I just started using Cmake and I got a weird issue without a
peep.
Let's take a look a simplest-ever-seen CmakeList:

/cmake_minimum_required(VERSION 2.8)
project(test)
find_package(SDL REQUIRED)
if(NOT SDL_FOUND)
	message(SEND_ERROR "Failted to find SDL")
	return()
else()
	include_directories(${SDL_INCLUDE_DIR})
endif()
add_executable(main main.cpp)
target_link_libraries(main ${SDL_LIBRARY})/

(I have only the one file main.cpp where SDL.h is included)
Then cmake -G "MinGW Makefiles" completed successfully, then i tried to do
"mingw32-make.exe VERBOSE=1" and i got the messages about my lib is included
for linking *WITHOUT*  "-l" prefix:
g++  blablabla  D:\programming\libs\SDL\lib\libSDLmain.a
D:\programmin\libs\SDL\lib\libSDL.dll.a  blablabla
 
And then, thus, the specific error messages emerged: "undefined reference to
..(list of functions)"
Could someone help me there ? 

Regards, Alexey Teplyakov.



--
View this message in context: http://cmake.3232098.n2.nabble.com/target-link-libraries-issues-tp7584591.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list