我正在尝试链接到相同目录中的库,并使用以下命名约定:
libFoo64.a # 64-bit release
libFoo32.a # 32-bit release
libFood64.a # 64-bit debug
libFood32.a # 32-bit debug
我可以在QMake .pro文件中放入什么内容,以便为每个版本找到正确的库?
我正在使用启用了默认工具包的QtCreator 4.9.0(MSYS2构建):
对于32位调试版本,我将选择32位套件,然后选择该版本下的Release配置,等等。
我看到了this question,它指示如何为“调试”和“发布”设置不同的QMake选项,但我不确定如何根据使用的套件来扩展它以使用不同的选项。
答案 0 :(得分:0)
基于this question,我通过.pro文件中的以下代码成功实现了目标:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
[2019-05-01T05:22:35,571][WARN ][o.e.c.l.LogConfigurator ] [unknown] Some logging configurations have %marker but don't have %node_name. We will automatically add %node_name to the pattern to ease the migration for users who customize log4j2.properties but will stop this behavior in 7.0. You should manually replace `%node_name` with `[%node_name]%marker ` in these locations:
/usr/share/elasticsearch/config/log4j2.properties
[2019-05-01T05:22:41,066][INFO ][o.e.e.NodeEnvironment ] [cwstj4Y] using [1] data paths, mounts [[/usr/share/elasticsearch/data (/dev/disk/by-id/scsi-0DO_Volume_pvc-3886ce76-6926-11e9-8fbf-7e8b62b9a87c)]], net usable_space [9.2gb], net total_space [9.7gb], types [ext4]
[2019-05-01T05:22:41,067][INFO ][o.e.e.NodeEnvironment ] [cwstj4Y] heap size [503.6mb], compressed ordinary object pointers [true]
[2019-05-01T05:22:41,070][INFO ][o.e.n.Node ] [cwstj4Y] node name derived from node ID [cwstj4Y8Q5-C6mdodTZqAA]; set [node.name] to override
[2019-05-01T05:22:41,071][INFO ][o.e.n.Node ] [cwstj4Y] version[6.5.0], pid[1], build[default/tar/816e6f6/2018-11-09T18:58:36.352602Z], OS[Linux/4.19.0-0.bpo.2-amd64/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/11.0.1/11.0.1+13]
[2019-05-01T05:22:41,071][INFO ][o.e.n.Node ] [cwstj4Y] JVM arguments [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Djava.io.tmpdir=/tmp/elasticsearch.unseH83l, -XX:+HeapDumpOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Djava.locale.providers=COMPAT, -XX:UseAVX=2, -Xms512m, -Xmx512m, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/share/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=tar]
[2019-05-01T05:23:01,683][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [aggs-matrix-stats]
[2019-05-01T05:23:01,683][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [analysis-common]
[2019-05-01T05:23:01,683][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [ingest-common]
[2019-05-01T05:23:01,684][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [lang-expression]
[2019-05-01T05:23:01,684][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [lang-mustache]
[2019-05-01T05:23:01,684][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [lang-painless]
[2019-05-01T05:23:01,684][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [mapper-extras]
[2019-05-01T05:23:01,684][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [parent-join]
[2019-05-01T05:23:01,684][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [percolator]
[2019-05-01T05:23:01,685][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [rank-eval]
[2019-05-01T05:23:01,685][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [reindex]
[2019-05-01T05:23:01,685][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [repository-url]
[2019-05-01T05:23:01,685][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [transport-netty4]
[2019-05-01T05:23:01,685][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [tribe]
[2019-05-01T05:23:01,685][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-ccr]
[2019-05-01T05:23:01,685][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-core]
[2019-05-01T05:23:01,686][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-deprecation]
[2019-05-01T05:23:01,686][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-graph]
[2019-05-01T05:23:01,686][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-logstash]
[2019-05-01T05:23:01,686][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-ml]
[2019-05-01T05:23:01,686][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-monitoring]
[2019-05-01T05:23:01,686][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-rollup]
[2019-05-01T05:23:01,686][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-security]
[2019-05-01T05:23:01,686][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-sql]
[2019-05-01T05:23:01,686][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-upgrade]
[2019-05-01T05:23:01,687][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded module [x-pack-watcher]
[2019-05-01T05:23:01,687][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded plugin [ingest-geoip]
[2019-05-01T05:23:01,688][INFO ][o.e.p.PluginsService ] [cwstj4Y] loaded plugin [ingest-user-agent]
[2019-05-01T05:23:45,482][INFO ][o.e.x.s.a.s.FileRolesStore] [cwstj4Y] parsed [0] roles from file [/usr/share/elasticsearch/config/roles.yml]
[2019-05-01T05:23:52,079][INFO ][o.e.x.m.j.p.l.CppLogMessageHandler] [cwstj4Y] [controller/58] [Main.cc@109] controller (64 bit): Version 6.5.0 (Build 71882a589e5556) Copyright (c) 2018 Elasticsearch BV
[2019-05-01T05:23:59,157][INFO ][o.e.d.DiscoveryModule ] [cwstj4Y] using discovery type [zen] and host providers [settings]
[2019-05-01T05:24:09,858][INFO ][o.e.n.Node ] [cwstj4Y] initialized
[2019-05-01T05:24:09,858][INFO ][o.e.n.Node ] [cwstj4Y] starting ...
[2019-05-01T05:24:11,674][INFO ][o.e.t.TransportService ] [cwstj4Y] publish_address {10.244.0.139:9300}, bound_addresses {[::]:9300}
[2019-05-01T05:24:12,064][INFO ][o.e.b.BootstrapChecks ] [cwstj4Y] bound or publishing to a non-loopback address, enforcing bootstrap checks
ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[2019-05-01T05:24:12,447][INFO ][o.e.n.Node ] [cwstj4Y] stopping ...
[2019-05-01T05:24:12,763][INFO ][o.e.n.Node ] [cwstj4Y] stopped
[2019-05-01T05:24:12,764][INFO ][o.e.n.Node ] [cwstj4Y] closing ...
[2019-05-01T05:24:12,954][INFO ][o.e.n.Node ] [cwstj4Y] closed
[2019-05-01T05:24:12,965][INFO ][o.e.x.m.j.p.NativeController] [cwstj4Y] Native controller process has stopped - no new native processes can be started
虽然不是特别漂亮,但仍然可以使用。
我还必须修改套件配置,以使32位编译器启用32位QT(即使我正在执行非QT应用程序,我也只使用QtCreator,因为我喜欢IDE,而我没有以前甚至没有安装32位QT)。 contains(QT_ARCH, i386) {
CONFIG(debug, debug|release) {
message("32-bit debug")
LIBS += -lFooBard32 -lFooBazd32 -lFooQuxd32 -lFooCorged32 -lFooGraultd32
}else {
message("32-bit release")
LIBS += -lFooBar32 -lFooBaz32 -lFooQux32 -lFooCorge32 -lFooGrault32
}
}else {
CONFIG(debug, debug|release) {
message("64-bit debug")
LIBS += -lFooBard64 -lFooBazd64 -lFooQuxd64 -lFooCorged64 -lFooGraultd64
}else {
message("64-bit release")
LIBS += -lFooBar64 -lFooBaz64 -lFooQux64 -lFooCorge64 -lFooGrault64
}
}
变量似乎基于套件中配置的“ Qt版本”,而不是套件中选择的实际编译器。