Link Problems
-
I have a project that was originally built in Visual Studio C++ 6.0. I have since upgraded to Visual Studio .NET and am encountering a link problem. The project is a (non-ATL generated)COM server that also employs templates that is built across 2 projects. The base class("PluginServ") implements the DllCanUnloadNow, DllGetClassObject, DllRegisterServer, and DllUnregisterServer. The .def file is in the aggregated class ("DerivedPlugin") project and declares the above exports. The link error is the following: ------ Build started: Project: DerivedPlugInServ, Configuration: Debug Win32 ------ Linking... LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification DerivedPlugInServ.def : error LNK2001: unresolved external symbol DllRegisterServer DerivedPlugInServ.def : error LNK2001: unresolved external symbol DllUnregisterServer .\Debug/VPF.lib : fatal error LNK1120: 2 unresolved externals LINK : fatal error LNK1141: failure during build of exports file Build log was saved at "file://c:\projects\src\DerivedPlugInServ\Debug\BuildLog.htm" DerivedPlugInServ- 4 error(s), 1 warning(s) ---------------------- Done ---------------------- Build: 0 succeeded, 1 failed, 0 skipped" Anyone have any ideas as to how I may resolve this link error? I have looked online and have not come across a solution. Thank you!
-
I have a project that was originally built in Visual Studio C++ 6.0. I have since upgraded to Visual Studio .NET and am encountering a link problem. The project is a (non-ATL generated)COM server that also employs templates that is built across 2 projects. The base class("PluginServ") implements the DllCanUnloadNow, DllGetClassObject, DllRegisterServer, and DllUnregisterServer. The .def file is in the aggregated class ("DerivedPlugin") project and declares the above exports. The link error is the following: ------ Build started: Project: DerivedPlugInServ, Configuration: Debug Win32 ------ Linking... LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification DerivedPlugInServ.def : error LNK2001: unresolved external symbol DllRegisterServer DerivedPlugInServ.def : error LNK2001: unresolved external symbol DllUnregisterServer .\Debug/VPF.lib : fatal error LNK1120: 2 unresolved externals LINK : fatal error LNK1141: failure during build of exports file Build log was saved at "file://c:\projects\src\DerivedPlugInServ\Debug\BuildLog.htm" DerivedPlugInServ- 4 error(s), 1 warning(s) ---------------------- Done ---------------------- Build: 0 succeeded, 1 failed, 0 skipped" Anyone have any ideas as to how I may resolve this link error? I have looked online and have not come across a solution. Thank you!
Jnewg5 wrote: The base class("PluginServ") implements the DllCanUnloadNow, DllGetClassObject, DllRegisterServer, and DllUnregisterServer. So your definition of
DllRegisterServer
isPluginServ::DllRegisterServer
, ie. it resides inside a class? These functions must be global, ie. not in a class, and they must be defined as__declspec(dllexport)
. Other than that, you'll have to give a bit more information.Ryan
"Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"