Technosites Technosites - 1 year ago 127
C++ Question

C++ Make compile errors with Poco Library - Path Name containing spaces

I'm attempting to build/install/use the Poco C++ Libraries. I'm running Ubututu (Natty). I've compiled the static libraries which are working fine, but when I set the env var PROJECT_BASE to a path containing spaces, I get errors:

/bin/sh: Syntax error: Unterminated quoted string
/bin/sh: Syntax error: Unterminated quoted string
/home/username/Documents/poco-1.4.1p1/build/rules/global:62: *** Current working directory not under $PROJECT_BASE. Stop.

I've set PROJECT_BASE to:

/files/Dropbox/Myname\'s\ Work/C++\ Work

which I believe should be escaped correctly? Adding a trailling backspace gives me the alternate error of:

/bin/sh: Syntax error: Unterminated quoted string
awk: line 1: runaway string constant "/files/Dro ...
/home/username/Documents/poco-1.4.1p1/build/rules/global:62: *** Current working directory not under $PROJECT_BASE. Stop.

I might be missing something basic, but I've been wrestling for a few days now to get the Poco C++ Library build system set up how I want it to no avail :S I know the README said something about SYMBLINKS screwing up the PROJECT_BASE, but I'm no using any :S /files is an ext4 mount (same hdd, seperate partition) if that's relevant at all.

Thanks for your help!

Answer Source

It requires great care and deliberate effort to make systems such as makefiles handle pathnames with spaces accurately. It can be done; it is not trivial. It is fairly clear that this package has not been so modified; it is like the majority of such packages.

If you really want to make life hell for yourself, use a pathname such as:

/home/mine/He said, "Don't do it!"/poco-1.4.1

Spaces, single and double quotes -- at least it doesn't include backquotes, dollars, parentheses, newlines, etc.

In the meantime, bow to the inevitable - use a pathname without spaces etc in it.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download