expected primary expression

This is a discussion on expected primary expression within the C++ Programming forums, part of the General Programming Boards category; my program wont compile because of an error i cant solve.. i have and c++ file that defines all of ...

expected primary expression

my program wont compile because of an error i cant solve.. i have and c++ file that defines all of my class funtions, but in every function definition i have an error (sometimes 2 or 3) per function saying "primary expression expected before ")"" etc etc.. im stumped on how to debug this..

i would recommend to post all code you have so that, if need be, we can copy/paste to files and try to compile on our own machines. i think it would be very hard to help you with what we have. perhaps the error isnt even in the code listed above? line numbers would be good (ie bold/color the lines that are being reported as errors).

go through and make sure you dont have too many or too few brackets, make sure your semi colons are where theyre supposed to be, etc.

"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens

thank you.. for the past little while ive been doing some tinkering. so the defines were there at one point.. things just got a bit hectic.. one moment ill put them in. they should go in the header file

and the linker errors. this was my FIRST idea. because only that file wouldnt work. and character.cpp seemed to work fine. if you wouldnt mind. could you help me reorder them?

It's not about reordering them. Put them in their own .cpp file. (But you might want to keep the single-line accessors and just make them inline.)

Still, the linker isn't even invoked in your build process currently, because the compiler already fails.

You should also fix the missing newline warnings. GCC 4.3 will flag that as a hard error by default. Just insert a newline at the end of the affected files. (Probably after the #endif of the include guards.)