14 July 2021, 18:53 | #1 |
Registered User
Join Date: Jan 2021
Location: UK
Posts: 53
|
Amiga C++ vs PC version
Hi All,
After typing in a relatively simple C++ program I found on the web and compiling it in Storm C version 3, I noticed that there are multiple compilation errors being flagged. The first line I was able to fix by looking at another program written in C++ on Storm C, but is there anywhere which has a list of Amiga specific versions of commands etc that map to more modern C++ usage? The PC version program is shown here ... https://www.programiz.com/cpp-progra...raphical-order The first line I was able to amend to "#include <iostream.h>" and it passed the compile test, but the second line "using namespace std;" Storm C didn't like and I've no idea how to fix it ... and then there are around 23 errors in total evidently for this program. Cheers in advance for any help on this! |
14 July 2021, 19:15 | #2 |
Amigan
Join Date: Feb 2012
Location: London
Posts: 1,321
|
All of the native C++ compilers for the Amiga are pretty old.
If you want something more modern you will need to cross-compile. I tried the first example on that page and it compiles and runs with Bebbo's GCC port. https://github.com/bebbo/amiga-gcc Code:
m68k-amigaos-g++ -noixemul -O2 test.cpp -s -o test |
14 July 2021, 19:41 | #3 | |
Registered User
Join Date: Jan 2021
Location: UK
Posts: 53
|
Quote:
|
|
14 July 2021, 21:36 | #4 |
Registered User
Join Date: Jun 2008
Location: somewhere else
Posts: 545
|
Code:
#include <iostream> //using namespace std; int main() { std::string str[10], temp; std::cout << "Enter 10 words: " << std::endl; for(int i = 0; i < 10; ++i) { getline(std::cin, str[i]); } // Use Bubble Sort to arrange words for (int i = 0; i < 9; ++i) { for (int j = 0; j < 9 - i; ++j) { if (str[j] > str[j + 1]) { temp = str[j]; str[j] = str[j + 1]; str[j + 1] = temp; } } } std::cout << "In lexicographical order: " << std::endl; for(int i = 0; i < 10; ++i) { std::cout << str[i] << std::endl; } return 0; } I'm not sure that getline is available in storm C. The 800k are taken by the c++ standard library. |
08 November 2022, 15:59 | #5 |
bye
Join Date: Jun 2016
Location: Some / Where
Posts: 684
|
you can save some bytes by specifying
Code:
-Wl,-gc-sections |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Why Myth's C64 version is better than Amiga version? | amuleth | Retrogaming General Discussion | 45 | 26 January 2018 12:22 |
Does anyone have a working version of SWOS with JST loader 2mb version? | earok | support.Games | 1 | 20 October 2015 21:15 |
Version 1.50 does not recognise ROMS - Vista 32 sp1 4gig 8800 . Version 1.5beta21 ok | Southie | support.WinUAE | 3 | 02 July 2008 15:49 |
Old version number? [GameBase version vs. GBA version + misc. questions] | wanderer | project.GameBase Amiga | 5 | 23 August 2007 00:51 |
I need an official version of Cannon Fodder! The cracked version can't save! | Sky_Shadow | support.Games | 6 | 23 August 2005 18:39 |
|
|