Author Topic: CB ignores search directories/Global variables  (Read 24310 times)

Offline eb

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: CB ignores search directories/Global variables
« Reply #30 on: February 17, 2012, 09:25:30 pm »
D'Oh!

btw - It seems that the settings under Project->Build options trump those under Compiler and debugger settings.
Things are starting to make sense now.
Thanks again Tim S.
« Last Edit: February 17, 2012, 09:32:40 pm by eb »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB ignores search directories/Global variables
« Reply #31 on: February 17, 2012, 09:43:28 pm »
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:

Code
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?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB ignores search directories/Global variables
« Reply #32 on: February 19, 2012, 01:49:52 pm »
@devs: any comments for my patch?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: CB ignores search directories/Global variables
« Reply #33 on: February 19, 2012, 02:38:59 pm »
@devs: any comments for my patch?
My opinion: commit it.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: CB ignores search directories/Global variables
« Reply #34 on: February 19, 2012, 03:01:12 pm »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