User forums > Help
compilation of c::b fails in "compiler.cpp"
cbnewbie:
Hello!
I just downloaded c::b via svn an tried to compile it. But it fails with the following error:
compiler.cpp: In member function 'bool Compiler::EvalXMLCondition(const wxXmlNode*)':
compiler.cpp:1147:29: error: expected unqualified-id before numeric constant
compiler.cpp:1147:29: error: expected ';' before numeric constant
How can I fix it? I am using gcc-4.7.3 on Mageia 2 64-bit.
Hopefull regards,
Markus
Alpha:
I cannot reproduce the error, but does this patch fix compilation?
--- Code: ---Index: src/sdk/compiler.cpp
===================================================================
--- src/sdk/compiler.cpp (revision 9138)
+++ src/sdk/compiler.cpp (working copy)
@@ -24,6 +24,7 @@
#endif
#include "compilercommandgenerator.h"
+#include "prep.h"
#include <wx/arrimpl.cpp>
#include <wx/filefn.h>
#include <wx/xml/xml.h>
--- End code ---
cbnewbie:
It does not help. But "compiler.cpp" is not the only file with that problem. If I start compiling with "make -j" I get the following error messages:
--- Code: ---compiletargetbase.cpp: In member function 'void CompileTargetBase::GenerateTargetFilename(wxString&) const':
compiletargetbase.cpp:267:31: error: expected unqualified-id before numeric constant
compiletargetbase.cpp:267:31: error: expected ')' before numeric constant
configmanager.cpp: In member function 'void CfgMgrBldr::SwitchTo(const wxString&)':
configmanager.cpp:265:19: error: expected unqualified-id before numeric constant
configmanager.cpp:265:19: error: expected ')' before numeric constant
compiler.cpp: In member function 'bool Compiler::EvalXMLCondition(const wxXmlNode*)':
compiler.cpp:1148:29: error: expected unqualified-id before numeric constant
compiler.cpp:1148:29: error: expected ';' before numeric constant
editormanager.cpp: In member function 'void EditorManager::CollectDefines(CodeBlocksEvent&)':
editormanager.cpp:3222:28: error: expected unqualified-id before numeric constant
editormanager.cpp:3222:28: error: expected ')' before numeric constant
--- End code ---
Jenna:
There must be "lnux"-macro defined by your compiler or compiler call on your system.
For some reasons the undefine of linux in prep.h:219 :
--- Code: --- #if defined ( linux )
#undef linux
#endif
--- End code ---
must be overriden by a (system?) header after the include of prep.h.
Otherwise you would get the error in prep.h also.
You can try to change the definition of linux to cb_linux in prep.h and all places where it is used (platform::linux) respectively, to see if it works in this case.
Or put the above code-snippet into the files where it failed after all headers are included, to see if it works.
Biplab:
I've committed a fix in rev 9141.
The fix is along the line Jens has posted. Similar fix should have been used long long ago when we dealt with this issue. :)
Navigation
[0] Message Index
[#] Next page
Go to full version