www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - still getting errors linking opengl

reply David Medlock <noone nowhere.com> writes:
Still trying to make D 1.018+ link with my (formerly working) OpenGL 
code.   1.017 still works right 'out of the zip'.

It appears to not want to link in opengl32.lib.  I am using glfw 2.5 and 
its bundled OpenGL bindings with Digital Mars C libraries.

I get the usual errors when the opengl32.lib is not specified even when 
I copy the lib into my project directory directory.

Z:\proj\python\build\obj\main_rel.obj(main_rel)
  Error 42: Symbol Undefined _D2gl7glBeginFkZv
Z:\proj\python\build\obj\main_rel.obj(main_rel)
  Error 42: Symbol Undefined _D2gl10glColor3ubFhhhZv
Z:\proj\python\build\obj\main_rel.obj(main_rel)
  Error 42: Symbol Undefined _D2gl10glVertex3fFfffZv
Z:\proj\python\build\obj\main_rel.obj(main_rel)
  Error 42: Symbol Undefined _D2gl5glEndFZv
Z:\proj\python\build\obj\main_rel.obj(main_rel)
  Error 42: Symbol Undefined _D2gl9glColor3fFfffZv
Z:\proj\python\build\obj\main_rel.obj(main_rel)
  Error 42: Symbol Undefined _D2gl12glTexImage2DFkiiiiikkPvZv
Z:\proj\python\build\obj\main_rel.obj(main_rel)
  Error 42: Symbol Undefined _D2gl12glTexCoord2fFffZv
Z:\proj\python\build\obj\main_rel.obj(main_rel)
  Error 42: Symbol Undefined _D2gl10glVertex2fFffZv

Since the glfw header starts with:

version( Win32 ) extern(Windows):

Shouldn't those errors be C-mangled names and not D ones?

Any pointers?  Walter?

-David
Dec 04 2007
parent reply Daniel Keep <daniel.keep.lists gmail.com> writes:
David Medlock wrote:
 ...
 Since the glfw header starts with:
 
 version( Win32 ) extern(Windows):
 
 Shouldn't those errors be C-mangled names and not D ones?
 
 Any pointers?  Walter?
 
 -David
No; that was a bug in the compiler that got fixed after that version. The "extern(Windows)" only takes effect to the end of the version block. If you want to use extern(Windows) on windows and extern(C) on everything else, replace: version( Win32 ) extern(Windows): else extern(C): With: extern(System): -- Daniel
Dec 04 2007
parent David Medlock <noone nowhere.com> writes:
Daniel Keep wrote:
 
 David Medlock wrote:
 ...
 Since the glfw header starts with:

 version( Win32 ) extern(Windows):

 Shouldn't those errors be C-mangled names and not D ones?

 Any pointers?  Walter?

 -David
No; that was a bug in the compiler that got fixed after that version. The "extern(Windows)" only takes effect to the end of the version block. If you want to use extern(Windows) on windows and extern(C) on everything else, replace: version( Win32 ) extern(Windows): else extern(C): With: extern(System): -- Daniel
Thanks for the heads up on that Daniel. I posted a message in the glfw forums on sourceforge. -David
Dec 05 2007