This site is no longer active and is available for archival purposes only. Registration and login is disabled.

can't use STL in Codewarrior


can't use STL in Codewarrior

Postby v0101 » Nov 9, 2004 @ 8:22am

I want to use STL strings in Codewarrior for Palm OS with GapiDraw, but I can't get my project to compile. To make sure nothing in my project was causing the problem, I opened up simple.mcp from the palm samples and added this line to myapplication.cpp.
#include <string>

Below are the errors I got when I tried to compile. I'm using GapiDraw 3.5 Beta 3. If I create a project that doesn't use GapiDraw in Codewarrior, I can use std::string without any problems.



Error : macro 'stdin' redefined
(included from:
cstdio:26
string:354
myapplication.cpp:5)
file_struc.h line 185 (&__std(__files[0])) /*- mm 961031 -*/ /*- mm 961203 -*/ /*- mm 000201 -*/

Error : macro 'stdout' redefined
(included from:
cstdio:26
string:354
myapplication.cpp:5)
file_struc.h line 186 (&__std(__files[1])) /*- mm 961031 -*/ /*- mm 961203 -*/ /*- mm 000201 -*/

Error : macro 'stderr' redefined
(included from:
cstdio:26
string:354
myapplication.cpp:5)
file_struc.h line 187 (&__std(__files[2])) /*- mm 961031 -*/ /*- mm 961203 -*/ /*- mm 000201 -*/

Error : declaration syntax error
(included from:
string:354
myapplication.cpp:5)
cstdio line 57 StrVPrintF(char * s,(const Char *)const char * format,va_list arg)

Error : illegal use of 'inline'
(included from:
string:354
myapplication.cpp:5)
cstdio line 124 Siofgetc( (& ::std::__files[0]))

Error : data type is incomplete
(included from:
string:354
myapplication.cpp:5)
cstdio line 125 { return getc(stdin); }

Error : declaration syntax error
(included from:
string:354
myapplication.cpp:5)
cstdio line 127 Siofputc(int c, (& ::std::__files[1]))

Error : expression syntax error
(included from:
string:354
myapplication.cpp:5)
cstdio line 131 { return file->state.eof; }

Error : expression syntax error
(included from:
string:354
myapplication.cpp:5)
cstdio line 134 { return file->state.error; }

Error : declaration syntax error
(included from:
string:354
myapplication.cpp:5)
cstdio line 170 }
v0101
pm Insider
 
Posts: 147
Joined: Feb 1, 2002 @ 12:04am


Postby Johan » Nov 9, 2004 @ 8:33am

GapiDraw 3.5 beta3 contained the old Palm code and had some issues. Please download the latest RC1 - most of the Palm native code has been completely rewritten.
Johan Sanneblad, M.Sc, Ph.D
GapiDraw Systems Architect
[]
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby v0101 » Nov 9, 2004 @ 9:17am

Ok, it compiles now when I add #include <string> to the minimal example for Palm OS 5, but when I add these lines in ProcessNextFrame,


std::string my_string;
my_string = "My String";


I get this error in the emulator when I launch the program. I'm using the Palm Tungsten C Simulator.
I:\Ripple\ARM\Core\Emul68K\Src\Error68K.c, Line:1543, Write to WindowType (id 65535) off: 20, size: 4


By the way, no message comes up on the splash screen anymore. It's just an empty box.
v0101
pm Insider
 
Posts: 147
Joined: Feb 1, 2002 @ 12:04am


Postby Mikael » Nov 9, 2004 @ 12:48pm

Mikael
pm Member
 
Posts: 12
Joined: May 3, 2004 @ 4:46pm


Postby v0101 » Nov 9, 2004 @ 10:37pm

v0101
pm Insider
 
Posts: 147
Joined: Feb 1, 2002 @ 12:04am


Postby v0101 » Nov 12, 2004 @ 6:01am

Ok, ran into a problem with the changes you suggested. I tested this with my project as well as all the samples for Palm OS 5 and I get the same error everytime. Everything runs fine, but when I exit the program I get this error.
MemoryMgr.c, Line:3675, Invalid chunk ptr

By the way, I'm testing this out on the Tungsten C Simulator.
v0101
pm Insider
 
Posts: 147
Joined: Feb 1, 2002 @ 12:04am


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum