1. Porting win to lin

Discussion in 'C++' started by Michael Sgier, Jul 10, 2005.

  1. 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
     
    Michael Sgier, Jul 10, 2005
    #1
    1. Advertising

  2. Michael Sgier

    John Carson Guest

    "Michael Sgier" <> wrote in message
    news:42d0de6c$0$1162$
    > 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
     
    John Carson, Jul 10, 2005
    #2
    1. Advertising

  3. 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
     
    Stuart MacMartin, Jul 10, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christian  Decker

    Portable libraries for Mac/Win/Lin?

    Christian Decker, Oct 19, 2004, in forum: C++
    Replies:
    3
    Views:
    328
    Mike Wahler
    Oct 19, 2004
  2. Replies:
    6
    Views:
    1,103
  3. Michael Sgier

    porting win to lin by newbie

    Michael Sgier, Jul 21, 2005, in forum: C++
    Replies:
    1
    Views:
    369
    Alan Johnson
    Jul 21, 2005
  4. Michael Sgier

    win-lin

    Michael Sgier, Oct 21, 2005, in forum: C++
    Replies:
    11
    Views:
    720
    Branimir Maksimovic
    Oct 23, 2005
  5. Krist
    Replies:
    6
    Views:
    756
    Arne Vajhøj
    May 7, 2010
Loading...

Share This Page