how do i do that? i know that sounds really ignorant, but, i guess I am a little bit with cmake.<br>dave<br><br><div><span class="gmail_quote">On 1/27/07, <b class="gmail_sendername">Bill Hoffman</b> <<a href="mailto:bill.hoffman@kitware.com">
bill.hoffman@kitware.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">David Morris wrote:<br>> I'm new to cmake, and I have been trying to find a good comprehensive
<br>> tutorial to get myself started, but have had no luck. Does anyone know<br>> a good one besides the <a href="http://cmake.org">cmake.org</a> <<a href="http://cmake.org">http://cmake.org</a>> site and the<br>
> linuxjournal one?<br>><br>> I will try to describe one problem i'm having, but I'm not really sure<br>> where to begin. I'm trying to compile a C++ project and I get this error:<br>><br>> /usr/bin/ld: Undefined symbols:
<br>> _glBegin<br>> _glBindTexture<br>> _glColor3d<br>> _glColor3f<br>> _glCullFace<br>> ...<br>> ...<br>><br>> and so on...<br>><br>> I read somewhere this might have to do with cmake trying to compile
<br>> C++ code using gcc instead of g++, and that you can override this<br>> setting in the CMakeCache file, but this is the line in the<br>> CMakeCache.txt file:<br>><br>> CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
<br>><br>> I tried changing it to g++, but it didn't seem to do anything. I don't<br>> think this has much to do with the actual code of the project, so I<br>> didn't bother explaining anything about it here. Any help would be
<br>> greatly appreciated. I'm thinking it's a really simple error, but who<br>> knows. Here is the text of my main CMakeLists.txt file:<br>><br>> ---<br>><br>> #Change PROJECT_NAME to the name of your project
<br>> PROJECT(TopMod)<br>> #include some macros from another file...<br>> INCLUDE(${TopMod_SOURCE_DIR}/CMakeMacros.txt)<br>> #Declare any external dependencies that your project may have here.<br>> #examples include: ITK, VTK, JPEG, PNG, OpenGL, ZLIB, Perl, Java
<br>> #If you're not sure what name to use, look in the Modules directory of<br>> your<br>> #cmake install and check that a file named Find(Package).cmake exists<br>> SET(Required_Packages<br>> FLTK JPEG PNG OpenGL ZLIB GLUT
<br>> )<br>> FOREACH(Package ${Required_Packages})<br>> LOADPACKAGE(${Package})<br>> ENDFOREACH(Package)<br>><br>> #run through these sub directories to build these two libraries<br>> SUBDIRS(vecmat)
<br>> SUBDIRS(arcball)<br>><br>> INCLUDE_DIRECTORIES(${TopMod_SOURCE_DIR}/arcball<br>> ${TopMod_SOURCE_DIR}/vecmat ${TopMod_SOURCE_DIR}/include /opt/local/lib)<br>> LINK_DIRECTORIES(${TopMod_BINARY_DIR}/arcball
<br>> ${TopMod_BINARY_DIR}/vecmat ${TopMod_BINARY_DIR}/include /opt/local/lib)<br>><br>> SET(Libraries fltk_images fltk_gl fltk arcball vecmat)<br>><br>> SET(CurrentExe "TopMod")<br>> FILE(GLOB SRC *.cc)
<br>> ADD_EXECUTABLE(${CurrentExe} ${SRC})<br>> TARGET_LINK_LIBRARIES(${CurrentExe} ${Libraries})<br>You need to link in the opengl library.<br><br>-Bill<br><br></blockquote></div><br>