Board index FlightGear Support Tools Atlas

Atlas: Build error with March 01 snapshot: glewInit()

Atlas is an addon that lets FlightGear users display a real-time "moving-map" of their flight.

Atlas: Build error with March 01 snapshot: glewInit()

Postby polly » Fri Mar 02, 2012 2:56 pm

Hi
This is a build error on Fedora 14 which has glew installed:
    /usr/lib/libGLEW.so
    /usr/lib/libGLEW.so.1.5
    /usr/lib/libGLEW.so.1.5.7

usr/include/GL/glew.h shows glewinit() declared:

Code: Select all
#endif
..
#else /* GLEW_MX */
GLEWAPI GLenum glewInit ();
...


and I checked, it is a 'non GLEW_MX' build.
Here's the error log:
    g++ -g -O2 -DFGBASE_DIR='"NONE/lib/FlightGear"' -L/usr/local//lib -o Atlas Notifications.o Atlas.o GLUTWindow.o AtlasBaseWindow.o AtlasWindow.o AtlasController.o FlightTrack.o Image.o NavData.o Overlays.o AirportsOverlay.o AirwaysOverlay.o FixesOverlay.o NavaidsOverlay.o FlightTracksOverlay.o CrosshairsOverlay.o RangeRingsOverlay.o Tiles.o TileMapper.o Searcher.o Search.o Preferences.o Graphs.o Culler.o Scenery.o Cache.o LayoutManager.o Bucket.o Subbucket.o Palette.o misc.o Globals.o Geographics.o -lsgmagvar -lsgtiming -lsgmisc -lsgio -lsgserial -lsgdebug -lsgbucket -lsgstructure -lsgmath -lsgthreads -lplibsg -lplibpuaux -lplibpu -lplibfnt -lplibnet -lglut -lGLU -lGL -lXmu -lXt -lSM -lICE -lXi -lXext -lX11 -lpthread -lrt -lm -lpng -lz -ljpeg -lplibul -lcurl -lrt -lm
    Atlas.o: In function `main':
    /apkg/aBlFg/atlas/src/Atlas.cxx:173: undefined reference to `glewInit'
    /apkg/aBlFg/atlas/src/Atlas.cxx:178: undefined reference to `__GLEW_VERSION_1_5'
    /apkg/aBlFg/atlas/src/Atlas.cxx:182: undefined reference to `__GLEW_EXT_framebuffer_object'
    TileMapper.o: In function `TileMapper::render()':
    /apkg/aBlFg/atlas/src/TileMapper.cxx:171: undefined reference to `__glewBindFramebufferEXT'
    /apkg/aBlFg/atlas/src/TileMapper.cxx:196: undefined reference to `__glewGenerateMipmapEXT'
    /apkg/aBlFg/atlas/src/TileMapper.cxx:201: undefined reference to `__glewFramebufferTexture2DEXT'
    /apkg/aBlFg/atlas/src/TileMapper.cxx:202: undefined reference to `__glewCheckFramebufferStatusEXT'
    /apkg/aBlFg/atlas/src/TileMapper.cxx:328: undefined reference to `__glewGenerateMipmapEXT'
    /apkg/aBlFg/atlas/src/TileMapper.cxx:329: undefined reference to `__glewBindFramebufferEXT'

Is there something obviously wrong, lke the wrong version of glew ? Thanks


Edit: I found that cramming -lGLEW into Makefile#233 fixed the build but I don't know how to fix up /.configure

Code: Select all
.......
mandir = ${datarootdir}/man
mkdir_p = /bin/mkdir -p
oldincludedir = /usr/include
opengl_LIBS = -lglut -lGLEW -lGLU -lGL -lXmu -lXt -lSM -lICE -lXi -lXext -lX11 -lpthread -lrt -lm
pdfdir = ${docdir}
prefix = /usr/local
......
User avatar
polly
 
Posts: 455
Joined: Thu Nov 04, 2010 2:45 pm

Re: Atlas: Build error with March 01 snapshot: glewInit()

Postby bschack » Sat Mar 03, 2012 5:22 pm

polly wrote in Fri Mar 02, 2012 2:56 pm:Hi
This is a build error on Fedora 14 which has glew installed:
    /usr/lib/libGLEW.so
    /usr/lib/libGLEW.so.1.5
    /usr/lib/libGLEW.so.1.5.7

...


The reason is that the library gets detected in configure.ac, which sets the compile-time variable $opengl_LIBS that is used in Makefile.am. Try re-running the configuration step and then re-compiling (the configuration step is where you run the 'configure' command. You may also need to run autogen.sh first, but I'm not certain).

Brian
bschack
 
Posts: 195
Joined: Tue Jul 01, 2008 9:04 am

Re: Atlas: Build error with March 01 snapshot: glewInit()

Postby polly » Sat Mar 03, 2012 6:17 pm

Thanks for the reply.
That error _is_ after doing make clean; ./autogen.sh; ./configure; make
I've just re-done the sequence and I see the same error.
Does it matter that the check for GLEW in configure.ac

Code: Select all
dnl Check for GLEW
AC_CHECK_HEADER(GL/glew.h)
if test "x$ac_cv_header_GL_glew_h" != "xyes"; then
    echo
    echo "You *must* have the GLEW library installed on your system to build"
    echo "Atlas!"
    echo
    echo "configure aborted."
    exit
fi
AC_CHECK_LIB(GLEW, glewInit)


comes after
Code: Select all
opengl_LIBS="$LIBS"



in configure.ac ?

Edit: At least, it fixes the problem here: I moved the 'looking for GLEW' stanza at line 330 up to line 248 so that in configure.ac#243 reads:

Code: Select all
    AC_SEARCH_LIBS(gluLookAt, [ GLU MesaGLU ])
    AC_SEARCH_LIBS(glutGetModifiers, [ glut freeglut ])
    ;;

esac

dnl Check for GLEW
AC_CHECK_HEADER(GL/glew.h)
if test "x$ac_cv_header_GL_glew_h" != "xyes"; then
    echo
    echo "You *must* have the GLEW library installed on your system to build"
    echo "Atlas!"
    echo
    echo "configure aborted."
    exit
fi
AC_CHECK_LIB(GLEW, glewInit)

opengl_LIBS="$LIBS"
LIBS="$base_LIBS"



And now Atlas builds OK. Thanks for the hints !
User avatar
polly
 
Posts: 455
Joined: Thu Nov 04, 2010 2:45 pm

Re: Atlas: Build error with March 01 snapshot: glewInit()

Postby bschack » Wed Mar 07, 2012 11:50 pm

polly wrote in Sat Mar 03, 2012 6:17 pm:Thanks for the reply.
That error _is_ after doing make clean; ./autogen.sh; ./configure; make
I've just re-done the sequence and I see the same error.
Does it matter that the check for GLEW in configure.ac

[...]

And now Atlas builds OK. Thanks for the hints !


I'm glad that it works, but upon reflection I still don't understand why. The information I gave you before was not correct - GLEW is not included in the $opengl_LIBS variable. It is part of the implicit $LIBS variable (calling AC_CHECK_LIB() will automatically add the library to $LIBS).

I'd like to understand why it didn't work for you before and why your change made it work, so I'd like you to do a little test for me. Change the configure.ac file back to the way it was before and re-run the configuration. Does it compile? (The reason I'm asking you to do this is that, in my experience, configure can be slow to notice changes. I'm wondering if it only noticed a change when you modified the configure.ac file - in other words, the change itself didn't matter, only the fact that you changed it did).

Thanks,
Brian
bschack
 
Posts: 195
Joined: Tue Jul 01, 2008 9:04 am

Re: Atlas: Build error with March 01 snapshot: glewInit()

Postby polly » Thu Mar 08, 2012 12:20 pm

Hi Brian
I'm afraid, over the weekend, I re-installed this system from Fedora-14_32 to Fedora-16_64. I'd rebuilt Atlas OK on the new install using my 'fixed' configure.ac and, as you say, the original configure.ac now works OK on this new installation.
In case it helps, when I originally had the propblem, I remember the .configure didn't abort with the 'you MUST' have the GLEW library installed .. ' message but configure.log did show a bad return code ( 1 ) from the 'looking for GLEW' code fragment.
Anyway, thanks again for you help and for Atlas !
User avatar
polly
 
Posts: 455
Joined: Thu Nov 04, 2010 2:45 pm


Return to Atlas

Who is online

Users browsing this forum: No registered users and 1 guest