asio linux 编译,提升协同程序和ASIO测试版本的Linux x64平台失败,gcc4.7

在Linux上使用gcc4.7和cmake编译CPP文件时,遇到链接Boost库(包括Boost.coroutine和Boost.context)失败的问题。链接过程中报错为未定义的引用`make_fcontext`和`jump_fcontext`。尽管符号表显示这两个符号存在于libboost_context库中,但链接仍然失败。尝试过搜索解决方案但未果。
摘要由CSDN通过智能技术生成

我复制了所有代码,并把它变成一个CPP文件,使用gcc4.7和cmake在linux上进行编译,与boost协程和boost上下文库链接,但链接失败。

的输出的文章

Linking CXX executable ../../../output/bin/unit_test

cd /home/watson/ID_project/build/server_linux_makefile_gcc/abc/test/unit/abc_async && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/unit_test.dir/link.txt --verbose=1

/usr/bin/c++ -std=c++11 -O3 -DNDEBUG -pthread -lrt -ltcmalloc -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free CMakeFiles/unit_test.dir/TestFileChannel.cpp.o CMakeFiles/unit_test.dir/TestStreamBuffer.cpp.o CMakeFiles/unit_test.dir/TestTimer.cpp.o CMakeFiles/unit_test.dir/TestThreadPool.cpp.o CMakeFiles/unit_test.dir/TestScheduler.cpp.o CMakeFiles/unit_test.dir/PCH.cpp.o CMakeFiles/unit_test.dir/main.cpp.o CMakeFiles/unit_test.dir/TestUDPNetwork.cpp.o CMakeFiles/unit_test.dir/TestTCPNetwork.cpp.o -o ../../../output/bin/unit_test -rdynamic ../../../../../../install/thirdparty_linux_makefile_gcc/lib/libboost_unit_test_framework-gcc47-mt-1_54.a ../../../../../../install/thirdparty_linux_makefile_gcc/lib/libboost_context-gcc47-mt-1_54.a ../../../../../../install/thirdparty_linux_makefile_gcc/lib/libboost_coroutine-gcc47-mt-1_54.a ../../../../../../install/thirdparty_linux_makefile_gcc/lib/libboost_thread-gcc47-mt-1_54.a ../../../../../../install/thirdparty_linux_makefile_gcc/lib/libboost_filesystem-gcc47-mt-1_54.a ../../../../../../install/thirdparty_linux_makefile_gcc/lib/libyaml-cpp.a ../../../../../../install/thirdparty_linux_makefile_gcc/lib/libmongoc.a ../../../../../../install/thirdparty_linux_makefile_gcc/lib/libboost_system-gcc47-mt-1_54.a ../../../../../../install/thirdparty_linux_makefile_gcc/lib/libprotobuf.a

../../../../../../install/thirdparty_linux_makefile_gcc/lib/libboost_coroutine-gcc47-mt-1_54.a(coroutine_context.o): In function `boost::coroutines::detail::coroutine_context::coroutine_context(void (*)(long), boost::coroutines::stack_context*)':

coroutine_context.cpp:(.text+0x103): undefined reference to `make_fcontext'

../../../../../../install/thirdparty_linux_makefile_gcc/lib/libboost_coroutine-gcc47-mt-1_54.a(coroutine_context.o): In function `boost::coroutines::detail::coroutine_context::jump(boost::coroutines::detail::coroutine_context&, long, bool)':

coroutine_context.cpp:(.text+0x1bc): undefined reference to `jump_fcontext'

collect2: error: ld returned 1 exit status

make[2]: *** [abc/output/bin/unit_test] Error 1

我打印符号表从某文件,并找到符号jump_fcontext' and make_fcontext”是存在的:

nm libboost_context-gcc47-mt-1_54.a

make_x86_64_sysv_elf_gas.o:

U _GLOBAL_OFFSET_TABLE_

U _exit

000000000000002e t finish

0000000000000000 T make_fcontext

jump_x86_64_sysv_elf_gas.o:

0000000000000000 T jump_fcontext

有人可以给我任何有关它的提示?我尝试谷歌每一个地方,但没有信息。

2013-07-26

watson

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值