User forums > Using Code::Blocks
cannot locate error line, if compilation error occured
alys666:
Hi!
I have C++ project with custom make file, and I cannot jump to source line from error window("Build messages") to source file and line, even when this file is opened in editor.
compiler is gcc.
i've inspected .cbp file of my project and there all files paths are relative to .cbp file, which is stored separately from my sources and make files.
kinda -
./project (dir with .cbp inside)
./sources (sources and makefiles)
it looks like Codeblocks cannot find the source needed.
example of error(warning) line from "Build Messages" window.
../../firmware/camera.cpp|99|warning: unused variable 'llen' [-Wunused-variable]|
i have CodeBlocks 16.01, ubuntu 14.04
thanks.
stahta01:
Thanks for saying you used "custom make file"; you can try adding the file to the project.
But, I think this never worked for "custom make file". But, I use "custom make file" with a non supported compiler.
So, it might work with a supported compiler.
Tim S.
alys666:
if you use non supported compiler, CB could not be able to parse it's error message to get correct filepath and line number, so CB cannot locate the file.
But for GCC it can, and it is visibile that it can, because file and error lines columns of Build Messages window are correct.
So CodeBlocks just has to get file name, in my case ../../firmware/camera.cpp(relative to .cbp), make absolute path from it and open(or switch to editor page if file already opened).
anyway, thanks for reaction.
stahta01:
Simple things to check:
Is the makefile in the same folder as the cbp file?
Does the makefile call other makefiles or use the cd command?
Edit: Is the CB Project set to use the correct compiler?
Edit2: Is the correct compiler set as the default compiler?
Tim S.
stahta01:
Complex things to check:
Find the line in the "build log"
Copy it to the Advanced Compiler Options and test that the regex works.
Settings -> Compiler
Tab: Other Settings
Button: Advanced Options
Tab: Output Parsing
Paste line into "Test String"
Button: Test
Is the filename and line number found correctly?
Tim S.
Navigation
[0] Message Index
[#] Next page
Go to full version