Hi!
I have successfully written various Amiga Shared Libraries for 68k, where I used plain C or C++ without STL or other modern features. Using libnix, I can even use floats and posix functions.
I usually run
GG:bin/gcc -o2 -m68040 -nostartfiles -noixemul my_funky_lib.o ...
Now, I tried things like std::string, std::vector etc. and it compiles (I was a bit surprised!), but it doesn't link. I get undefined references like
Quote:
../MidiInterface.o(.text+0x920): undefined reference to `__malloc_alloc_template::__malloc_alloc_oom_handler' ../MidiInterface.o(.text+0x92e): undefined reference to `endl(ostream &)' ../MidiInterface.o(.text+0x938): undefined reference to `cerr' ../MidiInterface.o(.text+0x9a4): undefined reference to `__default_alloc_template::_S_end_free' ../MidiInterface.o(.text+0x9aa): undefined reference to `__default_alloc_template::_S_start_free' ../MidiInterface.o(.text+0x9be): undefined reference to `__default_alloc_template::_S_start_free' ../MidiInterface.o(.text+0x9ca): undefined reference to `__default_alloc_template::_S_start_free' ../MidiInterface.o(.text+0xa0c): undefined reference to `__default_alloc_template::_S_start_free' ../MidiInterface.o(.text+0xa18): undefined reference to `__default_alloc_template::_S_start_free' ../MidiInterface.o(.text+0xa2c): undefined reference to `__default_alloc_template::_S_heap_size' ../MidiInterface.o(.text+0xa66): undefined reference to `__default_alloc_template::_S_free_list' ../MidiInterface.o(.text+0xa72): undefined reference to `__default_alloc_template::_S_start_free' ...
|
Any chance I get this working under OS3.9? I am using GCC 2.95.3. Do I need a newer GCC?
BTW, does anyone know a working combination version of gdb and gcc? Everything I tried from Aminet crashed pretty quickly as soon as try debugging.
EDIT: I found out that where the libs are, and when I add the stdc++ lib, it links. I haven't tested if it actually works though, and the library get pretty fat (>500kb without actually doing anything). My command line is now:
Quote:
GG:bin/gcc -o2 -m68040 -m68881 -nostartfiles -noixemul trumptus_lib.o ../Synthesizer.o ../MidiInterface.o lib_nix.o -lm -lstdc++ -o trumptus.library
|
But seems like I don't need the -lm option.Last edited by Wanderer on 28-Jun-2016 at 06:10 AM. Last edited by Wanderer on 28-Jun-2016 at 06:05 AM. Last edited by Wanderer on 28-Jun-2016 at 06:04 AM. Last edited by Wanderer on 28-Jun-2016 at 05:10 AM.
_________________ -- Author of HD-Rec, Sweeper, Samplemanager, ArTKanoid, Monkeyscript, Toadies, AsteroidsTR, TuiTED, PosTED, TKPlayer, AudioConverter, ScreenCam, PerlinFX, MapEdit, AB3 Includes and many more... Homepage: http://www.hd-rec.de |