【发布时间】:2010-12-25 21:43:14
【问题描述】:
我正在尝试将我写的东西链接到现有的共享库。 我在 RedHat 3 上使用 gcc 3.2.3。当我进入链接阶段时,我收到一条错误消息:
object_files_linux/hvm_example.o(.text+0x233):~/hvm_example.cpp:254: 未定义对`xoc::hvmapi::id(std::basic_string, std::allocator > const&)'的引用
我已经在目标文件上运行了 nm 命令,它为有问题的函数显示了这一点:
U xoc::hvmapi::id(std::basic_string, std::allocator > const&)
我在共享库上运行 nm,它为有问题的函数显示了这一点:
T xoc::hvmapi::id(__STL::basic_string, _STL::allocator > const&)
我的问题是:链接失败是因为我的函数使用 std 命名空间而共享库使用 _STL 命名空间吗?
有解决办法吗?
我无权访问共享库源代码的源代码,但我确实有使用 std 命名空间作为参数的头文件。
谢谢, 迈克
【问题讨论】:
标签: gcc linker shared-libraries