User forums > Using Code::Blocks
CB ignores search directories/Global variables
stahta01:
YOU Verified the CB project is using the correct compiler for ALL targets in ALL projects!
Is this correct?
Tim S.
eb:
No, I'm saying that my compiler is doing this:
--- Quote ----------------- Build: Release in rap00 ---------------
gcc-3.exe -Wall -O2 -IC:/cygwin/usr/include/tirpc -IC:/cygwin/usr/include -IC:/cygwin/home/eb/rap00 -IC:/cygwin/home/eb/rap00 -c C:/cygwin/home/eb/rap00/main.c -o obj/Release/main.o
g++-3.exe -o bin/Release/rap00.exe obj/Release/main.o C:/cygwin/lib/libtirpc.a C:/cygwin/Varkon_1.19D/sources/EX/lib/EXlib.a
Output size is 116.86 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End quote ---
Where my code blocks settings say it should be doing something more like this:
--- Quote ----------------- Build: Release in rap00 ---------------
mingw32-g++.exe -Wall -O2 -IC:/MinGW/lib/gcc/mingw32/4.6.2/include -IC:/mingw/include/bits -IC:/mingw/lib/gcc/mingw32/4.6.2/include/c++/parallel -IC:/mingw/home/eb/rap00 -IC:/mingw/home/eb/rap00 -c C:/mingw/home/eb/rap00/main.c -o obj/Release/main.o
mingw32-g++-3.exe -o bin/Release/rap00.exe obj/Release/main.o C:/MinGW/lib/librpcrt4.a C:/cygwin/Varkon_1.19D/sources/EX/lib/EXlib.a C:/MinGW/lib/libmingw32.a C:/MinGW/lib/gcc/mingw32/4.6.2/libstdc++.a
Output size is 116.86 KB
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End quote ---
And yes I know I'm mixing libraries and compilers again (I just caught that) and it will probably fail, but that's not the point.
oBFusCATed:
@devs:
I'm thinking of adding the compiler name in the build log. What do you think about it?
How about this patch? Is it correct?
--- Code: ---Index: src/plugins/compilergcc/compilergcc.cpp
===================================================================
--- src/plugins/compilergcc/compilergcc.cpp (revision 7807)
+++ src/plugins/compilergcc/compilergcc.cpp (working copy)
@@ -1535,23 +1535,22 @@
if (action == baClean)
Action = _("Clean");
+ wxString compilerName(_("unknown"));
+ Compiler *compiler = CompilerFactory::GetCompiler(GetCurrentCompilerID(target));
+ if (compiler)
+ compilerName = compiler->GetName();
+
+#if wxCHECK_VERSION(2, 9, 0)
+ wxString targetName = target ? target->GetTitle().wx_str() : _("\"no target\"").wx_str();
+ wxString projectName = prj ? prj->GetTitle().wx_str() : _("\"no project\"").wx_str();
+#else
+ wxString targetName = target ? target->GetTitle().wx_str() : _("\"no target\"");
+ wxString projectName = prj ? prj->GetTitle().wx_str() : _("\"no project\"");
+#endif
+
wxString banner;
- banner.Printf(_("-------------- %s: %s in %s ---------------"),
- Action.wx_str(),
- target
- ? target->GetTitle().wx_str()
- #if wxCHECK_VERSION(2, 9, 0)
- : _("\"no target\"").wx_str(),
- #else
- : _("\"no target\""),
- #endif
- prj
- ? prj->GetTitle().wx_str()
- #if wxCHECK_VERSION(2, 9, 0)
- : _("\"no project\"").wx_str() );
- #else
- : _("\"no project\"") );
- #endif
+ banner.Printf(_("-------------- %s: %s in %s (compiler: %s)---------------"),
+ Action.wx_str(), targetName.wx_str(), projectName.wx_str(), compilerName.wx_str());
LogMessage(banner, cltNormal, ltAll, false, true);
}
--- End code ---
ollydbg:
--- Quote from: oBFusCATed on February 16, 2012, 09:11:46 pm ---@devs:
I'm thinking of adding the compiler name in the build log. What do you think about it?
How about this patch? Is it correct?
--- Code: ---Index: src/plugins/compilergcc/compilergcc.cpp
===================================================================
--- src/plugins/compilergcc/compilergcc.cpp (revision 7807)
+++ src/plugins/compilergcc/compilergcc.cpp (working copy)
@@ -1535,23 +1535,22 @@
if (action == baClean)
Action = _("Clean");
+ wxString compilerName(_("unknown"));
+ Compiler *compiler = CompilerFactory::GetCompiler(GetCurrentCompilerID(target));
+ if (compiler)
+ compilerName = compiler->GetName();
+
+#if wxCHECK_VERSION(2, 9, 0)
+ wxString targetName = target ? target->GetTitle().wx_str() : _("\"no target\"").wx_str();
+ wxString projectName = prj ? prj->GetTitle().wx_str() : _("\"no project\"").wx_str();
+#else
+ wxString targetName = target ? target->GetTitle().wx_str() : _("\"no target\"");
+ wxString projectName = prj ? prj->GetTitle().wx_str() : _("\"no project\"");
+#endif
+
wxString banner;
- banner.Printf(_("-------------- %s: %s in %s ---------------"),
- Action.wx_str(),
- target
- ? target->GetTitle().wx_str()
- #if wxCHECK_VERSION(2, 9, 0)
- : _("\"no target\"").wx_str(),
- #else
- : _("\"no target\""),
- #endif
- prj
- ? prj->GetTitle().wx_str()
- #if wxCHECK_VERSION(2, 9, 0)
- : _("\"no project\"").wx_str() );
- #else
- : _("\"no project\"") );
- #endif
+ banner.Printf(_("-------------- %s: %s in %s (compiler: %s)---------------"),
+ Action.wx_str(), targetName.wx_str(), projectName.wx_str(), compilerName.wx_str());
LogMessage(banner, cltNormal, ltAll, false, true);
}
--- End code ---
--- End quote ---
The last wx_str() of this line is necessary?
--- Code: ---wxString targetName = target ? target->GetTitle().wx_str() : _("\"no target\"").wx_str();
--- End code ---
oBFusCATed:
Yes, in wx29 it is necessary.
Edit:
--- Code: --- wxString targetName = target ? target->GetTitle() : wxString(_("\"no target\""));
wxString projectName = prj ? prj->GetTitle() : wxString(_("\"no project\""));
--- End code ---
But this version works in both 2.8 and 2.9.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version