-1
我是一個Linux用戶,我沒有太多的Windows編程經驗,所以我按下它是Visual Studio的問題,我必須使用,或類似的東西.. 。無法解析的外部符號「*」在函數中引用_main
我有非常簡單的代碼,這樣的:
myProgram.cpp
...
#include "rideList.h"
...
int main() {
...
rideListMain();
...
}
rideList.h
...
void rideListMain();
...
rideList.c
void rideListMain() {
// some code here...
}
事實上,有另一個4個文件和類似的功能,如rideListMain()和編譯器的輸出被
LNK2019 unresolved external symbol "void __cdecl rideListMain(void)" ([email protected]@YAXXZ) referenced in function _main
解決方案
將* .cpp重命名爲* .c解決了這個問題。
'rideList.c'可能的名稱修改問題。我的意思是你忘了'extern「c」{'http://stackoverflow.com/questions/1041866/in-c-source-what-is-the-effect-of-extern-c – drescherjm
你混合了'c' 'C++' – Raindrop7
C和C++是不同的語言。 – Olaf