简体   繁体   English

带有自动工具和附加编译器标志的编译库

[英]Compile library with autotools and an additional compiler flag

I'm building library gdal-1.9.2 . 我正在构建gdal-1.9.2库。 After launching the ./configure command, make fails with the error 启动./configure命令后, make失败并显示错误

ISO C++ forbids comparison between pointer and integer [-fpermissive] ISO C ++禁止比较指针和整数[-fpermissive]

If I launch the last failed command in a console with the additional option -fpermissive , it finishes successfully (with a warning, not an error). 如果我使用附加选项-fpermissive在控制台中启动最后一个失败的命令,它将成功完成(带有警告,而不是错误)。

g++ -g -O2 -Wall -DOGR_ENABLED -I/home/unona/unona-pult/gdal-1.9.2/port -DHAVE_LIBZ -fpermissive -c cplkeywordparser.cpp  -fPIC -DPIC -o .libs/cplkeywordparser.o

How to finish the build process now? 现在如何完成构建过程? Just make rebuilds it and crashes in the same way. 只需重新make它并以相同的方式崩溃即可。

For autotools builds, you can expect the ./configure script to check for compiler flags set via environment variables (command line options are usually supported as well, but they are not as easy to memorize, IMHO). 对于自动工具构建,您可以期望./configure脚本检查通过环境变量设置的编译器标志(通常也支持命令行选项,但IMHO并不容易记住)。 The names for these variables are standard ones, and in your case, it should be 这些变量的名称是标准名称,在您的情况下,应为

CXXFLAGS="-fpermissive" ./configure

make install

The configure script generates the makefile such that the value of CXXFLAGS is passed to the compiler while building. configure脚本生成makefile ,以便在构建时将CXXFLAGS的值传递给编译器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM