User forums > General (but related to Code::Blocks)
g++: no input files Process terminated with status 1 (0 minutes, 0 seconds)
oBFusCATed:
Jens: is it possible to show some message when the pkg-config expansion fails?
Probably checking the return code of pkg-config and printing all strerr text in the build log?
Very often I mistype the cflags/libs like cflag/lib or sometimes I type "-" instead of "--" in front of the option.
Jenna:
I think this should not be too hard.
I will look into it, later (possibly this evening or the weekend).
Jenna:
--- Quote from: oBFusCATed on June 04, 2010, 07:25:11 pm ---Jens: is it possible to show some message when the pkg-config expansion fails?
Probably checking the return code of pkg-config and printing all strerr text in the build log?
Very often I mistype the cflags/libs like cflag/lib or sometimes I type "-" instead of "--" in front of the option.
--- End quote ---
--- Quote from: jens on June 04, 2010, 07:30:05 pm ---I think this should not be too hard.
I will look into it, later (possibly this evening or the weekend).
--- End quote ---
Here comes a patch to test:
--- Code: ---Index: src/sdk/compilercommandgenerator.cpp
===================================================================
--- src/sdk/compilercommandgenerator.cpp (Revision 6328)
+++ src/sdk/compilercommandgenerator.cpp (Arbeitskopie)
@@ -948,15 +948,35 @@
#else
Manager::Get()->GetLogManager()->DebugLog(F(_T("Caching result of `%s`"), cmd.c_str()));
#endif
- wxArrayString output;
+ wxArrayString output, error;
if (platform::WindowsVersion() >= platform::winver_WindowsNT2000)
- wxExecute(_T("cmd /c ") + cmd, output, wxEXEC_NODISABLE);
+ wxExecute(_T("cmd /c ") + cmd, output, error, wxEXEC_NODISABLE);
else
- wxExecute(cmd, output, wxEXEC_NODISABLE);
- bt = GetStringFromArray(output, _T(" "));
- // add it in the cache
- m_Backticks[cmd] = bt;
- Manager::Get()->GetLogManager()->DebugLog(_T("Cached"));
+ wxExecute(cmd, output, error, wxEXEC_NODISABLE);
+ if(error.GetCount() > 0)
+ {
+ #if wxCHECK_VERSION(2, 9, 0)
+ Manager::Get()->GetLogManager()->DebugLogError(F(_T("Error running: %s"), cmd.wx_str()));
+ #else
+ Manager::Get()->GetLogManager()->DebugLogError(F(_T("Error running: %s"), cmd.c_str()));
+ #endif
+ Manager::Get()->GetLogManager()->DebugLogError(_T("Output is:"));
+ for(size_t i = 0; i < error.GetCount(); ++i)
+ {
+ #if wxCHECK_VERSION(2, 9, 0)
+ Manager::Get()->GetLogManager()->DebugLogError(F(_T("%s"), error[i].wx_str()));
+ #else
+ Manager::Get()->GetLogManager()->DebugLogError(F(_T("%s"), error[i].c_str()));
+ #endif
+ }
+ }
+ else
+ {
+ bt = GetStringFromArray(output, _T(" "));
+ // add it in the cache
+ m_Backticks[cmd] = bt;
+ Manager::Get()->GetLogManager()->DebugLog(_T("Cached"));
+ }
}
ret << bt << _T(' ');
str = str.substr(0, start) + bt + str.substr(end + 1, wxString::npos);
--- End code ---
I also add it as attachement, otherwise, there might be errors with line-endings.
[attachment deleted by admin]
oBFusCATed:
Tested the patch on the debugger branch:
The detection happens and there is a log message, but it is displayed in the wrong log ("Debug log").
This log is not show by default, you should run c::b with --debug-log.
Also you should look at the log.
Could you make it to post the error to the build messages and the build log?
If you can't you should use the normal log, which is on by default.
Jenna:
I think Build log or Build messages are the wqrong place, because the backticked expressions are parsed once on project loading (or at compile time, if they are seen the first time), but both loggers are cleared before building a project and so they would get lost.
I used the debug log, because the messages about evealuating the backticked expressions go there too.
To make them appear in the normal log, just use LogError(...) instead of DebugLogError(...).
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version