如何在生成过程中更改libtool调用的g++的标志

How to change the flags of g++ called by libtool during a make

本文关键字:调用 libtool g++ 标志 过程中      更新时间:2023-10-16

我正在尝试安装vowpal_wabbit(https://github.com/JohnLangford/vowpal_wabbit)。我在windows 7上,所以我使用cygwin64。

当调用"make"时,g++被调用:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I/usr/include -I/include -O3 -fomit-frame-pointer -ffast-math -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -DNDEBUG -Wall -pedantic -std=c++0x ...

最后我得到了错误:

comp_io.h:28:34: error: 'fileno' was not declared in this scope
        fil = gzdopen(fileno(stdin), "rb");                                      
global_data.cc: In constructor 'vw::vw()':
global_data.cc:316:32: error: 'fileno' was not declared in this scope
   stdout_fileno = fileno(stdout);
                                ^
Makefile:619: recipe for target 'global_data.lo' failed
make[2]: *** [global_data.lo] Error 1
make[2]: Leaving directory '/home/Sachou/vowpal_wabbit/vowpalwabbit'
Makefile:390: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/Sachou/vowpal_wabbit/vowpalwabbit'
Makefile:502: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

根据我的研究,我认为用std=gnu++0x标志而不是std=c++0x调用g++可能会解决这个问题。

我修改了makefile以读取CXXFLAGS = -std=gnu++0x而不是c++0x

但我仍然接到同样的电话,我不知道如何更改国旗。

回答我自己的问题:

我在文件"configure"中找到了要修改的正确CXXFLAGS。

现在调用使用了正确的标志,安装工作正常!