linker woes - undefined reference

前端 未结 6 923
北恋
北恋 2021-02-08 16:22

I\'m having a problem with my compiler telling me there is an \'undefined reference to\' a function I want to use in a library. Let me share some info on the problem:

6条回答
  •  情书的邮戳
    2021-02-08 16:44

    It sounds like you are not compiling the .c file in the library to produce a .o file. The linker would look for the prototype's implementation in the .o file produced by compiling the library

    Does your build process compile the library .c file?

    Why do you call it a "library" if it's actually just source code?

提交回复
热议问题