View Issue Details

IDProjectCategoryView StatusLast Update
0000526Ecere SDKidepublic2013-09-23 07:38
Reporterredj Assigned Tojerome  
PriorityimmediateSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
PlatformLinuxOSMintOS Version9Isadora
Target Version0.44.07Fixed in Version0.44.07 
Summary0000526: ide: makefile generation: Automatically include -lstdc++ if any C++ file is included in the project
Descriptionide: toolchain: .cpp files are compiled by calling gcc instead of g++ -- this is causing an issue with the basic sdl test

how should .cpp files be compiled?
Steps To Reproducetry compiling attached project

-- the ide generated makefile will make the following call: gcc -m32 obj/debug.linux/sdlTest.o -lSDL -o obj/debug.linux/sdlTest
(that call will fail)

and compare with this command: g++ -o test-sdl sdlTest.cpp -lSDL

(running test-sdl will say nothing if sdl test is successful)
Additional Informationin IDE, linking results:
Linking...

   obj/release.linux/sdlTest.o:(.data.DW.ref.__gxx_personality_v0[DW.ref.__gxx_personality_v0]+0x0): error: undefined reference to `__gxx_personality_v0'

   collect2: ld returned 1 exit status

sdlTest (Release) - 1 error, no warning
TagsNo tags attached.

Activities

2010-08-04 08:05

 

sdlTest.epj (641 bytes)

2010-08-04 08:05

 

sdlTest.cpp (210 bytes)

jerome

2010-08-04 11:35

administrator   ~0000312

Have you tried adding stdc++ in the Linker tab/Libraries ?

redj

2010-08-04 15:32

administrator   ~0000313

<ESphynx> and my note is about the missing -lstdc++
<ESphynx> which is probably the issue.
<redj> I have not
<ESphynx> do we want to force -lstdc++ when a .cpp is included? maybe.
<redj> (tried stdc++)
<redj> well, since calling g++ doest that obviously, it might be natural that when you add .cpp files they have the -lstdc++ on which you can later disable
<redj> (if that's possible)
<ESphynx> good point.
<ESphynx> g++ does that ... let's force it.
<ESphynx> disable - no need.

jerome

2011-05-20 22:51

administrator   ~0000438

I think this has to do with the order in which SDL and stdc++ are put on the linker command. If it is the case I don't need we should switch to invoking g++.

jerome

2011-06-10 07:33

administrator   ~0000444

Updated the description. Fix as it says.

jerome

2012-07-10 19:42

administrator   ~0000608

Last edited: 2012-07-10 20:32

Since GCC 4.5, we're running into very inconvenient crashes on freeing libraries containing C++ code but not linked through the g++ command:

https://sourceforge.net/tracker/?func=detail&atid=102435&aid=3542140&group_id=2435

As a work around for these GCC version, let's invoke g++ for both compiling C++ files and linking projects containing C++ files.

UPDATE: As a matter of fact, the actual problem is that -lstdc++ makes use of the shared libgcc, and so -shared-libgcc must be used when linking with 'gcc'.
An alternative is to link libstdc++ statically with -static-libstdc++ .

jerome

2012-07-10 21:34

administrator   ~0000609

Fixed by https://github.com/ecere/sdk/commit/384ad752fcf52ee54f274730d71d29a8fb91e00e

Issue History

Date Modified Username Field Change
2010-08-04 08:05 redj New Issue
2010-08-04 08:05 redj File Added: sdlTest.epj
2010-08-04 08:05 redj Relationship added child of 0000429
2010-08-04 08:05 redj Status new => assigned
2010-08-04 08:05 redj Assigned To => redj
2010-08-04 08:05 redj File Added: sdlTest.cpp
2010-08-04 08:06 redj Priority normal => immediate
2010-08-04 11:35 jerome Note Added: 0000312
2010-08-04 15:32 redj Note Added: 0000313
2011-05-20 22:51 jerome Note Added: 0000438
2011-06-10 07:33 jerome Note Added: 0000444
2011-06-10 07:33 jerome Summary ide: toolchain: .cpp files are compiled by calling gcc instead of g++ -- this is causing an issue with the basic sdl test => ide: makefile generation: Automatically include -lstdc++ if any C++ file is included in the project
2012-03-08 15:41 redj Target Version old 0.44.pre2 => 0.45 Ginkakuji
2012-03-08 17:44 redj Relationship deleted child of 0000429
2012-03-29 07:52 redj Category => ide
2012-03-29 07:52 redj Project @3@ => Ecere SDK
2012-07-10 19:42 jerome Note Added: 0000608
2012-07-10 19:42 jerome Assigned To redj => jerome
2012-07-10 20:32 jerome Note Edited: 0000608
2012-07-10 21:34 jerome Status assigned => resolved
2012-07-10 21:34 jerome Fixed in Version => 0.44.1 Android
2012-07-10 21:34 jerome Resolution open => fixed
2012-07-10 21:34 jerome Note Added: 0000609
2013-04-25 21:37 jerome Target Version 0.45 Ginkakuji => 0.44.07
2013-05-19 22:15 jerome Status resolved => closed
2013-09-23 07:38 jerome Fixed in Version 0.44.12 Fixes => 0.44.07