I am working in a mixed Fortran-C++ programming environment. The C++ project is a static library ( XMLParser.lib
) used to read and write into XML files. It is added as an additional dependency to Fortran project, which is a DLL library ( engine.dll
) used to perform mathematical computations. The Fortran uses CRT ( LIBCMTD
) and C++ is using MFC libraries. As described in Here , this can cause linker error if LIBCMTD
and NAFXCWD
libraries are not linked in the correct order. To avoid this issue I had to add nafxcwd.lib
as an additional dependency to C++ project.
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). 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. I have tried different options related to creating pdb file (ie /Zi, /Z7, and ZI) but none of them seems to be working.
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? nafxcwd.pdb
into XMLParser.obj
file to ensure that linker will always find it? 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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.