[英]Visual studio cannot find nafxcwd.pdb
I am working in a mixed Fortran-C++ programming environment. 我正在混合的Fortran-C ++编程环境中工作。 The C++ project is a static library ( XMLParser.lib
) used to read and write into XML files. C ++项目是一个静态库( XMLParser.lib
),用于读取和写入XML文件。 It is added as an additional dependency to Fortran project, which is a DLL library ( engine.dll
) used to perform mathematical computations. 它作为Fortran项目的附加依赖项而添加,该项目是用于执行数学计算的DLL库( engine.dll
)。 The Fortran uses CRT ( LIBCMTD
) and C++ is using MFC libraries. Fortran使用CRT( LIBCMTD
),而C ++使用MFC库。 As described in Here , this can cause linker error if LIBCMTD
and NAFXCWD
libraries are not linked in the correct order. 作为描述在这里 ,这可能会导致连接错误如果LIBCMTD
和NAFXCWD
库不按照正确的顺序链接。 To avoid this issue I had to add nafxcwd.lib
as an additional dependency to C++ project. 为避免此问题,我必须将nafxcwd.lib
添加为C ++项目的附加依赖项。
Everything works fine and solution is compiled successfully however, while linking these projects, compiler is compaining that it cannot find nafxcwd.pdb
file in $(OUTDIR)
folder (the output folder where C++ static library is created). 一切正常,解决方案已成功编译,但是,在链接这些项目时,编译器抱怨它无法在$(OUTDIR)
文件夹(创建C ++静态库的输出文件夹$(OUTDIR)
找到nafxcwd.pdb
文件。 To work around this issue, I had to copy nafxcwd.pdb
from Visual Studio folder into my output folder, which is not a practical option since this very specific instruction should be shared with every other programmer in my group. 要变通解决此问题,我必须将nafxcwd.pdb
从Visual Studio文件夹复制到我的输出文件夹中,这是不切实际的选择,因为该非常具体的指令应该与我组中的所有其他程序员共享。 I have tried different options related to creating pdb file (ie /Zi, /Z7, and ZI) but none of them seems to be working. 我尝试了与创建pdb文件相关的其他选项(例如/ Zi,/ Z7和ZI),但似乎都没有用。
2>XMLParser.lib(dumpcont.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(dumpflt.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(arccore.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(arcobj.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(arcex.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(arcstrm.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(dumpinit.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(dumpout.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(afxasert.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(afxmem.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(filecore.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(filetxt.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(filex.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(filest.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
2>XMLParser.lib(array_b.obj) : warning LNK4099: PDB 'nafxcwd.pdb' was not found with 'd:\Debug\XMLParser.lib' or at 'D:\Debug\nafxcwd.pdb'; linking object as if no debug info
I appreciate if you could help me with the following questions: 如果您能帮助我解决以下问题,我们将不胜感激:
nafxcwd.pdb
in output folder instead of VS folder? 为什么Visual Studio在输出文件夹而不是VS文件夹中寻找nafxcwd.pdb
? nafxcwd.pdb
into XMLParser.obj
file to ensure that linker will always find it? 有什么方法可以将nafxcwd.pdb
嵌入XMLParser.obj
文件中,以确保链接器始终可以找到它? Any help is appreciated. 任何帮助表示赞赏。
I figured out the answer to this problem. 我想出了这个问题的答案。 In the Fortran project, I added nafxcwd.lib libcmtd.lib
to additional project dependencies, and added the same libraries to ignore list. 在Fortran项目中,我将nafxcwd.lib libcmtd.lib
添加到其他项目依赖项中,并添加了相同的库以忽略列表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.