1

Visual Studio2010のC++ゲームで(C ++ラッパーを使用して)PhysFSを使用しようとしていますが、リンカーがライブラリのリンクを拒否しています。
INSTALL.txtファイルに従ってライブラリを構築し、C:\ include \ physfs-2.0.2 \ lib \ Debugにphysfs.libがありますが、シンボルが見つからないことがわかります。ただし、ライブラリパスまたはライブラリ名のいずれかを変更するとエラーがスローされるため、.libファイルは確実に見つかります。
私はこれに完全に混乱しています、誰か助けてもらえますか?これが私の設定です:

VC++ディレクトリ->ライブラリディレクトリ

C:\include\glew-1.7.0\lib
C:\include\boost_1_47_0\libs\
C:\include\glfw-2.7.2\lib
C:\include\glfw-2.7.2\lib\win32
C:\include\boost_1_47_0\stage\lib\
c:\include\allegro-5.0.5-msvc-10.0\lib
C:\include\physfs-2.0.2\lib\Debug
$(LibraryPath)

リンカ->入力->追加の依存関係

physfs.lib
glew32d.lib
GLFW.lib
opengl32.lib
allegro-5.0.5-md-debug.lib
allegro_dialog-5.0.5-md-debug.lib
%(AdditionalDependencies)

ビルド出力

