[英]VLC Api with C++ - linker error for .lib (even when I've added it to my VC++ project)
[英]i was adding offocial SQLite source code to my C++ project and gets a linker error
這在我的C ++項目中指的是哪種鏈接錯誤? 我唯一想到的是SQLite3標頭是項目的一部分。
duplicate symbol _main in:
/Users/.../Build/Intermediates/AssetInspector.build/Debug-iphoneos/AssetInspector.build/Objects-normal/armv7/main.o
/Users/.../Build/Intermediates/AssetInspector.build/Debug-iphoneos/AssetInspector.build/Objects-normal/armv7/shell.o
ld: 2 duplicate symbols for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
問題是main函數在main.c和shell.c中都定義了。
您應該只鏈接那些.c文件中的那些目標文件之一,而不是兩者都鏈接
將SQLite合並編譯到項目中時, 僅使用sqlite3.c
文件。 不需要其他文件。 ( shell.c
是sqlite3
命令行工具的源代碼。)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.