User forums > Using Code::Blocks
C::B won't compile any of my existing code
(1/1)
stugol:
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
--- End code ---
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?
stahta01:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F
oBFusCATed:
--- Quote from: stugol on January 02, 2014, 03:39:18 am ---What am I doing wrong?
--- End quote ---
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.
--- End quote ---
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!
Navigation
[0] Message Index
Go to full version