在cygwin中成功编译xlslib库

刚开始编译时,出现./xlslib/format.h:148: error: expected unqualified-id before '&' token错误的处理方法:

记得在./configure后加入CPPFLAGS="-D _GLIBCXX_USE_WSTRING"选项,这样才能有wstring的声明,即运行./configure CPPFLAGS="-D _GLIBCXX_USE_WSTRING"

另外,如果在windows平台想要成功编译出动态链接库,还必须增加“-no-undefined”选项,即./configure CPPFLAGS="-D _GLIBCXX_USE_WSTRING -D -no-undefined"。至于原因,可见libtool帮助文档,摘录如下:

‘win32-dll’
This option should be used if the package has been ported to build
clean dlls on win32 platforms. Usually this means that any library data
items are exported with __declspec(dllexport) and imported with __
declspec(dllimport). If this macro is not used, libtool will assume that
the package libraries are not dll clean and will build only static libraries
on win32 hosts.
Provision must be made to pass ‘-no-undefined’ to libtool in link mode
from the package Makefile. Naturally, if you pass ‘-no-undefined’, you
must ensure that all the library symbols really are defined at link time!

‘-no-undefined’
Declare that output-file does not depend on any libraries other than the ones
listed on the command line, i.e., after linking, it will not have unresolved sym-
bols. Some platforms require all symbols in shared libraries to be resolved at
library creation (see Chapter 9 [Inter-library dependencies], page 46), and using
this parameter allows libtool to assume that this will not happen.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值