Hi Steve,

Assuming you are using version 2.8.0, it was built and tested on Visual Studio 2010, so you shouldn't have any problems getting it compiled and linked. Is the problem specific to the project below, or does it happen on even the simplest of GLUT applications? Which freeglut header file are you #include-ing? Can you include the full command line for your compilation and link steps?


On 26/04/2012 20:37, Stephen Jeffrey wrote:
Hi Dee,

I didn't compile the freeglut library - I am using pre-compiled versions. I have tried both the freeglut.lib provided with CUDA and also Martin Payne's version (using the link on your web page): http://www.transmissionzero.co.uk/software/freeglut-devel/. Both of these precompiled versions have mangled names.

Isn't it strange that in my object code the GLUT functions are not mangled, but other functions are? Is there something wrong with my header files? 


From: Diederick C. Niehorster <dcnieho@gmail.com>
To: Stephen Jeffrey <stephen_j_jeffrey@yahoo.com.au>; FreeGLUT developers list <freeglut-developer@lists.sourceforge.net>
Sent: Thursday, 26 April 2012 10:16 PM
Subject: Re: [Freeglut-developer] cannot link freeglut.lib using cygwin

well, the glut function names should not be mangled in the lib. That
what's the .def file is for. Are you passing that to the linker when
creating the lib?


On 26/04/2012, Stephen Jeffrey <stephen_j_jeffrey@yahoo.com.au> wrote:
> Hi
> I am getting an error linking freeglut.lib when using cl.exe (VS 2010) and
> cygwin on Windows 7:
> error LNK2019: unresolved external symbol _glutCreateWindow referenced in
> function "void __cdecl my_function()....
> My application requires both GLUT and CUDA. I can link with the CUDA library
> because CUDA function names are mangled in both my object code and the CUDA
> library.
> However, I cannot link with the GLUT library because the names are mangled
> in the library, but not in my object code:
> In my object code:
> U _cudaThreadExit@0
> U _glutInitWindowSize
> In cudart.lib:
> 00000000 T _cudaThreadExit@0
> In freeglut.lib:
> 00000000 T _glutInitWindowSize@8
> Does anyone know why the GLUT function names are not being mangled in my
> object code?
> cheers
> steve

Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

Freeglut-developer mailing list