Setup G3D app with Makefile

17 views
Skip to first unread message

bcallebaut

unread,
Feb 22, 2009, 3:34:04 PM2/22/09
to G3D Users
Hello,
I am starting up using G3D (version 7.01 compiled from source ).
To start a use de starter app (App.cpp/App.h). I need to compile the
app using a makefile and g++.
The reason is:
* the final application will be integrated with other libraries
* final application will be multi platform (MAC OSX/Windows/
Linux...)

I tried to compile the app under Linux (Ubuntu 8.10) using command
line and a CodeBlocks project.
cmdline command :g++ -o App -I /usr/local/include -L/usr/local/lib -
lG3D -lGLG3D -lzip App.cpp
I have linking problems :
here is a snap of the command line build:

eCountedPointer<G3D::Lighting> const&,
G3D::ReferenceCountedPointer<G3D::ShadowMap>)'
App.cpp:(.text+0x2a9): undefined reference to
`G3D::RenderDevice::pushState()'
App.cpp:(.text+0x2b4): undefined reference to
`G3D::RenderDevice::enableLighting()'
App.cpp:(.text+0x2f0): undefined reference to
`G3D::RenderDevice::setLight(int, G3D::GLight const&)'
App.cpp:(.text+0x343): undefined reference to
`G3D::RenderDevice::setAmbientLightColor(G3D::Color3 const&)'

Same kind of thing happens with codeblocks:

ToneMap.cpp:(.text+0x2149)||undefined reference to `G3D::GImage::GImage
(int, int, int)'|
ToneMap.cpp:(.text+0x21b6)||undefined reference to
`G3D::ImageFormat::RGB8()'|
ToneMap.cpp:(.text+0x22c6)||undefined reference to `G3D::GImage::resize
(int, int, int)'|
ToneMap.cpp:(.text+0x2306)||undefined reference to
`G3D::ImageFormat::RGB8()'|
ToneMap.cpp:(.text+0x23ee)||undefined reference to
`G3D::GImage::~GImage()'|
ToneMap.cpp:(.text+0x2411)||undefined reference to
`G3D::GImage::~GImage()'|
/usr/local/lib/libGLG3D.a(ToneMap.o)||In function
`G3D::ToneMap::resizeImages(G3D::RenderDevice*)':|
ToneMap.cpp:(.text+0x2e49)||undefined reference to
`G3D::ImageFormat::RGB8()'|
ToneMap.cpp:(.text+0x2f44)||undefined reference to
`G3D::ImageFormat::RGB8()'|
/usr/local/lib/libGLG3D.a(GApp.o)||In function `G3D::writeLicense()':|
GApp.cpp:(.text+0x61d)||undefined reference to `G3D::license()'|
/usr/local/lib/libGLG3D.a(GApp.o)||In function
`G3D::GApp::renderDebugInfo()':|
GApp.cpp:(.text+0xd18)||undefined reference to `G3D::GMutex::lock()'|
GApp.cpp:(.text+0xe2f)||undefined reference to `G3D::GMutex::unlock
()'|

Could someone help me ?

corey taylor

unread,
Feb 22, 2009, 4:10:14 PM2/22/09
to g3d-...@googlegroups.com
You need to fix your linking order. Dependencies need to be linked
first, then the libraries containing the dependencies.

corey

bcallebaut

unread,
Feb 23, 2009, 9:38:22 AM2/23/09
to G3D Users
Solved under MacOSX 10.5
g++ -o App2 -I/usr/local/include -L/usr/local/lib/ -L/System/Library/
Frameworks/OpenGL.framework/Libraries/ -L/Developer/SDKs/
MacOSX10.5.sdk/usr/X11/lib -L/Developer/SDKs/MacOSX10.5.sdk/usr/lib -
lz -lG3D -lGLG3D -lGL -lGLImage -lpng -lGLU -lavcodec -ljpeg -lzip -
lavformat -lavutil -framework Carbon -framework AGL App.cpp
Reply all
Reply to author
Forward
0 new messages