Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Bug (usability) with custom makefiles and clickable errors
cellulose:
I started to write this as a post to "Using Code::Blocks":
--- Quote ---Hey all. I'm using a SCONS script to autodetect my source files and build my code on all my platforms. Previously I was using Code::Blocks for Windows, make for Linux and Xcode for mac, which was getting to be a hassle.
Anywho. Everything is lovely and the integration works quite well but for one thing. Errors from the compiler are caught and inexplicably have a period inserted at the beginning of the filename string. So if the compiler whines,
--- Code: ---src\uber_world.cpp: In member function 'void uberleben::World::worldUpdate()':
src\uber_world.cpp:76: error: 'BOOGERS' was not declared in this scope
--- End code ---
Code::Blocks reports:
--- Code: ---.src\uber_world.cpp|76|error: 'BOOGERS' was not declared in this scope
--- End code ---
Note the folder name ".src" (whereas my sources are in src/)
Various suspicions I've more or less disproved were that it stemmed from my compiler's UTF-8 output (which, happily, I fixed while investigating) and that it had to do with SCONS converting the paths from foreslashes to backslashes and in some cases resolving them to absolutes -- the console output clearly shows the relative path, though.
Anyway. Here's hoping this is something silly.
--- End quote ---
And, wouldn't you know it. Had a eureka just after typing that, and changed the makefile "execution directory" from "." to "./". It's probably worth addressing that gotcha in future versions. I tried the "browse" feature, keeping the pathname relative and got "../dev" as the entry. When compiling, the errors showed up as located at "../devsrc/uber_world.cpp". The error list seems to be the only thing affected.
oBFusCATed:
Can you provide a simple project or the exact steps to reproduce the problem?
cellulose:
I think so.
1. Start a new project and create a makefile in the same folder. (I'm using the stable 10.05 release)
2. Configure the project to use a makefile, selecting the execution directory (the project directory) via the "browse" command and choosing to keep the path as relative.
3. Write a simple piece of code with an error introduced.
4. Configure the makefile (which should be in the project directory) to build that code. Use relative paths in the makefile such as "src/broken.cpp". (I use one with a dot, but scons removes it)
5. Observe the results in the error pane. (the execution directory "." being prepended to the makefile's location for the file, "src/broken.cpp" for a result ".src/broken.cpp" which breaks error shortcuts.)
Adding a trailing slash to the makefile execution directory fixes this, however it's far from obvious or the fault of the user.
Jenna:
Confirmed and (hopefully) fixed in trunk, svn r7367.
oBFusCATed:
Are you 100% sure that project->GetExecutionDir() is always non-empty?
If it can be empty, your fix is wrong...
Navigation
[0] Message Index
[#] Next page
Go to full version