我正在试图弄清楚如何设置一些环境变量,这将使g ++链接到正确版本的库.
我在/ usr/lib64中有一些旧的boost库(链接这些将失败)和/ v/users/regel/lib中的新库.因此链接器应链接新库.
命令:
$ g++ test.cpp -lboost_system -L/v/users/regel/lib
Run Code Online (Sandbox Code Playgroud)
正确链接程序.但是,我希望将其设置为链接器的第1个搜索目录,这样我每次链接时都不必指定"-L".
以下环境变量似乎不起作用:
$ LIBRARY_PATH=/v/users/regel/lib g++ test.cpp -lboost_system
/tmp/regel/cc4SmBtI.o: In function `main':
test.cpp:(.text+0x5): undefined reference to `boost::system::system_category()'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
和
$ LD_LIBRARY_PATH=/v/users/regel/lib:$LD_LIBRARY_PATH g++ test.cpp -lboost_system
/tmp/regel/ccUreBZy.o: In function `main':
test.cpp:(.text+0x5): undefined reference to `boost::system::system_category()'
collect2: error: ld returned 1 exit status
Run Code Online (Sandbox Code Playgroud)
尽管阅读了大量关于类似主题的文章和帖子,但我还没有找到解决方案.
我似乎无法从命令行中读取配置文件多音色选项.配置文件的语法是什么?
这是添加选项描述的方式:
//parser.cpp
- - -
po::options_description* generic;
generic=new po::options_description("Generic options");
generic->add_options()
("coordinate",po::value<std::vector<double> >()->multitoken(),"Coordinates (x,y)");
Run Code Online (Sandbox Code Playgroud)
之后我解析命令和配置文件.
在命令行'--coordinate 1 2'工作.但是,当我尝试配置文件时:
coordinate = 1,2
Run Code Online (Sandbox Code Playgroud)
要么
coordinate= 1 2
Run Code Online (Sandbox Code Playgroud)
它没有给出invalid_option_value异常.那么多语言选项的配置文件的语法究竟是什么?
我已经在El Capitan上使用Xcode 8成功安装了Qt 5.7.0和Qt-creator 4.1.0.
我从qt 修复了xcode sdk-version错误,现在我正在尝试为iphonesimulator构建一个示例.他们都没有工作.所有这些都失败了,类型为错误消息:
The following build commands failed:
CopyPNGFile Debug-iphonesimulator/2dpainting.app/Default-568h@2x.png 2dpainting.xcodeproj/Default-568h@2x.png
Run Code Online (Sandbox Code Playgroud)
我可以确认目录Debug-iphonesimulator/2dpainting.app没有png文件,它实际上位于qt安装目录中的某个位置.将png复制到源文件夹没有帮助,因为在运行'make'时文件夹被覆盖.
任何意见,将不胜感激.
编辑:构建工具包警告以下问题:"Qt版本不支持设备类型".设备类型是"iOS模拟器".
c++ ×1
config-files ×1
g++ ×1
gcc ×1
ios ×1
ld ×1
linker ×1
macos ×1
optionparser ×1
qt ×1
qt-creator ×1
syntax ×1
xcode ×1