[AD] big big bug in allegro mignw32 static library (read this one)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


i dont know for other static libraries, but in migw32 one
it can compile c programs but NOT cpp programs (giving out lots of undefined
external references)

maybe a extern "C" { missed out?

for example, when i compile:
gcc -mwindows
a.c -lalleg_s  -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lole32 -ldinput -lddr
aw -ldxguid -lwinmm -ldsound
wonderful, compiles ok

but when i change the file extension to cpp and do
gcc -mwindows
a.cpp -lalleg_s  -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lole32 -ldinput -ld
draw -ldxguid -lwinmm -ldsound

i get
C:\WINDOWS\TEMP\cct7pyfb.o(.text$set_window_title+0xd):a.cpp: undefined
reference to `_imp__system_driver'
C:\WINDOWS\TEMP\cct7pyfb.o(.text$set_window_title+0x1e):a.cpp: undefined
reference to `_imp__system_driver'

the error seems to be that AL_VAR instead of
#define AL_VAR(type, name)  extern type name
should be
#define AL_VAR(type, name) extern "C" type name

so patch attached with the solution, tested under djgpp and mingw32

also note that when trying to compile directly a static library without have
compiled a dll library first, i get one of those mmx.h errors

Attachment: alconfig.h.dif
Description: video/dv



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/