Я пытаюсь построить код от NVidia 9.5 SDK, но я получаю следующие ошибки компоновщика:компоновщика ошибок в Visual C++ LNK2005, LNK2019 - не знаю, почему
>1>NV_D3DCommonDX9U.lib(NV_StringFuncs.obj) : error LNK2005: "class std::basic_istream<char,struct std::char_traits<char> > & __cdecl std::getline<char,struct std::char_traits<char>,class std::allocator<char> >(class std::basic_istream<char,struct std::char_traits<char> > &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected][email protected]@[email protected]@@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) already defined in msvcprtd.lib(MSVCP90D.dll)
1>FogTombScene.obj : error LNK2019: unresolved external symbol "public: struct IDirect3DTexture9 * * __thiscall TextureFactory::CreateTextureFromFile(struct IDirect3DDevice9 *,wchar_t const *,bool)" ([email protected]@@[email protected]@[email protected]@[email protected]) referenced in function "public: virtual long __thiscall FogTombScene::RestoreDeviceObjects(void)" ([email protected]@@UAEJXZ)
1>FogTombScene.obj : error LNK2019: unresolved external symbol "public: long __thiscall LoadXFile::LoadFile(wchar_t const *,bool)" ([email protected]@@[email protected]) referenced in function "public: virtual long __thiscall FogTombScene::RestoreDeviceObjects(void)" ([email protected]@@UAEJXZ)
1>FogTombScene.obj : error LNK2019: unresolved external symbol "public: long __thiscall LoadXFile::Initialize(struct IDirect3DDevice9 *,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > (__cdecl*)(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,bool),class TextureFactory * *)" ([email protected]@@[email protected]@[email protected][email protected][email protected]@@[email protected][email protected]@@[email protected]@[email protected][email protected]@@@Z) referenced in function "public: virtual long __thiscall FogTombScene::RestoreDeviceObjects(void)" ([email protected]@@UAEJXZ)
1>NV_D3DCommonDX9U.lib(NV_StringFuncs.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall std::locale::facet::_Register(void)" ([email protected]@[email protected]@@QAEXXZ) referenced in function "class std::ctype<char> const & __cdecl std::use_facet<class std::ctype<char> >(class std::locale const &)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@Z)
1>NV_D3DCommonDX9U.lib(NV_StringFuncs.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned int __cdecl std::ctype<char>::_Getcat(class std::locale::facet const * *)" ([email protected][email protected]@[email protected]@SAI[email protected]@[email protected]@Z) referenced in function "class std::ctype<char> const & __cdecl std::use_facet<class std::ctype<char> >(class std::locale const &)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@Z)
1>NV_D3DCommonDX9U.lib(NV_StringFuncs.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static unsigned int __cdecl std::ctype<unsigned short>::_Getcat(class std::locale::facet const * *)" ([email protected][email protected]@[email protected]@[email protected]@[email protected]@Z) referenced in function "class std::ctype<unsigned short> const & __cdecl std::use_facet<class std::ctype<unsigned short> >(class std::locale const &)" ([email protected][email protected]@[email protected]@@[email protected]@[email protected]@[email protected]@[email protected]@Z)
Я понятия не имею, почему я gettin gthese terrors, потому что я на 99% уверен, что правильно настроил свои каталоги.
Например, одна из функций, которые он не может найти, - TextureFactory :: CreateTextureFromFile, но у меня есть каталог, в котором эта функция объявлена и определена, уже добавлена в каталог include/source в настройках Visual C++.
Начало файла выглядит следующим образом:
#include "nvafx.h"
//#include "NV_D3DCommon\NV_D3DCommonDX9.h" // include library sub-headers
// and add .lib to linker inputs
//#include "NV_D3DMesh\NV_D3DMesh.h"
//#include "shared\NV_Common.h"
//#include "shared\NV_Error.h"
#include "FogTombScene.h"
#include "ThicknessRenderProperties.h"
#include "ThicknessRenderProperties8BPC.h"
#include "../camera.h"
// When the following two lines are added I get more LNK2005 (understandable)
// but I also still get the same LNK2019 errors as above
#include "texturefactory.h"
#include "texturefactory.cpp"
Более уместной, если я говорю #include «TextureFactory.h» и #include «texturefactory.cpp» в верхней части файла, в котором я Получив эти ошибки, тогда не может быть места для двусмысленности, функции определены и в основном копируются + вставляются в один и тот же исходный файл, генерирующий ошибку компоновщика, но я все равно получаю ошибку компоновщика.
Я что-то пропускаю?
Пожалуйста, покажите верхнюю часть исходного файла, чтобы показать последовательность, в которую вы включаете заголовочные файлы (включая texturefactory.cpp). – ChrisW