Giter Site home page Giter Site logo

Comments (3)

erban-xiao avatar erban-xiao commented on June 1, 2024 6

40%] Building CXX object libco/CMakeFiles/example_cond.dir/example_cond.cpp.o
[ 43%] Linking CXX executable example_cond
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: libcolib.a(co_hook_sys_call.cpp.o): in function co_gethostbyname_r(char const*, hostent*, char*, unsigned long, hostent**, int*)': co_hook_sys_call.cpp:(.text+0x1e39): undefined reference to clsCoMutex::clsCoMutex()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: libcolib.a(co_hook_sys_call.cpp.o): in function clsSmartLock::clsSmartLock(clsCoMutex*)': co_hook_sys_call.cpp:(.text._ZN12clsSmartLockC2EP10clsCoMutex[_ZN12clsSmartLockC5EP10clsCoMutex]+0x26): undefined reference to clsCoMutex::CoLock()'
/opt/rh/devtoolset-9/root/usr/libexec/gcc/x86_64-redhat-linux/9/ld: libcolib.a(co_hook_sys_call.cpp.o): in function clsSmartLock::~clsSmartLock()': co_hook_sys_call.cpp:(.text._ZN12clsSmartLockD2Ev[_ZN12clsSmartLockD5Ev]+0x17): undefined reference to clsCoMutex::CoUnLock()'
collect2: error: ld returned 1 exit status
make[2]: *** [libco/CMakeFiles/example_cond.dir/build.make:105: libco/example_cond] Error 1
make[1]: *** [CMakeFiles/Makefile2:244: libco/CMakeFiles/example_cond.dir/all] Error 2
make: *** [Makefile:115: all] Error 2

CMakeLists文件漏了一个源文件co_comm.cpp
set(SOURCE_FILES
co_comm.cpp
co_epoll.cpp
co_hook_sys_call.cpp
co_routine.cpp
coctx.cpp
coctx_swap.S)

添加了就能编译过了

from libco.

hsbyhub avatar hsbyhub commented on June 1, 2024

楼上正解,这字面意思就是找不到函数签名的引用(定义,实现), 一般可能是编译时没有链接到对应的模块(库或者源文件, 在c++中一般是cpp文件),这里明显是库中的函数找不到链接,那就在库里找下函数的定义在哪里,CMake配置文件加上就可以了

from libco.

hobby avatar hobby commented on June 1, 2024

from libco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.