English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 20 December 2017, 20:56   #1
lantus360
Registered User
 
Join Date: Feb 2013
Location: Olathe, Kansas
Posts: 198
Postal - Port to the Amiga - is there a decent C++ compiler ?

One of my favorite games is Postal by Running With Scissors. Its recently opened sourced and an ideal candidate for an Amiga port!

https://bitbucket.org/gopostal/postal-1-open-source

I can easily port Postal to the Amiga. I have even refactored all the SDL2 calls to SDL 1.2. I tested this with a quick original Xbox port that runs well using controllers and SDL1.2 - for a sneak peek (at 8:36 or so) - [ Show youtube player ]

The problem with the Amiga port is this code is all C++ and makes substantial use of STL (Standard Template Library) which isnt supported by any C++ compiler ive tried.

AmiDevCPP gives errors on <map>

Krystian Bacławski gcc gives me a constructor error

the closest ive gotten is beebos gcc/g++ 6.3.1b and that returns the following error

Code:
m68k-amigaos-g++ -c -o bin/AnimThing.o AnimThing.cpp -std=c++11 -m68020 -ffast-math -DAMIGA -DSYS_ENDIAN_BIG -fsigned-char -DPLATFORM_UNIX -w -DLOCALE=US -DTARG                             ET=POSTAL_2015 -I. -I./SDL2/include -I./RSPiX -I./RSPiX/Inc -I./RSPiX/Src -I./RS                             PiX/Src/BLUE -I./RSPiX/Src/BLUE/unix -I./RSPiX/Src/CYAN -I./RSPiX/Src/CYAN/Unix                              -I./RSPiX/Src/ORANGE -I./RSPiX/Src/ORANGE/CDT -I./RSPiX/Src/ORANGE/GameLib -I./R                             SPiX/Src/ORANGE/File -I./RSPiX/Src/ORANGE/Multigrid -I./RSPiX/Src/GREEN/Image -I                             ./WishPiX -I./WishPiX/Spry -DALLOW_TWINSTICK  -DNDEBUG -D_NDEBUG -O2
In file included from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             ext/string_conversions.h:43:0,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             bits/basic_string.h:5417,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             string:52,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             stdexcept:39,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             array:39,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             tuple:39,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             bits/stl_map.h:63,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             map:61,
                 from WishPiX/ResourceManager/resmgr.h:215,
                 from game.h:124,
                 from thing.h:270,
                 from hood.h:109,
                 from scene.h:180,
                 from realm.h:324,
                 from AnimThing.h:54,
                 from AnimThing.cpp:73:
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/cstdio:176:11: error:                              ‘::vfscanf’ has not been declared
   using ::vfscanf;
           ^~~~~~~
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/cstdio:186:22: error:                              ‘__gnu_cxx::vfscanf’ has not been declared
   using ::__gnu_cxx::vfscanf;
                      ^~~~~~~
