Author Topic: compilation error in codeblock but success in VC++6?  (Read 5654 times)

zhoufanking

  • Guest
compilation error in codeblock but success in VC++6?
« on: September 30, 2008, 09:57:37 am »
Hi, everyone:
I am a newbie on STL, today i write the following codes and compiled them in codeblock, but an error occured. Then i copied these code to VC++6, the compilation sucessed! I don't know why?
code:
Code

typedef struct HTree
{
    int freq;
    TNODE *Tree;
}HTREE;

typedef struct HSymNode
{
    int code;
    unsigned char size;
}HSYMNODE;

    vector<HTREE>    Ht(256);                               //line 74
    vector<HSYMNODE> HIndexer(256);                   //line 75

error message in code clock:
D:\workspace\cpp\test\test.h|74|error: expected identifier before numeric constant|
D:\workspace\cpp\test\test.h|74|error: expected `,' or `...' before numeric constant|
D:\workspace\cpp\test\test.h|74|error: ISO C++ forbids declaration of `parameter' with no type|
D:\workspace\cpp\test\test.h|75|error: expected identifier before numeric constant|
D:\workspace\cpp\test\test.h|75|error: expected `,' or `...' before numeric constant|
D:\workspace\cpp\test\test.h|75|error: ISO C++ forbids declaration of `parameter' with no type|
||=== Build finished: 6 errors, 0 warnings ===|


Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: compilation error in codeblock but success in VC++6?
« Reply #1 on: September 30, 2008, 10:22:22 am »
Hi,

it looks like your compiler properties or projects settings are not set correctly.
Please check them and report your configuration if you think it should work.

Dje

zhoufanking

  • Guest
Re: compilation error in codeblock but success in VC++6?
« Reply #2 on: September 30, 2008, 10:49:08 am »
My OS os XP SP2, where can i get some instruction to config the compiler? Thank you !

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: compilation error in codeblock but success in VC++6?
« Reply #3 on: September 30, 2008, 10:50:04 am »
In the forum and the wiki  :)