views:

730

answers:

1

Hi!

I just started programming C++, first in ms Visual c++, then in Code::Blocks.

The problem is that on my computer, running Ubuntu, Code::Blocks "out of the box" does not debug, even the default "hello world", it just skips all breakpoints and finishes the program.

I have a virtualized Windows machine using Sun's VirtualBox and the window's Code::Blocks that I put there runs great "out of the box"!.

the program on ubuntu, shows this when I try to debug: Can't find member of namespace, class, struct, or union named "a/b/c" where a/b/c is the path to where the program I am building is.

that's what appears on the debugger log:


Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: /home/arnau/Documents/UNI/compus/Code::Blocks/opo/
Adding source dir: /home/arnau/Documents/UNI/compus/Code::Blocks/opo/
Adding file: bin/Debug/opo
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.8-debian

Can't find member of namespace, class, struct, or union named "/home/arnau/Documents/UNI/compus/Code::Blocks/opo/main.cpp:8"
Hint: try '"/home/arnau/Documents/UNI/compus/Code::Blocks/opo/main.cpp:8 or '"/home/arnau/Documents/UNI/compus/Code::Blocks/opo/main.cpp:8
(Note leading single quote.)
Program exited normally.
Debugger finished with status 0


Thank you for your time, I really appreciate that.

Arnau, from Barcelona

+1  A: 

Your naming of the source directory: .../Code::Blocks/... is most unfortunate.

While UNIX allows any character in a filename, except '/' and NUL, it is unwise to use ':', because that is a PATH separator, and you would not be able to add e.g. /home/arnau/Documents/UNI/compus/Code::Blocks/opo to your PATH.

In GDB there are two additional meanings of ':' -- the separator between file name and line number (or function name), and '::' as a scope indicator (required for handling C++).

Summary: rename "Code::Blocks" directory to codeblocks, and live happily ever after.

Employed Russian