Debug option GPC confuses g++ (Linux, no IDE)

Previous topic - Next topic

r0ber7

Hi.

I code and compile on Linux. For this, I've coded my own script that handles the preprocessing, compiling, and linking. This works perfectly, except when I try to use the debug option in the preprocessor.
(I'm having some out of bounds errors and I'd like to see where the problem lies by using the debug option).
I add "-D" to the preprocessor command, which works, but when it's time to compile with g++, it throws me a bunch of errors:

Code (glbasic) Select
Wordcount:8075 commands
--> Compiling all .cpp files...
./out0.cpp: In function 'int __GLBASIC__::__MainGameSub_()':
./out0.cpp:15:3: error: '__VAR_CONTAINER' was not declared in this scope
./out0.cpp:15:19: error: expected ';' before '__l_dbg_cont'
./out0.cpp: In function 'DGInt __GLBASIC__::__end_main__foo__()':
./out0.cpp:363:3: error: '__VAR_CONTAINER' was not declared in this scope
./out0.cpp:363:19: error: expected ';' before '__l_dbg_cont'
./out10.cpp: In function 'DGInt __GLBASIC__::add_icon(__GLBASIC__::DGStr, DGInt, DGInt)':
./out10.cpp:15:3: error: '__VAR_CONTAINER' was not declared in this scope
./out10.cpp:15:19: error: expected ';' before '__l_dbg_cont'
./out10.cpp:16:15: error: expected primary-expression before ',' token


Etcetera.
I'd like to know if there are some options I could pass to g++ to make it understand what I'm trying to do... Does it have something to do with the -DNDEBUG option? It's not a big problem cause I could always switch to Windows and use the debugger from the IDE, but I'd like to avoid this if at all possible. ;)