am i wasting my time here? will we ever see a decent C++ Amiga compiler? I dont much care for rewriting all the C++ code as C
lantus360 is offline  
Old 20 December 2017, 21:06   #2
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
I've got the same error with some project using gcc6.
in this case I switch to AmiDevCPP`s gcc3.4.0 - which sometimes helps, but may result in other errors.

you may try to use one of the gcc options in your makefile:
-noixemul or -mcrt=clib2 or -mcrt=nix13
maybe some other c++ standard may help: -std=c++03 instead of -std=c++11
perhaps one will work.

Last edited by emufan; 20 December 2017 at 21:12.
emufan is offline  
Old 20 December 2017, 21:09   #3
lantus360
Registered User
 
Join Date: Feb 2013
Location: Olathe, Kansas
Posts: 198
i get errors with STL:map with AmiDevCpp. This is normally my compiler of choice.

None of those flags help either, im hoping someone can tell me of a C++ m68k compiler that has complete STL support
lantus360 is offline  
Old 20 December 2017, 21:15   #4
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
Quote:
Originally Posted by lantus360 View Post
i get errors with STL:map with AmiDevCpp. This is normally my compiler of choice.

None of those flags help either, im hoping someone can tell me of a C++ m68k compiler that has complete STL support
so report it to bebbo, maybe he can fix this issue. dunno else.
emufan is offline  
Old 20 December 2017, 21:24   #5
grelbfarlk
Registered User

 
Join Date: Dec 2015
Location: USA
Posts: 1,458
I thought the same thing, and had less luck with g++ 2.95.3.
grelbfarlk is offline  
Old 01 January 2018, 13:40   #6
arti
Registered User

 
Join Date: Jul 2008
Location: Poland
Posts: 514
Try g++ version 4.3.2 or 4.5.0
arti is offline  
Old 02 January 2018, 16:43   #7
lantus360
Registered User
 
Join Date: Feb 2013
Location: Olathe, Kansas
Posts: 198
Quote:
Originally Posted by arti View Post
Try g++ version 4.3.2 or 4.5.0
can you tell me where i can find these for m68k ?
lantus360 is offline  
Old 03 January 2018, 00:30   #8
arti
Registered User

 
Join Date: Jul 2008
Location: Poland
Posts: 514
On amiga sourceforge.
arti is offline  
Old 03 January 2018, 21:28   #9
cla
dev

cla's Avatar
 
Join Date: Aug 2014
Location: Copenhagen
Age: 43
Posts: 63
Send a message via ICQ to cla
Quote:
Originally Posted by lantus360 View Post
is there a decent C++ compiler
Not in terms of C++17/14/11.
cla is offline  
Old 04 March 2018, 19:42   #10
bebbo
Registered User

 
Join Date: Jun 2016
Location: Hamburg/Germany
Posts: 307
Quote:
Originally Posted by lantus360 View Post
One of my favorite games is Postal by Running With Scissors. Its recently opened sourced and an ideal candidate for an Amiga port!

https://bitbucket.org/gopostal/postal-1-open-source

I can easily port Postal to the Amiga. I have even refactored all the SDL2 calls to SDL 1.2. I tested this with a quick original Xbox port that runs well using controllers and SDL1.2 - for a sneak peek (at 8:36 or so) - [ Show youtube player ]

The problem with the Amiga port is this code is all C++ and makes substantial use of STL (Standard Template Library) which isnt supported by any C++ compiler ive tried.

AmiDevCPP gives errors on <map>

Krystian Bacławski gcc gives me a constructor error

the closest ive gotten is beebos gcc/g++ 6.3.1b and that returns the following error

Code:
m68k-amigaos-g++ -c -o bin/AnimThing.o AnimThing.cpp -std=c++11 -m68020 -ffast-math -DAMIGA -DSYS_ENDIAN_BIG -fsigned-char -DPLATFORM_UNIX -w -DLOCALE=US -DTARG                             ET=POSTAL_2015 -I. -I./SDL2/include -I./RSPiX -I./RSPiX/Inc -I./RSPiX/Src -I./RS                             PiX/Src/BLUE -I./RSPiX/Src/BLUE/unix -I./RSPiX/Src/CYAN -I./RSPiX/Src/CYAN/Unix                              -I./RSPiX/Src/ORANGE -I./RSPiX/Src/ORANGE/CDT -I./RSPiX/Src/ORANGE/GameLib -I./R                             SPiX/Src/ORANGE/File -I./RSPiX/Src/ORANGE/Multigrid -I./RSPiX/Src/GREEN/Image -I                             ./WishPiX -I./WishPiX/Spry -DALLOW_TWINSTICK  -DNDEBUG -D_NDEBUG -O2
In file included from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             ext/string_conversions.h:43:0,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             bits/basic_string.h:5417,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             string:52,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             stdexcept:39,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             array:39,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             tuple:39,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             bits/stl_map.h:63,
                 from /opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/                             map:61,
                 from WishPiX/ResourceManager/resmgr.h:215,
                 from game.h:124,
                 from thing.h:270,
                 from hood.h:109,
                 from scene.h:180,
                 from realm.h:324,
                 from AnimThing.h:54,
                 from AnimThing.cpp:73:
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/cstdio:176:11: error:                              ‘::vfscanf’ has not been declared
   using ::vfscanf;
           ^~~~~~~
/opt/m68k-amigaos/lib/gcc/m68k-amigaos/6.3.1b/include/c++/cstdio:186:22: error:                              ‘__gnu_cxx::vfscanf’ has not been declared
   using ::__gnu_cxx::vfscanf;
                      ^~~~~~~
am i wasting my time here? will we ever see a decent C++ Amiga compiler? I dont much care for rewriting all the C++ code as C
add -noixemul and try the recent version from https://github.com/bebbo/amiga-gcc
bebbo is offline  
Old 09 March 2018, 00:34   #11
lantus360
Registered User
 
Join Date: Feb 2013
Location: Olathe, Kansas
Posts: 198
hi beebo, i will give it a try


thanks!
lantus360 is offline  
Old 09 March 2018, 21:56   #12
lantus360
Registered User
 
Join Date: Feb 2013
Location: Olathe, Kansas
Posts: 198
this compiler works much nicer, thanks Beebo !
lantus360 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postal gone Open Source Shoonay Retrogaming General Discussion 1 29 December 2016 16:35
Any decent Amiga IDE? commodorejohn Coders. General 14 22 May 2013 23:37
amiga c/c++ compiler Fissuras request.Apps 41 18 June 2012 21:50
Are there any decent Amiga stores??? th4t1guy Amiga scene 10 11 December 2003 16:40
Best C Compiler for Amiga is? Pyromania Amiga scene 5 14 May 2002 18:17

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.08746 seconds with 15 queries