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

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


On January 8, 2009, Trent Gamblin wrote:
> 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:(.e
> >h_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?

AFAIK this is a known issue and was recently fixed wasn't it? Or was supposedly 
fixed :o

Before allegro only specified the C language in the cmake file, so cmake always 
called gcc to link. If you have to you can use the set_prop (or whatever its 
called) function to explicitly set the linker for those .cpp files to gxx/g++.

> Trent :{)>
>
> ---------------------------------------------------------------------------
>--- Check out the new SourceForge.net Marketplace.
> It is the best place to buy or sell services for
> just about anything Open Source.
> http://p.sf.net/sfu/Xq1LFB


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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