[Selfext-user] Release version linker problem with VS .NET
Brought to you by:
mweth
|
From: David A. <Da...@Sp...> - 2003-06-15 19:53:06
|
Dear List:
I am a VB6 programmer using SelfExt to package install programs. I need to
make a small customization to SelfExt which I believe I can stumble my way
through on. However, using VS .NET (I don't have VS6 C++, just VB6), the
totally unmodified source build gives the following Linker errors which I
am unable to get past. The LNK2019 message talks about:
For C++ projects from previous releases that were upgraded to the current
version, if __UNICODE was defined and the entry point was WinMain, you need
to change the name for the entry point function to either _tWinMain or _tmain
I suspect my solution lies in this area, but I am unable to determine the
needed modifications. Can anyone help?
Linker error messages:
ExtCab.obj : error LNK2019: unresolved external symbol ___security_cookie
referenced in function "int __cdecl chiclero::Extract(char const *,int,char
const *,char *,struct HWND__ *,unsigned int)"
(?Extract@chiclero@@YAHPBDH0PADPAUHWND__@@I@Z)
SelfExt.obj : error LNK2019: unresolved external symbol ___security_cookie
referenced in function _WinMain@16
Worker.obj : error LNK2001: unresolved external symbol ___security_cookie
ExtCab.obj : error LNK2019: unresolved external symbol
@__security_check_cookie@4 referenced in function "int __cdecl
chiclero::Extract(char const *,int,char const *,char *,struct HWND__
*,unsigned int)" (?Extract@chiclero@@YAHPBDH0PADPAUHWND__@@I@Z)
SelfExt.obj : error LNK2019: unresolved external symbol
@__security_check_cookie@4 referenced in function _WinMain@16
Worker.obj : error LNK2001: unresolved external symbol
@__security_check_cookie@4
.\Release/SelfExt.exe : fatal error LNK1120: 2 unresolved externals
From selfext.cpp area of probable problem:
//////////////////////////////////////////////////////////////////////
// Replacement startup code, so that it is not necessary to link with
// the run-time library
extern "C" void __cdecl WinMainCRTStartup(void) {
ExitProcess(WinMain(GetModuleHandle(NULL), NULL, "", SW_SHOWDEFAULT));
}
#ifdef _MSC_VER // MS linker complains without this
extern "C" void __cdecl main(void) { }
#endif
namespace std {
extern "C" void * __cdecl memset(void *s, int c, size_t n) {
for (size_t i = 0; i < n; i++)
((char*)s)[i] = c;
return s;
}
}
//////////////////////////////////////////////////////////////////////
// WinMain
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE /*hPrevInstance*/,
LPSTR /*lpCmdLine*/,
int /*nCmdShow*/ )
{
Much thanks for any insights, David Austin
|