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