Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: evesira on January 03, 2010, 02:09:30 am
-
Hello,
I am new to programming, so please correct me if I say something dumb.
I am attempting to write a dll wrapper for a small physics library called Chipmunk Physics:
http://code.google.com/p/chipmunk-physics/
The library is written in C, and uses C99 implementation. My wrapper code is in C++, and what I have so far I am sure is all syntactically valid code. I can compile the library alone, but not together with my wrapper code.
Right now, I'm getting errors like this:
... Chipmunk2GM\CODE\src\cpArbiter.h|47|error: `cpHashValue' does not name a type|
... Chipmunk2GM\CODE\src\cpArbiter.h|51|error: ISO C++ forbids declaration of `hash' with no type|
All of the errors are in the library's header files.
The library is in C99, which has some specifications that are ONLY allowed in C99. My wrapper code, as I said, is in C++. How do I get Code::Blocks to compile the library as C99 C, and my wrapper code as C++?
I'd be happy to upload my project file and the source if anyone is willing to take a look at them!
Many thanks!
-
What version do you use?
Because the older version recongized C files as C++;
To verify goto Management -> Projects -> a C file -> right click -> Properties -> Advanced -> Compiler variable => should be C not CPP.
-
Hello,
I'm using 8.02. The compile variable for all my C files is "CC". I tried changing one of them to "C", but an error still came up for that file.
I can upload the project file and code for this, if anyone is willing to take a look. It is not big.
-
"CC" is the correct one for C files, my mistake sorry.
So if this is OK, then you have a programming error (missing includes probably or something is not defined as it should)
-
Well like i said, the chipmunk library itself compiles fine alone. When I put my wrapper code in there, some chipmunk headers throw errors, not my wrapper code files. That's why i'm pretty sure it's just some kind of settings problem...