Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
79 user(s) are online (63 user(s) are browsing Forums)

Members: 1
Guests: 78

K-L, more...
Support us!
Recent OS4 Files
OS4Depot.net
Report message:*
 

Porting to AmigaOS4 thread

Subject: Porting to AmigaOS4 thread
by Raziel on 2019/2/13 13:20:10

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)
...
#include <string>
#include <list>
#include <vector>

using namespace std;


typedef std::string AnsiString;
typedef std::string Utf8String;
typedef std::wstring WideString;
...


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
g
++ --o obj/AdActor.../src/AdActor.cpp -I../src -O2 -Wno-write-strings -Wno-conversion-null `freetype-config --cflags` `sdl2-config --cflags` -I/usr/local/include/bass
In file included from ../src/PlatformSDL.h:31,
                 
from ../src/dcgf.h:61,
                 
from ../src/AdActor.cpp:26:
../
src/dctypes.h:40:14error'wstring' in namespace 'std' does not name a type
 typedef std
::wstring WideString;
              ^~~~~~~
../
src/dctypes.h:40:9note'std::wstring' is defined in header '<string>'did you forget to '#include <string>'?
../
src/dctypes.h:32:1:
+
#include <string>
 #include <string>
../src/dctypes.h:40:9:
 
typedef std::wstring WideString;
         ^~~
../
src/dctypes.h:43:19error'WideString' was not declared in this scope
 typedef std
::list<WideStringWideStringList;
                   ^~~~~~~~~~
../
src/dctypes.h:43:19notesuggested alternative'Utf8String'
 
typedef std::list<WideStringWideStringList;
                   ^~~~~~~~~~
                   
Utf8String
../src/dctypes.h:43:29errortemplate argument 1 is invalid
 typedef std
::list<WideStringWideStringList;
                             ^
../
src/dctypes.h:43:29errortemplate argument 2 is invalid
../src/dctypes.h:46:21error'WideString' was not declared in this scope
 typedef std
::vector<WideStringWideStringArray;
                     ^~~~~~~~~~
../
src/dctypes.h:46:21notesuggested alternative'WideStringList'
 
typedef std::vector<WideStringWideStringArray;
                     ^~~~~~~~~~
                     
WideStringList
../src/dctypes.h:46:31errortemplate argument 1 is invalid
 typedef std
::vector<WideStringWideStringArray;
                               ^
../
src/dctypes.h:46:31errortemplate argument 2 is invalid
In file included from 
../src/dcgf.h:171,
                 
from ../src/AdActor.cpp:26:
../
src/BFontTT.h:43:3error'WideString' does not name a typedid you mean 'FT_String'?
   
WideString m_Text;
   ^~~~~~~~~~
   
FT_String
../src/BFontTT.h:98:18error'WideString' does not name a typedid you mean 'FT_String'?
   
TextLine(const WideStringtextint width)
                  ^~~~~~~~~~
                  
FT_String
../src/BFontTT.h:104:9error'WideString' does not name a typedid you mean 'FT_String'?
   const 
WideStringGetText() const { return m_Text; }
         ^~~~~~~~~~
         
FT_String
../src/BFontTT.h:107:3error'WideString' does not name a typedid you mean 'FT_String'?
   
WideString m_Text;
   ^~~~~~~~~~
   
FT_String
../src/BFontTT.h:139:21error'WideString' does not name a typedid you mean 'FT_String'?
  
int WrapText(const WideStringtextint maxWidthint maxHeightTextLineListlines);
                     ^~~~~~~~~~
                     
FT_String
../src/BFontTT.h:140:25error'WideString' does not name a typedid you mean 'FT_String'?
  
void MeasureText(const WideStringtextint maxWidthint maxHeightinttextWidthinttextHeight);
                         ^~~~~~~~~~
                         
FT_String
../src/BFontTT.h:142:27error'WideString' does not name a typedid you mean 'FT_String'?
  
void PrepareGlyphs(const WideStringtext);
                           ^~~~~~~~~~
                           
FT_String
../src/BFontTT.h:145:39error'WideString' does not name a typedid you mean 'FT_String'?
  
CBSurfaceRenderTextToTexture(const WideStringtextint widthTTextAlign alignint maxHeightinttextOffset);
                                       ^~~~~~~~~~
                                       
FT_String
../src/BFontTT.hIn constructor 'CBFontTT::CBCachedTTFontText::CBCachedTTFontText()':
../
src/BFontTT.h:55:4error'm_Text' was not declared in this scope
    m_Text 
L"";
    ^~~~~~
../
src/BFontTT.h:55:4notesuggested alternative'm_Rect'
    
m_Text L"";
    ^~~~~~
    
m_Rect
../src/BFontTT.hIn constructor 'CBFontTT::TextLine::TextLine(const int&, int)':
../
src/BFontTT.h:100:4error'm_Text' was not declared in this scope
    m_Text 
text;
    ^~~~~~
../
src/BFontTT.h:100:4notesuggested alternative'm_Rect'
    
m_Text text;
    ^~~~~~
    
m_Rect
gmake
: *** [obj/AdActor.oError 1


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
Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project