__argv
, __argc
, __mbctype
__argv
, __argc
, __mbctype
When I then compile the program it links with the multi threaded libraries but I get the following errrors:
nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc nafxcw.lib(filelist.obj) : error LNK2001: unresolved external symbol __mbctype
The solution: When you use the multithreaded dll's in visual c++.NET, you need to specify that you are using MFC in a shared dll. This is specified in the project settings.
A user provided the following instructions for building with VS .NET (thank you!): A Console Application (at the prompt)
Go to Tools - Options and select Project Go to C/C++ directories and select Show directories for - include : there they need to add the/include In the same drop down box they select Show directories for -lib: there they need to add the /lib After that they need to go to Project - Properties First change the configuration from "Debug" to "Release" using the "Configuration Manager" Then select: "Linker - Inputs". At the line "Additional dependencies" they need to click and add the following lines: /hd415.lib /hm415.lib ws2_32.lib That is all for the single threaded libs. If they want to use the lib, they should include at the top of the source file #include "mfhdf".lib" and never "hdf.lib"
Go to Tools - Options and select Project Go to C/C++ directories and select Show directories for - include : there they need to add the/include In the same drop down box they select Show directories for -lib: there they need to add the /lib After that they need to go to Project - Properties There first go the Project - General and change "Use of MFC" to "Use MFC in a shared DLL" Change the configuration from "Debug" to "Release" using the Configuration Manager Then go to C/C++ - Code generaton and change "Runtime library" to "Multithreaded DLL" (is by default Multithreaded) Then go to Linker inputs and at the line "Additional dependencies" they need to click and add the following lines: /hd415m.lib /hm415m.lib ws2_32.lib Furthermore, the dll files should be copied to c:\windows\system Then just include the header-file in the source file and everything should work.