← Back to team overview

kicad-developers team mailing list archive

Re: Glew linking errors

 

I built Glew using MinGW and the Kicad build is still failing to link pcbnew, but the error messages are different.

[100%] Building CXX object pcbnew/CMakeFiles/pcbnew.dir/__/common/base_units.cpp
.obj
Linking CXX executable pcbnew.exe
..\common\libgal.a(opengl_gal.cpp.obj):opengl_gal.cpp:(.text+0x27d6): undefined
reference to `_imp__glewInit@0'
..\common\libgal.a(opengl_gal.cpp.obj):opengl_gal.cpp:(.text+0x2831): undefined
reference to `_imp____GLEW_VERSION_2_1'
..\common\libgal.a(opengl_gal.cpp.obj):opengl_gal.cpp:(.text+0x2a0f): undefined
reference to `_imp____GLEW_EXT_framebuffer_object'
..\common\libgal.a(opengl_gal.cpp.obj):opengl_gal.cpp:(.text+0x2a1d): undefined
reference to `_imp____GLEW_ARB_vertex_buffer_object'
..\common\libgal.a(opengl_gal.cpp.obj):opengl_gal.cpp:(.text+0x2af4): undefined
reference to `_imp__glewGetString@4'
..\common\libgal.a(opengl_gal.cpp.obj):opengl_gal.cpp:(.text+0x301f): undefined
reference to `_imp__glewGetErrorString@4'

Here are the commands I used to build Glew

gcc -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -DGLEW_BUILD -o src/glew.o -c src/glew.c

gcc -shared -Wl,-soname,libglew32.dll -Wl,--out-implib,lib/libglew32.dll.a -o lib/glew32.dll src/glew.o -L/mingw/lib -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32

ar cr lib/libglew32.a src/glew.o

In Cmake, I have

GLEW_GLEW_LIBRARY =glew-1.10.0/lib/libglew32.a

Any tips to help me figure out what I'm doing wrong?

David



On 3/10/2014 3:08 AM, jp charras wrote:
Le 10/03/2014 02:57, David Novak a écrit :
I've spent the last few days working to compile Kicad product and I'm so
close I can taste it. Currently, the compile is 100% complete, but now
the link is failing with messages regarding OpenGL.

Linking CXX executable pcbnew.exe
..\common\libgal.a(opengl_gal.cpp.obj):opengl_gal.cpp:(.text+0x2831):
undefined
reference to `_imp____GLEW_VERSION_2_1'
..\common\libgal.a(opengl_gal.cpp.obj):opengl_gal.cpp:(.text+0x2a0f):
undefined
reference to `_imp____GLEW_EXT_framebuffer_object'
..\common\libgal.a(opengl_gal.cpp.obj):opengl_gal.cpp:(.text+0x2a1d):
undefined
reference to `_imp____GLEW_ARB_vertex_buffer_object'
c:/tdm-gcc-32/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe:
..\co
mmon\libgal.a(opengl_gal.cpp.obj): bad reloc address 0x2 in section
`.text$_ZN5b
oost6detail17sp_counted_impl_pIN5KIGFX11VERTEX_ITEMEED1Ev[__ZN5boost6detail17sp_

counted_impl_pIN5KIGFX11VERTEX_ITEMEED1Ev]'

It looks like I've linked the wrong library for Glew. In Cmake I set

GLEW_GLEW_LIBRARY = glew-1.10.0/lib/Release/Win32/glew32.lib
No.

glew should be built using mingw (which is very easy).

Is this setting correct?

What else might be causing these errors?

The complete build output is below.

Any help is greatly appreciated.

Thanks,
David



--

David Novak

Dajac Inc.
317-608-0500 ext. 112

www.Dajac.com
David.Novak@xxxxxxxxx

This electronic message contains information which may be legally confidential and/or privileged. The information is intended solely for the individual or entity named above and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.



Follow ups

References