Hello guys,
i've got a problem while trying to debug the program i wrote.
I can't use "watches", after long search i figured out that this is a cause of missing debug symbols.
So i searched how to fix this. Unfortunately i have no idea where and how to add this -g,
cause i use code blocks for the first time and the flag "produce debug symbols(-g)" is not listed in "Settings -> compiler -> compiler flags"
So i tried to add this flag by hand, not working, i add it in "other compiler options" and just receive the message:
||=== Build: Debug in Complexe_rechnung (compiler: Borland C++ Compiler (5.5, 5.82)) ===|
||Error E2074: Value after -g or -j should be between 0 and 255 inclusive|
||Error E2075: Incorrect command line option: -g|
||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
I'm using Win7 64bit
Code::Blocks 16.01
Thanks for your help!
Post a full re-build log.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)
Edit: I do NOT think Code::Blocks supports debugging with Borland Compiler.
I guess u mean this log? Copyed out from "build log" after re-build, as explained in the FAQ
-------------- Clean: Debug in Complexe_rechnung (compiler: Borland C++ Compiler (5.5, 5.82))---------------
Cleaned "Complexe_rechnung - Debug"
-------------- Build: Debug in Complexe_rechnung (compiler: Borland C++ Compiler (5.5, 5.82))---------------
bcc32.exe -q -w -v -ID:\Programme\Borland\BCC55\Include -oobj\Debug\input.obj -c input.c
input.c:
bcc32.exe -q -w -v -ID:\Programme\Borland\BCC55\Include -oobj\Debug\my_complex.obj -c my_complex.c
my_complex.c:
bcc32.exe -q -w -v -ID:\Programme\Borland\BCC55\Include -oobj\Debug\output.obj -c output.c
output.c:
bcc32.exe -q -w -v -ID:\Programme\Borland\BCC55\Include -oobj\Debug\testfile.obj -c testfile.c
testfile.c:
ilink32.exe -q -ap -v -LD:\Programme\Borland\BCC55\Lib -LD:\Programme\Borland\BCC55\Lib\PSDK c0x32 obj\Debug\input.obj obj\Debug\my_complex.obj obj\Debug\output.obj obj\Debug\testfile.obj,bin\Debug\Complexe_rechnung.exe,,cw32mt.lib import32.lib,,
Output file is bin\Debug\Complexe_rechnung.exe with size 71.00 KB
Process terminated with status 0 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Well, that would explain a lot, if Borland is non debug compatible.
EDIT:
This happen, if i add a -g in "Settings -> compiler -> other compiler options"
-------------- Clean: Debug in Complexe_rechnung (compiler: Borland C++ Compiler (5.5, 5.82))---------------
Cleaned "Complexe_rechnung - Debug"
-------------- Build: Debug in Complexe_rechnung (compiler: Borland C++ Compiler (5.5, 5.82))---------------
bcc32.exe -q -w -v -g -ID:\Programme\Borland\BCC55\Include -oobj\Debug\input.obj -c input.c
Error E2074: Value after -g or -j should be between 0 and 255 inclusive
Error E2075: Incorrect command line option: -g
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))
http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devwin32/bcc32_xml.html
Quote-g Stop batch compilation after n warnings (Default = 255)
why do you use bcc and not gcc?
Quote from: BlueHazzard on March 12, 2017, 09:21:07 PM
why do you use bcc and not gcc?
Thanks for the answer! Our Prof. want us to use Borland BCC ....
EDIT:
After a short look it seems that there is no command to creat such a "Symbol Table"? Am i right?
Did you try -v (instead of -g) ?
http://docwiki.embarcadero.com/RADStudio/Berlin/en/C%2B%2B_Compiler_Debugging
Quote from: jens on March 12, 2017, 10:14:49 PM
Did you try -v (instead of -g) ?
http://docwiki.embarcadero.com/RADStudio/Berlin/en/C%2B%2B_Compiler_Debugging
Well, this option is listed as "debug on, inline expansion off", unfortunately i can't switch from "Release" to "Debug" without getting this error message:
Error: Unresolved external '_strtod' referenced from D:\PROJEKTE\CODE_BLOCKS\COMPLEXE_RECHNUNG\OBJ\DEBUG\INPUT.OBJ
in fact string.h is included. In "Release" mode this error doesn't appear.
EDIT: Figured the undo of the checkbox out on my own.
EDIT 2:
With the -v the log show
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.6.1
Starting the debuggee failed: No executable specified, use `target exec'.
Debugger finished with status 0
I don't know, but is it possible to use gdb for debugging bcc applications?
You messed something up in the project settings... Easiest way would be to create a new project and copy the souces.
Is your application created? What is under Project->Properties->Build target->Debug->Output File name?
It could be possible, that something went wrong. I should creat a new project.
Anyway, i tested the -v option on another pc, with right settings. This option doesn't creat a symbol table, so debug is still not working with -v.
The output file name is "Complexe_rechnung.exe" like the project is called.
Seems the debug is not working with Borland. For simple projects i can still use "printf" ;D
Thanks for helping anyway, guys :)
Quote from: Tommi on March 14, 2017, 07:19:32 PM
It could be possible, that something went wrong. I should creat a new project.
Anyway, i tested the -v option on another pc, with right settings. This option doesn't creat a symbol table, so debug is still not working with -v.
The output file name is "Complexe_rechnung.exe" like the project is called.
Seems the debug is not working with Borland. For simple projects i can still use "printf" ;D
Thanks for helping anyway, guys :)
For easy debugging of programs created with the borland compiler, you need the borland debugger and this is not supported by C::B