|
Porting to AmigaOS4 thread |
Posted on: 2019/2/13 13:20
#1 |
---|---|---|
Home away from home
![]() ![]() Joined:
2006/11/26 21:45 From a dying planet
Posts: 3939
|
Since nobody done it and i really need (want) a central meeting point of all questions porting i start a thread here (yes, i know about OS4Porting and the IRC and some other sites, but i'm not going to register to any more sites, so...)
First question: I'm trying to port (from scratch) a program (available for linux, windows, mac and android, so i guess pretty portable already) but am stuck with a compiler error which "seems" to be really easy to fix, but alas it's not. This is the snippet from the file in question (src/dctypes.h, lines 31-40)
...
and this is the error the compiler is throwing...obviously the mentioned "fix" doesn't comply as #include <string> is already in place
mkdir -p obj
Is this one of those c++11 (or higher) errors (which are not or only partly supported yet) or do i need to adapt the source in one way or another? Using gcc 8.1.0 here |
|
_________________
People are dying. Entire ecosystems are collapsing. We are in the beginning of a mass extinction. And all you can talk about is money and fairytales of eternal economic growth. How dare you! – Greta Thunberg |
||
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/13 14:15
#2 |
---|---|---|
Just popping in
![]() ![]() Joined:
2018/12/16 8:42 From Czech Republic
Posts: 53
|
@Raziel
I think it is great idea, I will also find it handy That wstring issue... I'm also dealing with it at the moment in one project, but no solution so far |
|
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/13 14:27
#3 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6693
|
@Raziel
Wstring stuff is about unicode wide characters (which half implemented if i remember right). So to make it works you can do as Alfkil do for his QT port:
namespace std
Cant say how good that hack is, but probably all will works fine except parts where some non-standard text characters will be used in some text. |
|
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/13 16:14
#4 |
---|---|---|
Home away from home
![]() ![]() Joined:
2006/11/20 16:26 From Norway
Posts: 2886
|
@Raziel
If your have "using namespace std; " Then the following lines, is assumed that is inside std namespace, so you do not need "std::" in the typedef, because it know it's this you're talking about. So it should be fine to do: typedef string AnsiString; typedef string Utf8String; typedef wstring WideString; |
|
_________________
(NutsAboutAmiga) Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps. |
||
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/13 16:32
#5 |
---|---|---|
Just popping in
![]() ![]() Joined:
2008/8/21 1:11 Posts: 96
|
I've always wanted to know what to do about a program that calls fork().
It's a basic POSIX thing that we don't have on the Amiga. Thanks! Bill "tekmage" Borsari |
|
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/13 16:36
#6 |
---|---|---|
Home away from home
![]() ![]() Joined:
2006/11/20 16:26 From Norway
Posts: 2886
|
@tekmage
fork() is Linux kernel thing, it's not posix thing. use pthreads or threads in C++11. the thing to do is look for Windows workaround for it, as its not supported in windows as well. |
|
_________________
(NutsAboutAmiga) Basilisk II for AmigaOS4 AmigaInputAnywhere Excalibur and other tools and apps. |
||
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/13 18:44
#7 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1200
|
@LiveForIt
Sure? http://man7.org/linux/man-pages/man2/fork.2.html "POSIX.1-2001, POSIX.1-2008, SVr4, 4.3BSD." |
|
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/13 18:52
#8 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2007/7/14 21:30 From Lothric
Posts: 1200
|
@tekmage
Which program you are referring to? |
|
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/13 22:54
#9 |
---|---|---|
Quite a regular
![]() ![]() Joined:
2007/2/27 10:47 From Gravity well
Posts: 723
|
fork()'s so POSIX
I read that as "any program that calls fork()". -- Suggestions for this sort of thing? to_string doesn't seem to be in std
#include <string>
Edited by Thematic on 2019/2/14 0:57:56
|
|
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/14 4:00
#10 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/1/26 21:48 From New Zealand
Posts: 2310
|
@Thematic
Quote:
You need C++11 for std::to_string() (see here. So add -std=c++11 or -std=gnu++11 to the compiler's command line parameters. You may also need to use a newer version of GCC. Hans |
|
_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. https://keasigmadelta.com/ - more of my work |
||
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/14 7:02
#11 |
---|---|---|
Quite a regular
![]() ![]() Joined:
2007/2/27 10:47 From Gravity well
Posts: 723
|
@Hans
gcc is 8.1.0. I've tried lots of things. Even with space marines it won't make any difference. |
|
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/14 7:16
#12 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/1/26 21:48 From New Zealand
Posts: 2310
|
@Thematic
Oops! I forgot that I also tweaked one of the header files. Details are here (down the bottom). Switching to clib2 may also work, although you may find that other functions are missing then. Hans |
|
_________________
http://hdrlab.org.nz/ - Amiga OS 4 projects, programming articles and more. https://keasigmadelta.com/ - more of my work |
||
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/15 12:31
#13 |
---|---|---|
Home away from home
![]() ![]() Joined:
2007/9/11 12:31 From Russia
Posts: 6693
|
@Thematic
Alternatively, if you do not want to touch system headers as Hans show, you can do some workaround like we do in Barony:
#ifdef __amigaos4__
|
|
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/15 20:58
#14 |
---|---|---|
Home away from home
![]() ![]() Joined:
2006/11/26 21:45 From a dying planet
Posts: 3939
|
@kas1e
Thank you, that workaround did the trick. @Liveforit Unfortunately that fix doesn't work. The error changes and the suggested fix does too, but it still breaks. |
|
_________________
People are dying. Entire ecosystems are collapsing. We are in the beginning of a mass extinction. And all you can talk about is money and fairytales of eternal economic growth. How dare you! – Greta Thunberg |
||
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/16 6:54
#15 |
---|---|---|
Just can't stay away
![]() ![]() Joined:
2006/11/30 11:30 From Finland
Posts: 1775
|
@Raziel
An alternative fix for missing std::to_string and std::wstring.
#ifdef __amigaos4__
|
|
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/16 7:28
#16 |
---|---|---|
Home away from home
![]() ![]() Joined:
2006/11/26 21:45 From a dying planet
Posts: 3939
|
@salass00
Thank you, works too. This will hopefully become a nice lookup thread for common (porting) problems. |
|
_________________
People are dying. Entire ecosystems are collapsing. We are in the beginning of a mass extinction. And all you can talk about is money and fairytales of eternal economic growth. How dare you! – Greta Thunberg |
||
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/16 17:12
#17 |
---|---|---|
Home away from home
![]() ![]() Joined:
2006/11/26 21:45 From a dying planet
Posts: 3939
|
Next issue...i tried to build (after a year long hiatus) ScummVM with SDL1 (for test cases), but i get a linker error
LINK scummvm
which is strange, because everything else is picked up correctly and i have the latest SD1 installed |
|
_________________
People are dying. Entire ecosystems are collapsing. We are in the beginning of a mass extinction. And all you can talk about is money and fairytales of eternal economic growth. How dare you! – Greta Thunberg |
||
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/16 18:39
#18 |
---|---|---|
Quite a regular
![]() ![]() Joined:
2013/10/17 16:21 From Hungary
Posts: 648
|
SDL is written in C, so the SdlAudioCDManager class probably belongs to ScummVM.
|
|
_________________
I see the jimmies have been rustled. |
||
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/16 19:28
#19 |
---|---|---|
Home away from home
![]() ![]() Joined:
2006/11/26 21:45 From a dying planet
Posts: 3939
|
@BSzili
So, it might be a missing #include in the ScummVM code? |
|
_________________
People are dying. Entire ecosystems are collapsing. We are in the beginning of a mass extinction. And all you can talk about is money and fairytales of eternal economic growth. How dare you! – Greta Thunberg |
||
|
Re: Porting to AmigaOS4 thread |
Posted on: 2019/2/16 20:36
#20 |
---|---|---|
Quite a regular
![]() ![]() Joined:
2007/2/27 10:47 From Gravity well
Posts: 723
|
@Raziel
I think missing includes are caught in compilation, unless something weird was attempted maybe? Linking undefined reference suggests missing library, which is all too common. For instance library a could depend on library b, so -la is not enough. Also the order they are in the command line may make a difference. I learned half the things from this http://www.os4depot.net/index.php?fun ... ment/manual/spots-pfd.lha |
|