C++ Poco 库出现编译错误 - 路径名包含空格
我正在尝试构建/安装/使用 Poco C++ 库。我正在管理乌布图图(纳蒂)。我已经编译了工作正常的静态库,但是当我将环境变量 PROJECT_BASE 设置为包含空格的路径时,我收到错误:
make
/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.
我已将 PROJECT_BASE 设置为:
/files/Dropbox/Myname\'s\ Work/C++\ Work
我认为应该正确转义?添加尾随退格键给我带来了另一个错误:
make
/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.
我可能错过了一些基本的东西,但我已经花了几天的时间来让 Poco C++ 库构建系统按照我想要的方式设置,但无济于事:SI 知道README 说了一些关于 SYMBLINKS 搞砸 PROJECT_BASE 的事情,但我没有使用任何 :S /files 是 ext4 安装(相同的硬盘,单独的分区),如果这完全相关的话。
感谢您的帮助!
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:
make
/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:
make
/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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于其他获得以下信息的人:“* 当前工作目录不在 $PROJECT_BASE 下。停止。”错误,我找到了一个听起来可能晦涩难懂的解决方案。
基本上,如果任何父目录是符号链接,就会生成此错误。
http://pocoproject.org/docs/00200-GettingStarted.html
就我而言,我正在编译 5 层深度的库,第二个目录是符号链接。将其更改为目录解决了该问题。
华泰
For anyone else getting the: "* Current working directory not under $PROJECT_BASE. Stop." error, I found a solution that maybe sounds obscure.
Basically, if any of the parent directories are symlinks, it will generate this error.
http://pocoproject.org/docs/00200-GettingStarted.html
In my case, I was compiling the library 5 levels deep and the second directory was a symlink. Changing it to a directory resolved the issue.
HTH
要使诸如 makefile 之类的系统能够准确地处理带有空格的路径名,需要非常小心和刻意的努力。这是可以做到的;这并非小事。很明显这个包并没有被如此修改;它就像大多数此类包一样。
如果你真的想让自己的生活变得地狱,请使用路径名,例如:
空格、单引号和双引号 - 至少它不包括反引号、美元、括号、换行符等。
与此同时,向不可避免的情况低头- 使用不含空格等的路径名。
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:
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.
如果您的问题不在于符号链接,就像我的情况一样,您可能没有指定完整路径,而是指定相对路径,如以下博客文章所示。
http://fatalfeel.blogspot.com /2013/09/poco-with-cocos2d-in-android-and-ios.html
If your problem is not with symlinks, as in my case, you probably are not specifying a full path, but instead a relative one, as indicated in the following blog post.
http://fatalfeel.blogspot.com/2013/09/poco-with-cocos2d-in-android-and-ios.html