Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: stugol on January 02, 2014, 03:39:18 am

Title: C::B won't compile any of my existing code
Post by: stugol on January 02, 2014, 03:39:18 am
I dunno if I'm doing something wrong here, but I can't for the life of me get Code::Blocks to compile existing code that compiles fine in VS2012.

Includes like strsafe.h and xstring cause weird compilation errors, the strangest of which is a "missing close bracket" in the middle of a standard include file. Needless to say, there is no missing bracket. Further, move.h causes C::B to throw up with "fatal error: expected function body after function declarator".

Guard clauses like
Code
#ifndef _FUNCTIONAL_
#error Must include <functional>
#endif
throw errors even though functional has been included.

Now, quite possibly it's the compiler at fault (clang), but I get insane errors with "GCC" and "Microsoft Visual C++ 2010" compilers as well - just different insane errors. What am I doing wrong?
Title: Re: C::B won't compile any of my existing code
Post by: stahta01 on January 02, 2014, 03:50:46 am
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F)
Title: Re: C::B won't compile any of my existing code
Post by: oBFusCATed on January 02, 2014, 01:06:56 pm
What am I doing wrong?
You've used the wrong compiler to write portable code :)

Also you're using non-standard headers and expect them to be available in all compilers (strsafe.h, xstring)?
Quote
<xstring> is a Microsoft C++ header containing the actual implementation of the std::basic_string template. You never need to include that file on your own. <string> includes it for the basic_string implementation.

Keep in mind that these are questions out of the scope of the forum and your topic can be locked. If you want to understand why, just re-read the rules!