1. Porting win to lin

M

Michael Sgier

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
 
J

John Carson

Michael Sgier said:
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.
 
S

Stuart MacMartin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top