Re: [AD] Static linking requires libstdc++ with mingw?

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


On Thu, January 8, 2009 8:33 am, Elias Pschernig said:
> Using mingw, I get errors like this:
>
> gcc.exe -W -Wall -g -DDEBUGMODE=1 "CMakeFiles/ex_bitmap.dir/ex_bitmap.c.obj"
>     -o ex_bitmap.exe -Wl,--out-implib,libex_bitmap.dll.a
>    -Wl,--major-image-version,0,--minor-image-version,0
>    ../lib/liba5_iio-debug-static-4.9.8.a
>    ../lib/liballegro-debug-static-4.9.8.a
>    -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lole32 -ldxguid -lwinmm -lpsapi
>    /C/MinGW/lib/libd3d9.a /C/MinGW/lib/libdinput8.a
>    -lopengl32 -lglu32 /C/MinGW/lib/libpng.dll.a /C/MinGW/lib/libz.dll.a
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
> Warning: .drectve `/DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" ' unrecognized
> ../lib/liballegro-debug-static-4.9.8.a(d3d_disp.cpp.obj):d3d_disp.cpp:(.eh_frame+0x11): undefined reference to
> `__gxx_personality_v0'
> ../lib/liballegro-debug-static-4.9.8.a(d3d_bmp.cpp.obj):d3d_bmp.cpp:(.eh_frame+0x11): undefined reference to
> `__gxx_personality_v0'
> collect2: ld returned 1 exit status
>
> Does anyone else get the same?
>
> Adding -lstdc++ fixes the problem for me, so we could simply add that to
> the examples when using the static build in Windows.
>
> But apparently my DirectX libraries are a bit broken (as hinted to by
> those 4 warnings). So do we logically have to add -lstdc++ if the static
> library sources are C++ (d3d_disp.cpp and d3d_bmp.cpp), or should I try
> finding a better set of DX libraries for mingw? Or something else?

The warnings aren't because of your DX, it happens no matter what. I don't know what the problem there is. I get it
when linking static A4 too. It's safe to ignore them though. But needing to link in libstdc++ is a bit odd... that
could be something to do with your mingw setup, since I've never seen that or heard of anyone else seeing it. It
wouldn't hurt I suppose to explicitly link it, but I'm wondering if there isn't something else at fault. What version
of gcc/g++ do you have? What packages did you install?

Trent :{)>




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