|
Strange compile errors - Can't see anything wrong. |
Durnus
Member #7,997
November 2006
|
I have come code (no duh ) and it is giving me trouble. I am using Dev-C++. Compiling errors: expected init-declarator before '*' token Also, my Run and Compile and Run icons are diabled. My code:
My header file:
I have no idea what I did wrong, but this error is keeping me back.
|
kazzmir
Member #1,786
December 2001
|
sure, paste particle_array.h. just a thought, try <allegro.h> instead of "allegro.h", but that shouldn't really matter.. |
TeamTerradactyl
Member #7,733
September 2006
|
Durnus, the code looks sound from a 10-second walkthrough, but I would take kazzmir's advice: change "allegro.h" to <allegro.h> since your allegro header file should be found in your compiler's "include" folder and not your local directory. When compiling, do you have allegro's library declared? Mine (from a DOS box, not Dev-C++) is: gcc your_program.c -lalleg
|
Durnus
Member #7,997
November 2006
|
I am sure the allegro library is working. When I put in the particle_array.h, that's when the bug happens. I changed it to <allegro.h> anyway.
|
LennyLen
Member #5,313
December 2004
|
Quote: I am sure the allegro library is working. Yes, there would have been far more errors had you not linked to the library.
|
Richard Phipps
Member #1,632
November 2001
|
BITMAP * interface_bitmap; //It says the error is in THIS LINE. |
Durnus
Member #7,997
November 2006
|
->Lennylen Heh, I remember the time I didn't link it. That was the first bug I faced, and that was before I knew about allegro.cc. I had nowhere to turn. ->Richard Phipps No, I'm afraid that does not help. More info on the bug: If I move one of my integer declares to the first line, it says this as the compile error instead: two or more data types in declaration of `xmouse' These are the strangest errors I've ever got. [Random] I just noticed I'm member 7997! Hehe [/Random]
|
orz
Member #565
August 2000
|
Add semicolons immediately after the closing curly brace fore each class declaration. Otherwise, it tries to interpret the immediate next stuff as an instance of the class. Not sure quite how you end up with those error messages though : ) |
Hano Wair
Member #5,243
November 2004
|
You didn't put a semicolon ( ; ) after your class declarations. class Foo { /*. .. */ } // Wrong class Bar { /* ... */ }; // Right [edit] Beaten |
Durnus
Member #7,997
November 2006
|
How was I that stupid when I made my header file.... I have no clue how that killed my app, but thanks, adding the semicolons worked. Dang... new problem. Now when I compile, it won't let me run it. My Run and Compile and Run buttons are disabled. I checked my project folder, and there is no exe being created. Compiler only says "creating Particle Master.a"
|
raccoon
Member #7,478
July 2006
|
i have no idea how Dev-C++ works, but it looks like you are building a library. |
LennyLen
Member #5,313
December 2004
|
Quote: maybe you should recheck your project options
Seconded. Check what type of project you are building here: It sounds like you have "static library" selected. Most likely you want Console (or perhaps GUI).
|
Durnus
Member #7,997
November 2006
|
Thanks, that worked. I had no clue what I did to change the project type, but that was the problem. Thanks for all the help, now I can go on programming. I hope I don't have any (many) more problems.
|
|