nangoon / ehci

Automatically exported from code.google.com/p/ehci
0 stars 0 forks source link

problem compiling svn code on linux #18

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. svn checkout http://ehci.googlecode.com/svn/trunk/ ehci-read-only
2. edit CMakeCache.txt to enable //Build OpenGL Samples 
BUILD_OPENGL_EXAMPLES:BOOL=ON
3. cmake .

What is the expected output? What do you see instead?
diediaga@diediaga-laptop:~/ehci-read-only$ cmake .
-- Looking for GLUT
-- Looking for GLUT - found : /usr/include
CMake Error: The following variables are used in this project, but they are set 
to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake 
files:
GLUT_Xmu_LIBRARY (ADVANCED)
    linked by target "6dofhand" in directory /home/diediaga/ehci-read-only/samples
    linked by target "6dofhead" in directory /home/diediaga/ehci-read-only/samples
    linked by target "boxView3d" in directory /home/diediaga/ehci-read-only/samples
    linked by target "zoomHand" in directory /home/diediaga/ehci-read-only/samples

-- Configuring incomplete, errors occurred!

What version of the product are you using? On what operating system?
version 237 of the snv
my cumputer is running ubuntu 10.04
2.6.32-24-generic
opencv 2.1

Please provide any additional information below.

Original issue reported on code.google.com by diedi...@gmail.com on 24 Nov 2010 at 10:19

GoogleCodeExporter commented 8 years ago
Please, try installing the libxmu-dev package, probably like 'sudo apt-get 
install libxmu-dev', through synaptic or something similar.
And if you have some time, please, write back the results.

Best regards,
Daniel

Original comment by danielba...@gmail.com on 25 Nov 2010 at 12:03

GoogleCodeExporter commented 8 years ago
hi. Thanks for your fast reply
I install that lib without problem now cmake works well. 
but I got some another problems with make :(

when I type make
I got this error
[ 28%] Building CXX object samples/CMakeFiles/6dofhand.dir/6dofhand.cpp.o
/home/diediaga/ehci-read-only/samples/6dofhand.cpp:9:58: error: glut.h: No 
existe el archivo o directorio

So I open the file 6dofhand.cpp and change the lines 
#include <glut.h>    // Header File For The GLUT Library 
to this one
#include <GL/glut.h>    // Header File For The GLUT Library 

now it founds the glut library.

but again another error compiling this example:
[ 14%] Built target Ehci
[ 28%] Building CXX object samples/CMakeFiles/6dofhand.dir/6dofhand.cpp.o
Linking CXX executable 6dofhand
CMakeFiles/6dofhand.dir/6dofhand.cpp.o: In function `getFrameAsGLTexture()':
6dofhand.cpp:(.text+0xc26): undefined reference to `gluBuild2DMipmaps'
CMakeFiles/6dofhand.dir/6dofhand.cpp.o: In function `DrawGLScene()':
6dofhand.cpp:(.text+0xf45): undefined reference to `gluLookAt'
CMakeFiles/6dofhand.dir/6dofhand.cpp.o: In function `ReSizeGLScene(int, int)':
6dofhand.cpp:(.text+0x10b7): undefined reference to `gluPerspective'
CMakeFiles/6dofhand.dir/6dofhand.cpp.o: In function `InitGL(int, int)':
6dofhand.cpp:(.text+0x1291): undefined reference to `gluPerspective'
collect2: ld returned 1 exit status
make[2]: *** [samples/6dofhand] Error 1

regards
diego

Original comment by diedi...@gmail.com on 25 Nov 2010 at 9:39

GoogleCodeExporter commented 8 years ago
Hi Diego, thanks for trying it out and rewriting the correct position of Glut.
Now, your problem is about finding the glut library for linking.
I cannot tell you why CMake hasn't found it. Firstly, I'd try to clean all your 
cache and run the configuration process again. If it does not work, I'd tell 
you to dive down into the CMake files and finding out what is the place it has 
found glut library.
This thread seems to be related to what you should do 

> When I run make VERBOSE=1 on the osgviewer application I get an -lGLU
> entry just before the -lGL entry, while you have just the -lGL entry.
> So this is the cause, the question is why Cmake hasn't added in -lGLU
> where it should.
>
> cd into the root of OpenSceneGraph directory and then type ccmake .  ie.
>
>   cd OpenSceneGraph
>   ccmake .
>
> Then press 't' to get all the advanced options, then scroll down the
> list to get to the OPENGL_glu_LIBRARY entry.  Mine points to
> /usr/lib/libGLU.so, as your should do, but perhaps this hasn't been
> picked up.
>
> Robert.

Just change the cd into OpenSceneGraph to EHCI directory and try to find what 
CMake has put in you OPENGL_glu_LIBRARY entry. The full link to this thread is 
here:
http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg06466.html

Original comment by danielba...@gmail.com on 26 Nov 2010 at 12:41

GoogleCodeExporter commented 8 years ago
hi Robert
I installed ccmake and also cmake-gui and check that the libs are there
I can see that all the libs are found in my system.
except 
OPENGL_xmesa_INCLUDE_DIR         OPENGL_xmesa_INCLUDE_DIR-NOTFOUND 
do you think this could be the problem?
I google about this but I can't fine any solution about.
I can compile and run version 0.6 with not 0.7 or svn
I will continue looking for a solution this weekend
kind regards

Original comment by diedi...@gmail.com on 26 Nov 2010 at 10:43

GoogleCodeExporter commented 8 years ago
Hi Diego,

try and force the -lGLU linker flag in the compile command line...
maybe you can manually change it in the makefile... and then we discover what 
is avoiding cmake from getting the glut flag...

Original comment by danielba...@gmail.com on 26 Nov 2010 at 1:23

GoogleCodeExporter commented 8 years ago
Hi,
If you add "${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}" to the CMakeLists.txt 
file in the samples directory on lines 56,58,60,62 like this:

TARGET_LINK_LIBRARIES(zoomHand ${OpenCV_LIBS} ${OpenGL_LIBS} 
${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${GLUT_LIBRARY})

it compiles with the samples without any problems. The two libraries need to be 
added for each file that needs to link with them. For some reason 
${OpenGL_LIBS} does not get put together correctly.

Also, glut.h is not being found because the GLUT_INCLUDE_DIR is not getting set 
correctly. I ran "ccmake ." and pressed 't' to get to the advanced options. 
Then I changed the GLUT_INCLUDE_DIR from "/usr/include" to "/usr/include/GL". 
The header file is found without changing each cpp file that uses glut.h

Regards,
Sam

Original comment by samsound...@gmail.com on 16 Feb 2011 at 9:57

GoogleCodeExporter commented 8 years ago
That's a very good job. It seems you've dug into Cmake :)
Awesome, 
I'll mark the issue as closed, thank you a lot!

Original comment by danielba...@gmail.com on 16 Feb 2011 at 9:59

GoogleCodeExporter commented 8 years ago
Closing as solved.

Original comment by danielba...@gmail.com on 16 Feb 2011 at 10:00