There is two major places to change the search directories.
The compiler settings and the project/task settings.
You likely have only fixed one of them.
NOTE: I had to add the Cygwin include folder to search list for rpc.h to be found.
You will need to change "C:\GreenApps\Cygwin1_7" to "C:\cygwin"
I added include search folder "C:\GreenApps\Cygwin1_7\usr\include\tirpc"
Edit: This might work also "$(TARGET_COMPILER_DIR)\usr\include\tirpc".
My build command. Updated because I saw two search folders removed one.
i686-pc-cygwin-gcc-4.exe -Wall -g -IC:/GreenApps/Cygwin1_7/usr/include/tirpc -c H:/SourceCode/Projects/test-i686-w64/main.c -o obj/Debug/main.o
i686-pc-cygwin-g++-4.exe -o bin/Debug/test-i686-w64.exe obj/Debug/main.o -ltirpc
Note: "H:/SourceCode/Projects/test-i686-w64" is my project folder.
Tim S.
@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?
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);
}
@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?
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);
}
The last wx_str() of this line is necessary?
wxString targetName = target ? target->GetTitle().wx_str() : _("\"no target\"").wx_str();
Yes, in wx29 it is necessary.
Edit:
wxString targetName = target ? target->GetTitle() : wxString(_("\"no target\""));
wxString projectName = prj ? prj->GetTitle() : wxString(_("\"no project\""));
But this version works in both 2.8 and 2.9.
Yes, also you can manage if the target or project options take precedence by using the Policy combo box.
@devs:
Another patch to improve debuggability:
Index: src/plugins/compilergcc/compilergcc.cpp
===================================================================
--- src/plugins/compilergcc/compilergcc.cpp (revision 7810)
+++ src/plugins/compilergcc/compilergcc.cpp (working copy)
@@ -2366,9 +2366,19 @@
ProjectBuildTarget* tgt = prj->GetBuildTarget(tlist[x]);
if (!CompilerValid(tgt))
{
+ Compiler *compiler = CompilerFactory::GetCompiler(GetCurrentCompilerID(tgt));
+ wxString compilerName, compilerName2(wxT("unknown"));
+ if (compiler)
+ {
+ compilerName = wxT("(") + compiler->GetName() + wxT(") ");
+ compilerName2 = compiler->GetName();
+ }
wxString msg;
- msg.Printf(_T("\"%s - %s\": The compiler's setup is invalid so Code::Blocks cannot find/run the compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping..."),
- prj->GetTitle().wx_str(), tlist[x].wx_str());
+ msg.Printf(_T("\"%s - %s\": The compiler's setup %sis invalid, so Code::Blocks cannot find/run the compiler.\n")
+ _T("Probably the toolchain path within the compiler options is not setup correctly?!\n")
+ _T("Goto Settings->Compiler and debugger...->Global compiler settings->%s->Toolchain executables\n")
+ _T("Skipping..."),
+ prj->GetTitle().wx_str(), tlist[x].wx_str(), compilerName.wx_str(), compilerName2.wx_str());
Manager::Get()->GetLogManager()->LogWarning(msg, m_PageIndex);
continue;
}
What do you think?