11 May 2017, 00:45 | #1 |
AmigaMan
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 763
|
Amidevcpp c++ link errors
Hello mates!
I´m trying to compile the simplest C++ project wit amidevcpp for classic Amiga with no success. I can do it for the rest of the targets but no for 68k and is a clean install. I get the follwing errors: Code:
Compilador: m68k-Amiga-OS3 Building Makefile: "C:\Users\Johan\Makefile.win" Ejecutando make clean rm -f MorphOS_hello.o Proyecto1.exe m68k-amigaos-g++.exe -c MorphOS_hello.cpp -o MorphOS_hello.o -I"C:/CrossCompiler/AmiDevCpp/usr/local/amiga/m68k-amigaos/sys-include" -s -noixemul m68k-amigaos-g++.exe MorphOS_hello.o -o "Proyecto1.exe" -L"C:/CrossCompiler/AmiDevCpp/usr/local/amiga/m68k-amigaos/lib" -L"C:/CrossCompiler/AmiDevCpp/usr/local/amiga/m68k-amigaos/lib/libb/libnix" -s -noixemul C:/CrossCompiler/AmiDevCpp/usr/local/amiga/m68k-amigaos/lib/libstdc++.a(misc-inst.o)(.text+0xfe):misc-inst.o: undefined reference to `_getc' C:/CrossCompiler/AmiDevCpp/usr/local/amiga/m68k-amigaos/lib/libstdc++.a(misc-inst.o)(.text+0x128):misc-inst.o: undefined reference to `_getc' C:/CrossCompiler/AmiDevCpp/usr/local/amiga/m68k-amigaos/lib/libstdc++.a(misc-inst.o)(.text+0x1cc):misc-inst.o: undefined reference to `_putc' C:/CrossCompiler/AmiDevCpp/usr/local/amiga/m68k-amigaos/lib/libstdc++.a(basic_file.o)(.text+0x1c4):basic_file.o: undefined reference to `_fdopen' collect2: ld returned 1 exit status mingw32-make.exe: *** [Proyecto1.exe] Error 1 The example is: Code:
#include <iostream> using namespace std; int main (int argc, char *argv[]) { cout << "Hello Amiga World!" << endl; cout << "Press ENTER to continue..." << endl; cin.get(); return 0; } Last edited by tolkien; 11 May 2017 at 00:48. Reason: Typo |
11 May 2017, 10:45 | #2 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,200
|
Looks like libnix is linking before libstdc++. Order is significant.
|
11 May 2017, 11:10 | #3 |
AmigaMan
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 763
|
It can be but it should be done right by the IDE. Will look for to how to change that per default.
Thanks samurai_crow! |
11 May 2017, 20:21 | #4 |
AmigaMan
Join Date: Oct 2012
Location: Castro Urdiales/Spain
Posts: 763
|
I have tried various combinations and I can only compile it if I remove -noixemul from the link stage.
|
21 February 2018, 04:37 | #5 | |
Zone Friend
Join Date: Feb 2005
Location: USA
Posts: 35
|
Quote:
I believe that this is not really a solution and will eventually result in problems further down the road. Is there someone who is successfully using AmiDevCpp who can describe how they got around this problem and / or what their working configuration is? Thanks in Advance! |
|
21 February 2018, 06:40 | #6 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
dunno exactly, but the three functions are simply missing in libnix(!?).
they do exists in the gcc6 toolchain by bebbo. so here you can build it with: m68k-amigaos-g++.exe -noixemul hello.cpp Code:
$ m68k-amigaos-g++.exe -noixemul -Wl,--verbose hello.cpp ... (/opt/m68k-amigaos/m68k-amigaos/libnix/lib/libnix/libnix.a)putc.o (/opt/m68k-amigaos/m68k-amigaos/libnix/lib/libnix/libnix.a)fdopen.o (/opt/m68k-amigaos/m68k-amigaos/libnix/lib/libnix/libnix.a)getc.o ... most the things I build were done using ixemul.library and those did work. #1) you can use -Wl,--verbose linker option, this will not help here, but it lists all the libraries the linker is searching for functions. AmiDevCPP lists the output in the "Compiler Log" tab. #2) I was wrong with my assumption, other linker options, replacing "-noixemul", would build different binary, without using ixemul.library. but this was wrong and removed here :/ Last edited by emufan; 21 February 2018 at 07:07. |
01 March 2018, 04:10 | #7 | |
Zone Friend
Join Date: Feb 2005
Location: USA
Posts: 35
|
Quote:
From my perspective it is a bit of a shame that AmiDevCpp isn't really configured to just link and compile out of the box. It would probably be a bit more attractive to newbie users trying to get started with writing programs for AROS, 3.9, etc. In my case, there is no excuse really. I did have AmiDevCpp up and working fairly well once upon a time but I dropped out of the Ami scene for too long and am now trying to find my way again. If only I could find my notebooks that got packed away during the last move. |
|
23 September 2019, 14:47 | #8 |
Registered User
Join Date: Dec 2012
Location: Atlanta, USA
Posts: 154
|
Was the only solution to compiling C++ with AmiDevCPP to upgrade to gcc6 as mentioned earlier? I find AmiDevCPP to be fine with C programs, but I would like to port some C++ programs and I really like AmiDevCPP.
Thanks, |
08 November 2019, 01:18 | #9 |
Registered User
Join Date: Sep 2007
Location: Melbourne/Australia
Posts: 4,412
|
You don't need to upgrade AmiDevCPP to compile C++, I've compiled numerous C++ projects using it for Amiga 68k
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AmiDevCpp asm - undefined reference | Sephnroth | Coders. C/C++ | 14 | 27 December 2022 16:51 |
AmiDevCpp $(GLOBALDEPS) | mritter0 | Coders. C/C++ | 1 | 29 June 2015 01:30 |
AmiDevCpp | AF2013 | Coders. C/C++ | 0 | 14 March 2014 00:23 |
Problem compiling with AmiDevCpp | Franchute13 | Coders. C/C++ | 2 | 26 September 2013 15:01 |
AmiDevCpp and Floats | AmigaEd | Coders. General | 0 | 18 January 2006 03:16 |
|
|