469,613 Members | 1,576 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

1. Porting win to lin

Hello
i'm trying to port a windows program to linux with Kdevelop 1.question:

unsigned char *LoadBitmapFile(char *filename, BITMAPINFOHEADER
*bitmapInfoHeader);

/home/michael/Desktop/div.OpenGL/linshootme/src/texture.h:51: error:
type specifier omitted for parameter `BITMAPINFOHEADER'
/home/michael/Desktop/div.OpenGL/linshootme/src/texture.h:51: error:
syntax error before `*' token

What's wrong here?
then 2 question:

class CMD2Model : public CObject
{
private:

int numFrames; // number of model frames
int numVertices; // number of vertices
int numTriangles; // number of triangles
int numST; // number of skins
int frameSize; // size of each frame in bytes
mesh_t *triIndex; // triangle list
texCoord_t *st; // texture coordinate list
vector_t *vertexList; // vertex list
CTexture *modelTex; // texture data

void SetupSkin(CTexture *thisTexture);

protected:
modelState_t modelState; // current model animation state
int currentFrame; // current frame # in animation
int nextFrame; // next frame # in animation

public:
float interpol; // percent through current frame

CMD2Model(); // constructor
~CMD2Model(); // destructor

with those errors:
/home/michael/Desktop/div.OpenGL/linshootme/src/md2.h:121: error: syntax
error before `{' token
/home/michael/Desktop/div.OpenGL/linshootme/src/md2.h:136: error: syntax
error before `protected'
/home/michael/Desktop/div.OpenGL/linshootme/src/md2.h:141: error: syntax
error before `public'
/home/michael/Desktop/div.OpenGL/linshootme/src/md2.h:145: error:
destructors must be member functions
/home/michael/Desktop/div.OpenGL/linshootme/src/md2.h:173: error: syntax
error before `}' token

help is much appreciated as i'm new to C++ and have only VB.NET experience
Regards
Michael
Jul 23 '05 #1
2 2230
"Michael Sgier" <sg***@nospam.ch> wrote in message
news:42**********************@news.sunrise.ch
Hello
i'm trying to port a windows program to linux with Kdevelop
1.question:
unsigned char *LoadBitmapFile(char *filename, BITMAPINFOHEADER
*bitmapInfoHeader);

/home/michael/Desktop/div.OpenGL/linshootme/src/texture.h:51: error:
type specifier omitted for parameter `BITMAPINFOHEADER'
/home/michael/Desktop/div.OpenGL/linshootme/src/texture.h:51: error:
syntax error before `*' token

What's wrong here?
The compiler doesn't know what BITMAPINFOHEADER is so it is assuming that it
is a variable name and saying that you didn't specify the type of the
variable. BITMAPINFOHEADER is a struct used in connection with a Windows
Device Independent Bitmap (DIB). To eliminate this error, you need to
declare the struct (or #include a header containing the declaration).
then 2 question:

class CMD2Model : public CObject
{
private:

int numFrames; // number of model frames
int numVertices; // number of vertices
int numTriangles; // number of triangles
int numST; // number of skins
int frameSize; // size of each frame in bytes
mesh_t *triIndex; // triangle list
texCoord_t *st; // texture coordinate list
vector_t *vertexList; // vertex list
CTexture *modelTex; // texture data

void SetupSkin(CTexture *thisTexture);

protected:
modelState_t modelState; // current model animation state
int currentFrame; // current frame # in animation
int nextFrame; // next frame # in animation

public:
float interpol; // percent through current frame

CMD2Model(); // constructor
~CMD2Model(); // destructor

with those errors:
/home/michael/Desktop/div.OpenGL/linshootme/src/md2.h:121: error:
syntax error before `{' token
/home/michael/Desktop/div.OpenGL/linshootme/src/md2.h:136: error:
syntax error before `protected'
/home/michael/Desktop/div.OpenGL/linshootme/src/md2.h:141: error:
syntax error before `public'
/home/michael/Desktop/div.OpenGL/linshootme/src/md2.h:145: error:
destructors must be member functions
/home/michael/Desktop/div.OpenGL/linshootme/src/md2.h:173: error:
syntax error before `}' token
Don't know, but a reasonable guess might be that the compiler doesn't have
the declarations of various classes that the code refers to, such as
CObject.
help is much appreciated as i'm new to C++ and have only VB.NET
experience


In that case porting a Windows C++ program to Linux strikes me as extremely
ambitious.
--
John Carson

Jul 23 '05 #2
You're dealing with OS issues.

If you have few dependencies on Windows (CString, CWnd, CObject, win32
calls) you can write equivalent routines for linux.

If you have extensive UI written for Windows, you can either rewrite
the UI in qT (assuming you've partitioned your UI and data) or use
MainSoft. Rewriting a UI, unless it's trivial, is timeconsuming.
Using Mainsoft (what we do) gives good results but is too expensive for
casual programs.

Unless the project is really small and really important, I echo John:
this project is extremely ambitious. You have to understand C++, both
OSes and how to map between them.

Stuart

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Edward | last post: by
2 posts views Thread by Anand | last post: by
5 posts views Thread by Ryan Liu | last post: by
4 posts views Thread by Chris Travers | last post: by
34 posts views Thread by subramanian100in | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.