lnk2001

LNK2001 and LNK2019 errors - DirectX unresolved external symbols

元气小坏坏 提交于 2019-12-03 21:03:45
I am following along with the book "Introduction to 3D Game Programming with DirectX11" by Frank D. Luna. And I am getting these errors when I try and build my project. >BoxDemo.obj : error LNK2019: unresolved external symbol _D3DX11CompileFromFileW@44 referenced in function "private: void __thiscall BoxApp::BuildFX(void)" (?BuildFX@BoxApp@@AAEXXZ) >BoxDemo.obj : error LNK2019: unresolved external symbol _D3DX11CreateEffectFromMemory@20 referenced in function "private: void __thiscall BoxApp::BuildFX(void)" (?BuildFX@BoxApp@@AAEXXZ) >BoxDemo.obj : error LNK2019: unresolved external symbol

关于error LNK20xx的链接错误

假如想象 提交于 2019-12-03 08:50:34
引子 使用VS编译C++程序经常会遇到这种情况:编译已经成功,没有报错;但是链接时报错,类似于:“error LNK2001!@#¥#¥@%#……@#¥%&*&¥%¥@#¥”。网上查到的相关文章和我实际遇到不太一样,在这里总结一下我所遇到的链接错误的解决方式。注:这里不明确指明error LNK的错误代码。 一、没有正确的配置XXX.lib windows编译用到其他的dll库如XXX.dll,不但需要 .h的头文件,而且需要相应的 XXX.lib文件。之前查过说是这个XXX.lib文件是指明了函数的入口地址神马的,但为啥linux下就不需要呢? 回到问题本身,没有正确配置XXX.lib文件有以下几种可能: a)没有在链接的附加依赖项中写入正确的XXX.lib(或者使用#param 在程序中设定); b)搜索库文件的路径上XXX.lib不存在(库文件路径没有设置正确); c)XXX.lib文件有多个版本,而库文件路径上那个版本与你头文件的版本不一致; 二、C++类的函数在头文件中声明了,但是在cpp文件中没有对应的定义。 这种错误比较容易发现。错误中会出现函数名。 三、VS的配置不正确 这个是刚发现,并且昨天折磨了我半个下午。 我们工程的一个solution中包含多个project,而且project之间有依赖关系——某些的project会用到一些基础project生成的lib。

When using fstream in a library I get linker errors in the executable

拟墨画扇 提交于 2019-12-02 05:15:01
When I add #include <fstream> and try to use std::ifstream (i.e. std::ifstream ifile(pDest)) in my library I get the following linker errors when compiling a project whih uses the library: Error 2 error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: wchar_t * & __thiscall std::vector<wchar_t *,class std::allocator<wchar_t *> >::operator[](unsigned int)" (??A?$vector@PA_WV?$allocator@PA_W@std@@@std@@QAEAAPA_WI@Z) C:\zipprojnotworking\CPP\7zip\UI\TestingZipper\Console.lib(ZipLib.obj) TestingZipper Error 3 error LNK2001: unresolved external symbol _

Unresolved Externals Nightmare

会有一股神秘感。 提交于 2019-12-01 03:54:18
问题 Hello industry veterans, I am a junior in college embarking on my first summer programming internship, and I am in way over my head. The company I'm working for has purchased a colossal application from another company that has slowly been expanding and modifying it since the early 90's. The solution contains over 200,000 lines of code which are spread across more than 300 files. The entire solution has purportedly been written to ANSI-C++ standards. The code is almost entirely undocumented,

Linker error when calling a C function from C++ code in different VS2010 project

白昼怎懂夜的黑 提交于 2019-11-27 02:13:44
I'm trying to include some C code I found in our C++ project. The function is defined like this in the C file. #ifdef __cplusplus extern "C" { #endif extern char *dtoa(double, int, int, int *, int *, char **); extern char *g_fmt(char *, double); extern void freedtoa(char*); #ifdef __cplusplus } #endif char * g_fmt(register char *b, double x) { The VS project I'm including this in is creating a dll. The file is being compiled as C, other files in the project are being compiled as C++. I added a header to include in my C++ files #ifndef G_FMT_H #define G_FMT_H #ifdef __cplusplus extern "C" {

Linker error when calling a C function from C++ code in different VS2010 project

て烟熏妆下的殇ゞ 提交于 2019-11-26 09:14:02
问题 I\'m trying to include some C code I found in our C++ project. The function is defined like this in the C file. #ifdef __cplusplus extern \"C\" { #endif extern char *dtoa(double, int, int, int *, int *, char **); extern char *g_fmt(char *, double); extern void freedtoa(char*); #ifdef __cplusplus } #endif char * g_fmt(register char *b, double x) { The VS project I\'m including this in is creating a dll. The file is being compiled as C, other files in the project are being compiled as C++. I