undefined reference to `img_convert'

167 views
Skip to first unread message

Lane

unread,
Mar 4, 2009, 10:09:34 AM3/4/09
to G3D Users
I installed G3D on my Gentoo box using "buildg3d --install all".
Other than needing to add a missing #include line, the installation
seemed to be successful. I tried building a sample application in
Eclipse but I got lots of linker errors. I then tried the
instructions on this page: http://g3d-cpp.sourceforge.net/manual/guidenewunix.html
for creating a new project, but icompile still failed with a linker
error. Here is the output of icompile:

You have never run iCompile in this directory before.

Current Directory: /home/phillips/g3dtest
Contains no subdirectories
Subdirectories contain no C++ files

Are you sure you want to compile the 'g3dtest' project? (Y/N)
Would you like to generate a set of starter files for the 'g3dtest'
project? (Y/N)
Select a project template:
[H]ello World
[G]3D

mkdir build
mkdir source
mkdir doc-files
mkdir data-files
Path /usr/local/include/SDL11/ specified in configuration file does
not exist.
_______________________________________________________________________

Building g3dtestd
Computing dependencies

Compiling
source/App.cpp

Linking
/usr/local/lib//libGLG3Dd.a(VideoOutput.o): In function
`G3D::VideoOutput::convertFrame(unsigned char*, G3D::ImageFormat
const*, bool)':
/tmp/G3D/GLG3D.lib/source/VideoOutput.cpp:437: undefined reference to
`img_convert'
collect2: ld returned 1 exit status

Lane

unread,
Mar 4, 2009, 10:38:11 AM3/4/09
to G3D Users
I fixed the problem in Eclipse, icompile still doesn't work. This
topic revealed to me that the order in which libraries are linked
matters: http://groups.google.com/group/g3d-users/browse_thread/thread/adf45539ec5e7374
By changing the order of the libraries in the project settings I got
the sample app to compile and it looks awesome. Here's what the
linker command ended up looking like (which shows the library order):

g++ -L/usr/local/lib -o"g3dtest" ./App.o -lGLG3Dd -lG3Dd -lGL -lGLU
-lavformat -lavcodec -lavutil -ljpeg -lpng -lzip -lSDL

I also had to add the SDL library, which wasn't mentioned in the wiki
at that time.

corey taylor

unread,
Mar 5, 2009, 1:30:00 AM3/5/09
to g3d-...@googlegroups.com
That looks ok.

We can add command line linking order information to the document. We
typically just reference iCompile, but that's not always the case.

corey

Lane

unread,
Mar 5, 2009, 8:00:31 AM3/5/09
to G3D Users
In my case, however, it appears that iCompile is also linking the
libraries in the wrong order.

On Mar 5, 12:30 am, corey taylor <corey.tay...@gmail.com> wrote:
> That looks ok.
>
> We can add command line linking order information to the document.  We
> typically just reference iCompile, but that's not always the case.
>
> corey
>
> On Wed, Mar 4, 2009 at 10:38 AM, Lane <phill...@cs.umn.edu> wrote:
>
> > I fixed the problem in Eclipse, icompile still doesn't work.  This
> > topic revealed to me that the order in which libraries are linked
> > matters:  http://groups.google.com/group/g3d-users/browse_thread/thread/adf4553...

corey taylor

unread,
Mar 6, 2009, 12:03:58 AM3/6/09
to g3d-...@googlegroups.com
Yea, that's interesting. The library dependencies look ok and we
haven't had any problems with our test programs. I'll check into it.

corey

corey taylor

unread,
Jun 14, 2009, 7:37:49 PM6/14/09
to g3d-...@googlegroups.com

The issue was a pre-existing build of ffmeg in the path.

corey

On Jun 14, 2009 3:06 PM, "Rob Patro" <rob....@gmail.com> wrote:


Hello all,

 I've run into this same problem when trying to build G3D 7.01 on
Ubuntu 9.04.  The compile succeeds, but it fails to link with this
very error.  Has there been any progress on a solution using the
buildg3d script?

Thanks,
Rob

On Mar 6, 1:03 am, corey taylor <corey.tay...@gmail.com> wrote: > Yea, that's interesting.  The lib...

> On Thu, Mar 5, 2009 at 8:00 AM, Lane <phill...@cs.umn.edu> wrote: > > > In my case, however, it ap...

Reply all
Reply to author
Forward
0 new messages