C++ Poco 库出现编译错误 - 路径名包含空格

发布于 2024-11-02 08:49:31 字数 930 浏览 1 评论 0原文

我正在尝试构建/安装/使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一萌ing 2024-11-09 08:49:31

对于其他获得以下信息的人:“* 当前工作目录不在 $PROJECT_BASE 下。停止。”错误,我找到了一个听起来可能晦涩难懂的解决方案。

基本上,如果任何父目录是符号链接,就会生成此错误。

重要提示:确保构建目录的路径不存在
包含符号链接。此外,在 Mac OS X(或其他系统
对于不区分大小写的文件系统),请确保中的字符
路径大小写正确。否则你会得到一个错误提示
“当前工作目录不在 $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.

IMPORTANT: Make sure that the path to the build directory does not
contain symbolic links. Furthermore, on Mac OS X (or other systems
with case insensitive filesystems), make sure that the characters in
the path have the correct case. Otherwise you'll get an error saying
"Current working directory not under $PROJECT_BASE.".

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

金兰素衣 2024-11-09 08:49:31

要使诸如 makefile 之类的系统能够准确地处理带有空格的路径名,需要非常小心和刻意的努力。这是可以做到的;这并非小事。很明显这个包并没有被如此修改;它就像大多数此类包一样。

如果你真的想让自己的生活变得地狱,请使用路径名,例如:

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

空格、单引号和双引号 - 至少它不包括反引号、美元、括号、换行符等。

与此同时,向不可避免的情况低头- 使用不含空格等的路径名。

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.

静水深流 2024-11-09 08:49:31

如果您的问题不在于符号链接,就像我的情况一样,您可能没有指定完整路径,而是指定相对路径,如以下博客文章所示。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文