当前位置: 技术问答>linux和unix
g++编译可执行程序报错
来源: 互联网 发布时间:2016-12-11
本文导语: 本帖最后由 tiantang_85 于 2011-06-29 15:26:41 编辑 如题,不知道是哪里错了,请大家给予帮忙。谢谢了。(工程在windows下编译正常) ../bin/release_bin/libga7schlib.so: undefined reference to `std::allocator::allocator()' ../bin/release_bin/libga...
../bin/release_bin/libga7schlib.so: undefined reference to
`std::allocator::allocator()'
../bin/release_bin/libga7match.so: undefined reference to `std::allocator::~allocator()'
../bin/release_bin/libga7schlib.so: undefined reference to `std::vector::size() const'
../bin/release_bin/libTEST7egfstd.so: undefined reference to `std::allocator::allocator()'
../bin/release_bin/libga7schlib.so: undefined reference to `std::allocator::allocator(std::allocator const&)'
../bin/release_bin/libga7schlib.so: undefined reference to `std::vector::vector(std::vector const&)'
../bin/release_bin/libga7schlib.so: undefined reference to `std::vector::begin()'
../bin/release_bin/libga7schlib.so: undefined reference to `std::vector::operator[](unsigned long)'
../bin/release_bin/libga7schlib.so: undefined reference to `std::vector::begin()'
../bin/release_bin/libga7schlib.so: undefined reference to `std::vector::reserve(unsigned long)'
../bin/release_bin/libga7schlib.so: undefined reference to `std::vector::push_back(TEST7::GA7MATCH::LidRange const&)'
../bin/release_bin/libga7schlib.so: undefined reference to `std::vector::end()'
../bin/release_bin/libga7match.so: undefined reference to `std::vector::push_back(TEST7::GA7MATCH::PartitionId const&)'
../bin/release_bin/libTESTtools.so: undefined reference to `__isoc99_sscanf@GLIBC_2.7'
|
先看一下../bin/release_bin/libTESTtools.so这目标文件怎么生成的,在其源文件中找一下
有没有包含vector头文件
#include
using namespace std
有没有包含vector头文件
#include
using namespace std
|
undefined reference to xxx
可能是没找到链接的库
要不把程序贴上来看下
可能是没找到链接的库
要不把程序贴上来看下
|
不妨先贴一下你的Makefile,WINDOWS下MSC能过的东西,不见得能照搬到UNIX/LINUX/GCC下面