Undefined Reference to a function

后端 未结 5 795
说谎
说谎 2020-12-18 10:34

I\'m using Linux and I have the following files:

main.c, main.h
fileA.c, fileA.h
fileB.cpp, fileB.h

The function F1() is decla

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-18 11:09

    fileA.c can't include fileB.h (via fileA.h) because the C compiler doesn't know what extern "C" means, so it complains that it sees an identifier before a string. don't try to include fileB.h in fileA.c or fileA.h. its not needed

提交回复
热议问题