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 freeglutlibraryfunctio


From: Zdenek Hutyra
Subject: Re: [Mingw-cross-env-list] Undefined reference to freeglutlibraryfunctions
Date: Fri, 17 Dec 2010 12:59:07 +0100

Yes, FREEGLUT_STATIC was first thing I tried, but the library itself is compiled
without it, so the names doesn't match again and .mk patch is required anyway.

I was thinking about just defining it in the header file, which IMHO would be
good enough for purposes of MCE, but the I saw the DevIL... :) (which BTW IMO
can't correctly detect [compile test progs] GLUT and would need help of .pc 
file too)

zh

______________________________________________________________
> Od: "Volker Grabsch" <address@hidden>
> Komu: address@hidden
> Datum: 17.12.2010 10:41
> Předmět: Re: [Mingw-cross-env-list] Undefined reference to 
> freeglutlibraryfunctions
>
>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]