mingw-cross-env-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Undefined reference to freeglut libraryfuncti


From: Volker Grabsch
Subject: Re: [Mingw-cross-env-list] Undefined reference to freeglut libraryfunctions
Date: Fri, 17 Dec 2010 10:41:38 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Zdenek Hutyra schrieb:
>> MinGW compiled the program fine, but failed to link to functions in 
>> GLUT library, which is actually freeglut installed by mingw-cross-env 
>> using "make freeglut". I included my output here. To reproduce the 
>> error, please follow these steps.
>
> Try the attached patch.
> (I don't like it, but the DevIL package does it this way, so I guess it is a 
> preferred solution)

No, this isn't the preferred solution. It is an ugly hack that we
used for DevIL, but avoid for many other packages like cURL etc.

The preferred solution is to compile the code with

    gcc ... -DFREEGLUT_STATIC ...

That's how the library is meant to be used. And that's how many
other libraries are meant to be used.

If Freeglut had a *-config script (or even better a *.pc script for
pkg-config) we'd adjust that script to return "-DFREEGLUT_STATIC"
in addition to "-I..." etc. when called via "--cflags".

However, Freeglut doesn't yet support that. That's why you have
to take care of that on your own, and remember to use that flag.

BTW, are there any voluteers to create one and propose it to
the Freeglut project?

Note that it would be theoretically possible to define FREEGLUT_STATIC
within your application immediately before the "#include". But I
strongly recommend against that as this makes your sources non-
portable. If you want to hard code that, it's better to do this in
your Makefile by always providing the "-DFREEGLUT_STATIC" option to
GCC. The main goal should always be to keep build issues out of
your sources.


Greets,
Volker

-- 
Volker Grabsch
---<<(())>>---



reply via email to

[Prev in Thread] Current Thread [Next in Thread]