boost::bind 似乎使用不同的编译器生成不同的符号
boost::bind seems to produce different symbols with different compilers?
我有一个使用模板和回调的共享对象库。我需要将其移植到另一个使用旧版 g++ (4.1.2) 的系统。
这是我正在做的伪代码:
shrdPtr.reset( new DataRecvr<T>(aString,boost::bind(&MyClass<T>::myCallBack, this,_1)));
它适用于较新的编译器,但是当我在旧系统上构建它时,我在运行时找不到一个符号。
我使用 nm mySo.so | c++flt 将不工作的 so 与 ldd -u -r mySo.so
进行比较在较新的编译器(g++ 4.4.7)上,它产生:
DataRecvr<TemplateName>::DataRecvr(std::basic_string<char,std::char_traits<char>,std::allocator<cahr> >const&, boost::function1,void,shrdPtr<TemplateName>&> const&
而在较旧的编译器上,它产生: DataRecvr<TemplateName>::DataRecvr(std::basic_string<char,std::char_traits<char>,std::allocator<char> >const&, boost::function1,void,shrdPtr<TemplateName>& std::allocator<boost::function_base> >const&)
如您所见,较旧的编译器在符号中产生了额外的内容,这些内容在运行时无法解决。
我在这里错过了什么?
似乎我包含了旧版本的提升。 给我带来问题的系统有多个版本的提升。 当我将包含路径设置为 boost_144 时,我的问题消失了。也许旧版本的 boost 会用绑定做一些奇怪的事情,这些事情与我正在使用的构造函数不兼容。
- 是否有任何 2 补充平台/编译器,其中有符号移位不做通常的事情?
- C++ 如何禁用具有不同符号变量比较的特定行的编译器警告?
- Android Cmake编译器正在生成带有额外前缀和符号后缀的.out文件
- 如何确定'malloc'符号是来自源还是来自编译器?
- Clang编译器/链接器找不到x86_64架构的符号NSMenuItem
- 编译器链接器外部符号mhook_sethook
- 来自 clang/llvm 编译器的重复符号错误
- C++编译器或预处理器是否可以将符号转换为大写
- 什么是 ?和 @ 符号演示此编译器错误?- Visual Studio 2013 Compiler.
- 编译器错误:从int*到无符号int*的转换无效[-fpermission]
- 现代编译器是否优化了for循环中使用的无符号int
- boost::bind 似乎使用不同的编译器生成不同的符号
- Visual C++编译器为不明确的符号提供了错误的行引用
- types.h中的内容——编译器在哪里定义int、带符号int和其他值的宽度
- C++ 在 Win DLL 到 Linux SO 转换中将 LPBYTE 更改为无符号字符*后编译器错误
- 如何防止编译器/链接器去除特定符号
- C++编译器 - 生成的符号类型
- 在 Scala 2.9.3 编译器的擦除阶段之后获取具体类型的符号
- 有符号整数溢出为负数:这是一个编译器错误,还是我误解了优化
- 玩具编译器符号表