Stdafx. h In vss_map contains:
# Include <windows. h>
// Todo: reference it hereProgramOther header files
# Include "ivss_mapdefinition.h"
# Include "ivss_corelibrary.h"
# Pragma comment (Lib, "vss_core.lib ")
# Include "ivss_geolibrary.h"
# Pragma comment (Lib, "vss_geo.lib ")
# Include "ivss_wslibrary.h"
# Pragma comment (Lib, "vss_ws.lib ")
# Include "ivss_symbollibrary.h"
# Pragma comment (Lib, "vss_symbol.lib ")
/// // Add
# Include "ivss_cartracklibrary.h"
# Pragma comment (Lib, "vss_cartrack.lib ")
Error message:
> E: \ latest track modification \ trunk \ VSS \ Inc \ ctrackview. H (17): Error c2061: syntax error: identifier "CDC"
1> E: \ latest track modification \ trunk \ VSS \ Inc \ ctrackview. H (19): Error c2061: syntax error: identifier "CDC"
1> E: \ latest track modification \ trunk \ VSS \ Inc \ ctrackview. H (21): Error c4430: Missing type specifier-assumed to be Int. Note: C ++ does not support default int
1> E: \ latest track modification \ trunk \ VSS \ Inc \ ctrackview. H (21): Error c2143: syntax error: ";" missing (before)
1> E: \ latest track modification \ trunk \ VSS \ Inc \ ctrackview. H (21): Error c4430: Missing type specifier-assumed to be Int. Note: C ++ does not support default int
Later I learned that it was the # include <windows. h> issue. Because the project is not an MFC project and does not recognize CDC, I need to replace it with # include <afxwin. h>.
Okay. The problem arises again after the replacement:
> Mfcs80d. Lib (dllmodul. OBJ): Error lnk2005: _ dllmain @ 12 already defined in vss_map.obj
1> creating Library E: \ latest track modification \ trunk \ VSS \ debug \ vss_map.lib and Object E: \ latest track modification \ trunk \ VSS \ debug \ vss_map.exp
1> E: \ latest track modification \ trunk \ VSS \ debug \ vss_map.dll: Fatal error lnk1169: locate one or more symbols with multiple definitions
It turns out that this is because both ATL and MFC have main (). So we need to comment out all of ATL ~
// Vss_map.cpp: defines the DLL application entry point.
//
# Include "stdafx. H"
// # Ifdef _ managed
// # Pragma managed (push, off)
// # Endif
//
//
// Bool apientry dllmain (hmodule,
// DWORD ul_reason_for_call,
// Lpvoid lpreserved
//)
//{
// Return true;
//}
//
// # Ifdef _ managed
// # Pragma managed (POP)
// # Endif
Solution Source:
When I wrote a component, I didn't consider the support for MFC at the beginning. Later, I needed to support dialog box settings and added the support for MFC. Compilation failed,
1> audiovista. OBJ:Error Lnk2005:_ Dllmain @ 12 AlreadyIn mfcs80ud. Lib (dllmodul. OBJ)MediumDefinition
1> debug \ audiovista. dll: fatalErrorLnk1169: locate one or moreDefinitionSymbol
This prompt appears, according to the author's conjecture, In the MFC LibraryMediumAlreadyDefinitionThe default processing function dllmain is removed from the dllmain generated by ATL.
Set this sectionCodeAfter removing it, you can save the trouble of rebuilding the project and adding files.
// # Ifdef _ managed
// # Pragma managed (push, off)
// # Endif
//
///// DLL entry point
// Extern "C" bool winapi dllmain (hinstance, DWORD dwreason, lpvoid lpreserved)
//{
// Hinstance;
// Return _ atlmodule. dllmain (dwreason, lpreserved );
//}
//
// # Ifdef _ managed
// # Pragma managed (POP)
// # Endif
//
Http: // 203.208.35.101/search? Q = cache: wh34kmijlmuj: cached