0

I would like to compile code with such a statement:

 c++ -I /usr/boost_1_53_0 boost_test.cpp -o boost \ /usr/lib/boost/libboost_regex.a

but it throws

c++: error:  /usr/lib/boost/libboost_regex.a: No such file or directory

I am sure, that libboost_regex.a is existing i above mentioned directory. How to solve it? I am new to ubuntu and linux. Looking forward for your tips. Thanks.

4

1 回答 1

0

问题是命令行中包含的反斜杠:

c++ -I /usr/boost_1_53_0 boost_test.cpp -o boost \ /usr/lib/boost/libboost_regex.a
                                                  ^
                                                  +-- escaped space character

此反斜杠转义了以下空格字符,因此路径名实际上是(使用百分比编码以获得更好的可读性):

%20/usr/lib/boost/libboost_regex.a

要解决它,只需删除反斜杠字符。

于 2013-06-25T12:36:16.000 回答