1>------ Build started: Project: Wolfenstein3D2011, Configuration: Debug Win32 ------
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Wolfenstein3D2011.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_getDirSeparator referenced in function "void __cdecl PhysFS::`dynamic initializer for 'DIR_SEP''(void)" (??__EDIR_SEP@PhysFS@@YAXXZ)
1>PhysFS.obj : error LNK2001: unresolved external symbol __imp__PHYSFS_getDirSeparator
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_permitSymbolicLinks referenced in function "void __cdecl PhysFS::init(char const *,bool)" (?init@PhysFS@@YAXPBD_N@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_getLastError referenced in function "void __cdecl PhysFS::init(char const *,bool)" (?init@PhysFS@@YAXPBD_N@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_init referenced in function "void __cdecl PhysFS::init(char const *,bool)" (?init@PhysFS@@YAXPBD_N@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_deinit referenced in function "void __cdecl PhysFS::deinit(void)" (?deinit@PhysFS@@YAXXZ)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_isInit referenced in function "bool __cdecl PhysFS::isInit(void)" (?isInit@PhysFS@@YA_NXZ)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_supportedArchiveTypes referenced in function "class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl PhysFS::supportedArchiveTypes(void)" (?supportedArchiveTypes@PhysFS@@YA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_freeList referenced in function "class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl PhysFS::getCdRomDirs(void)" (?getCdRomDirs@PhysFS@@YA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_getCdRomDirs referenced in function "class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl PhysFS::getCdRomDirs(void)" (?getCdRomDirs@PhysFS@@YA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_addToSearchPath referenced in function "void __cdecl PhysFS::addToSearchPath(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (?addToSearchPath@PhysFS@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_removeFromSearchPath referenced in function "void __cdecl PhysFS::removeFromSearchPath(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?removeFromSearchPath@PhysFS@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_mount referenced in function "void __cdecl PhysFS::mount(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool)" (?mount@PhysFS@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0_N@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_getMountPoint referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl PhysFS::getMountPoint(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?getMountPoint@PhysFS@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV23@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_getSearchPath referenced in function "class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl PhysFS::getSearchPath(void)" (?getSearchPath@PhysFS@@YA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@XZ)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_getUserDir referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __cdecl PhysFS::getUserDir(void)" (?getUserDir@PhysFS@@YAABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_getBaseDir referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const & __cdecl PhysFS::getBaseDir(void)" (?getBaseDir@PhysFS@@YAABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_getWriteDir referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl PhysFS::getWriteDir(void)" (?getWriteDir@PhysFS@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_setWriteDir referenced in function "void __cdecl PhysFS::setWriteDir(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?setWriteDir@PhysFS@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_setSaneConfig referenced in function "void __cdecl PhysFS::setSaneConfig(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,bool,bool)" (?setSaneConfig@PhysFS@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@00_N1@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_exists referenced in function "bool __cdecl PhysFS::exists(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?exists@PhysFS@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_isDirectory referenced in function "bool __cdecl PhysFS::isDirectory(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?isDirectory@PhysFS@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_isSymbolicLink referenced in function "bool __cdecl PhysFS::isSymbolicLink(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?isSymbolicLink@PhysFS@@YA_NABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_getLastModTime referenced in function "__int64 __cdecl PhysFS::getLastModTime(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?getLastModTime@PhysFS@@YA_JABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_mkdir referenced in function "void __cdecl PhysFS::mkdir(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?mkdir@PhysFS@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_delete referenced in function "void __cdecl PhysFS::remove(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?remove@PhysFS@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_getRealDir referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl PhysFS::getRealDir(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?getRealDir@PhysFS@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV23@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_enumerateFiles referenced in function "class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl PhysFS::enumerateFiles(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?enumerateFiles@PhysFS@@YA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@3@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_openAppend referenced in function "public: __thiscall PhysFS::FileDevice::FileDevice(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum PhysFS::OpenMode)" (??0FileDevice@PhysFS@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4OpenMode@1@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_openWrite referenced in function "public: __thiscall PhysFS::FileDevice::FileDevice(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum PhysFS::OpenMode)" (??0FileDevice@PhysFS@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4OpenMode@1@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_openRead referenced in function "public: __thiscall PhysFS::FileDevice::FileDevice(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,enum PhysFS::OpenMode)" (??0FileDevice@PhysFS@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@W4OpenMode@1@@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_close referenced in function "public: void __thiscall PhysFS::FileDevice::close(void)" (?close@FileDevice@PhysFS@@QAEXXZ)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_read referenced in function "public: __int64 __thiscall PhysFS::FileDevice::read(char *,__int64)" (?read@FileDevice@PhysFS@@QAE_JPAD_J@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_write referenced in function "public: __int64 __thiscall PhysFS::FileDevice::write(char const *,__int64)" (?write@FileDevice@PhysFS@@QAE_JPBD_J@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_seek referenced in function "public: class std::fpos<int> __thiscall PhysFS::FileDevice::seek(__int64,int)" (?seek@FileDevice@PhysFS@@QAE?AV?$fpos@H@std@@_JH@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_fileLength referenced in function "public: class std::fpos<int> __thiscall PhysFS::FileDevice::seek(__int64,int)" (?seek@FileDevice@PhysFS@@QAE?AV?$fpos@H@std@@_JH@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_tell referenced in function "public: class std::fpos<int> __thiscall PhysFS::FileDevice::seek(__int64,int)" (?seek@FileDevice@PhysFS@@QAE?AV?$fpos@H@std@@_JH@Z)
1>PhysFS.obj : error LNK2019: unresolved external symbol __imp__PHYSFS_flush referenced in function "public: bool __thiscall PhysFS::FileDevice::flush(void)" (?flush@FileDevice@PhysFS@@QAE_NXZ)
1>C:\Users\Lexi\OpenGL\wulfgame\game\Wolfenstein3D2011.exe : fatal error LNK1120: 37 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
4

2 に答える 2

1

私は最終的に(他の人からのいくつかのポインタを使用して)問題が、私のプロジェクトが共有win32 dllであると予想していたときに、PhysFSのビルドを静的win64ライブラリに自動的にターゲットにするCMakeであることがわかりました。
再構成で静的/共有の問題を解決しましたが、マシンのアーキテクチャを設定するものは見つかりませんでした。(おそらく何かがありますが、私はCMakeについて何も知りません。)
私の最終的な解決策:

  1. 共有オプションのみを使用して、クリーンな CMake 構成を実行します。
  2. Build->Configuration ManagerでWin32 をプラットフォームとして追加し、test_physfs を無効にします
  3. phyfs のProject->Properties->Linker->Advancedで、 Target MachineMachineX86に設定します。
  4. Linker->Command Lineで、追加オプションから/MACHINE:X64を削除します (これは、偶然見つけるまで私を夢中にさせました)

その後、完全にリンクされたwin32 dllにコンパイルされました。ウー。

于 2012-01-07T17:06:58.367 に答える
0

根本的な問題は、一番上にあるこの警告です

リンク: 警告 LNK4098: defaultlib 'MSVCRT' は他のライブラリの使用と競合します。/NODEFAULTLIB:ライブラリを使用

ここでのコンパイラは、プロジェクトがリンクする選択された C ランタイム ライブラリが、一部またはすべてのライブラリによって選択されたバージョンと競合していると言っています。これにより、標準ライブラリが使用されないようになり、その中で定義された型のリンカー エラーが発生することになります。

すべてのライブラリとこのプロジェクトに対して、単一バージョンの C ランタイムを選択する必要があります。次に、それらすべてをそれに対してコンパイルします。

于 2012-01-07T15:36:44.867 に答える