Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
25 crawler(s) on-line.
 54 guest(s) on-line.
 0 member(s) on-line.



You are an anonymous user.
Register Now!
 pixie:  10 mins ago
 BigD:  30 mins ago
 chloeneelson:  38 mins ago
 VooDoo:  40 mins ago
 agami:  1 hr 5 mins ago
 jakiv:  1 hr 22 mins ago
 jPV:  1 hr 38 mins ago
 Musashi5150:  1 hr 47 mins ago
 pavlor:  2 hrs 28 mins ago
 Gunnar:  3 hrs 1 min ago

/  Forum Index
   /  Amiga Development
      /  C++ in Amiga Shared Libraries
Register To Post

PosterThread
Wanderer 
C++ in Amiga Shared Libraries
Posted on 28-Jun-2016 5:09:28
#1 ]
Cult Member
Joined: 16-Aug-2008
Posts: 654
From: Germany

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

 Status: Offline
Profile     Report this post  

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle