Archive: Error compiling RegTool


Error compiling RegTool
When i'm trying to compile nsis with VC2005express i got an error:

cl /nologo /O1 /W3 /c Contrib\Library\RegTool\RegTool.c /Fobuild\release\Library
\RegTool\RegTool.obj
RegTool.c
cl /nologo /O1 /W3 /c SCons\Config\memset.c /Fobuild\release\Library\RegTool\PRO
GEMITTER.obj
memset.c
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\bin\Win64\li
nk.exe" /nologo /opt:nowin98 /map /entry:WinMain /NODEFAULTLIB /OUT:build\releas
e\Library\RegTool\RegTool\RegTool.bin kernel32.lib oleaut32.lib advapi32.lib use
r32.lib ole32.lib build\release\Library\RegTool\RegTool.obj build\release\Librar
y\RegTool\PROGEMITTER.obj
RegTool.obj : error LNK2019: unresolved external symbol ___security_cookie refer
enced in function _RunSelf
RegTool.obj : error LNK2019: unresolved external symbol @__security_check_cookie
@4 referenced in function _RunSelf
build\release\Library\RegTool\RegTool\RegTool.bin : fatal error LNK1120: 2 unres
olved externals
scons: *** [build\release\Library\RegTool\RegTool\RegTool.bin] Error 1120
scons: building terminated because of errors.
D:\Scripts NSIS\NSIS-20070420>
If i compile with VC Toolkit 2003 i dont get the error...

hope it helps

Somehow it doesn't know it's working with VC2005. Either MSVS_VERSION isn't set correctly due to some SCons issue or you're using an old version of NSIS.


I'm using the latest cvs files...
and scons 0.96.93


Try scons 0.96.96.


YES!!! With the 0.96.96 version of scons it works, the only problem that remainsis the NSIS Menu Compilation that doesn't work with VC2003 and VC2005, here is the log:

cl /nologo /O1 /W3 /MD /GX /TP "/Ibuild\release\NSIS Menu" "/IContrib\NSIS Menu"
/IC:\wxWidgets-2.8.0\include /IC:\wxWidgets-2.8.0\lib\vc_libnsis\msw /c "Contri
b\NSIS Menu\nsismenu\nsismenu.cpp" "/Fobuild\release\NSIS Menu\nsismenu\nsismenu
.obj"
nsismenu.cpp
cl /nologo /O1 /W3 /MD /GX /TP "/Ibuild\release\NSIS Menu" "/IContrib\NSIS Menu"
/IC:\wxWidgets-2.8.0\include /IC:\wxWidgets-2.8.0\lib\vc_libnsis\msw /c "Contri
b\NSIS Menu\nsismenu\nslinks.cpp" "/Fobuild\release\NSIS Menu\nsismenu\nslinks.o
bj"
nslinks.cpp
rc "/Ibuild\release\NSIS Menu" "/IContrib\NSIS Menu" /IC:\wxWidgets-2.8.0\includ
e /IC:\wxWidgets-2.8.0\lib\vc_libnsis\msw "/fobuild\release\NSIS Menu\nsismenu-r
c.res" "Contrib\NSIS Menu\nsismenu\nsismenu.rc"
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\bin\Win64\li
nk.exe" /nologo /opt:nowin98 /map "/OUT:build\release\NSIS Menu\NSIS.exe" "/LIBP
ATH:build\release\NSIS Menu" "/LIBPATH:Contrib\NSIS Menu" /LIBPATH:C:\wxWidgets-
2.8.0\lib\vc_libnsis advapi32.lib comctl32.lib gdi32.lib shell32.lib user32.lib
wxbase28.lib wxmsw28_core.lib wxmsw28_html.lib "build\release\NSIS Menu\nsismenu
\nsismenu.obj" "build\release\NSIS Menu\nsismenu\nslinks.obj" "build\release\NSI
S Menu\nsismenu-rc.res"
wxbase28.lib(baselib_object.obj) : warning LNK4078: multiple '.CRT' sections fou
nd with different attributes (40300040)
nsismenu.obj : error LNK2001: unresolved external symbol "public: __thiscall exc
eption::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z)
nslinks.obj : error LNK2001: unresolved external symbol "public: __thiscall exce
ption::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z)
nsismenu.obj : error LNK2001: unresolved external symbol "public: __thiscall bad
_cast::bad_cast(class bad_cast const &)" (??0bad_cast@@QAE@ABV0@@Z)
nslinks.obj : error LNK2001: unresolved external symbol "public: __thiscall bad_
cast::bad_cast(class bad_cast const &)" (??0bad_cast@@QAE@ABV0@@Z)
nsismenu.obj : error LNK2001: unresolved external symbol "public: virtual __this
call bad_cast::~bad_cast(void)" (??1bad_cast@@UAE@XZ)
nslinks.obj : error LNK2001: unresolved external symbol "public: virtual __thisc
all bad_cast::~bad_cast(void)" (??1bad_cast@@UAE@XZ)
nsismenu.obj : error LNK2019: unresolved external symbol "__declspec(dllimport)
public: __thiscall bad_cast::bad_cast(char const *)" (__imp_??0bad_cast@@QAE@PBD
@Z) referenced in function "class std::ctype<char> const & __cdecl std::use_face
t<class std::ctype<char> >(class std::locale const &)" (??$use_facet@V?$ctype@D@
std@@@std@@YAABV?$ctype@D@0@ABVlocale@0@@Z)
nslinks.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) p
ublic: __thiscall bad_cast::bad_cast(char const *)" (__imp_??0bad_cast@@QAE@PBD@
Z)
build\release\NSIS Menu\NSIS.exe : fatal error LNK1120: 4 unresolved externals
scons: *** [build\release\NSIS Menu\NSIS.exe] Error 1120
scons: building terminated because of errors.
Thank you for your help

Use the same compiler to build both NSIS Menu and wxWidgets. Rerun Contrib\NSIS Menu\wx\wxbuild.bat with the same compiler you're now using for NSIS Menu.


That's what i've done, but the error still occurs...


Make sure you clean wxWidget's build directories before you rebuild.


I completly reinstalled wxwidgets, but the error still occurs, i also found another problem, when you try to use the dist-installer parameter with scons, the installer isn't compiled because the exdll plugin cannot be copied in the examples directory...


Try removing '$EXCEPTION_FLAG' from the call to BuildUtil in Contrib\NSIS Menu\SConscript.

You should also upgrade to wxWidgets 2.8.3, though that shouldn't affect the build.


I tried to remove the exception_flag, but i still get errors:

C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xlocnum
(1296) : see reference to class template instantiation 'std::numpunct<_Elem>' be
ing compiled
with
[
_Elem=wchar_t
]
cl /nologo /O1 /W3 /MD /TP "/Ibuild\release\NSIS Menu" "/IContrib\NSIS Menu" /IC
:\wxWidgets-2.8.0\include /IC:\wxWidgets-2.8.0\lib\vc_libnsis\msw /c "Contrib\NS
IS Menu\nsismenu\nslinks.cpp" "/Fobuild\release\NSIS Menu\nsismenu\nslinks.obj"
nslinks.cpp
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\ostream(574) :
warning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\istream(828) :
warning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\istream(1064) :
warning C4530: C++ exception handler used, but unwind semantics are not enabled
. Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\ostream(479) :
warning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\ostream
(471) : while compiling class-template member function 'std::basic_ostream<_Elem
,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::put(_Elem)'
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\ostream
(561) : see reference to class template instantiation 'std::basic_ostream<_Elem,
_Traits>' being compiled
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\ostream(479) :
warning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\ostream
(471) : while compiling class-template member function 'std::basic_ostream<_Elem
,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::put(_Elem)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\ostream
(603) : see reference to class template instantiation 'std::basic_ostream<_Elem,
_Traits>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\istream(99) : w
arning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\istream
(89) : while compiling class-template member function 'bool std::basic_istream<_
Elem,_Traits>::_Ipfx(bool)'
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\istream
(816) : see reference to class template instantiation 'std::basic_istream<_Elem,
_Traits>' being compiled
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\istream(99) : w
arning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\istream
(89) : while compiling class-template member function 'bool std::basic_istream<_
Elem,_Traits>::_Ipfx(bool)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\istream
(844) : see reference to class template instantiation 'std::basic_istream<_Elem,
_Traits>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xstring(1453) :
warning C4530: C++ exception handler used, but unwind semantics are not enabled
. Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xstring
(1444) : while compiling class-template member function 'void std::basic_string<
_Elem,_Traits,_Ax>::_Copy(std::basic_string<_Elem,_Traits,_Ax>::size_type,std::b
asic_string<_Elem,_Traits,_Ax>::size_type)'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xstring
(1569) : see reference to class template instantiation 'std::basic_string<_Elem,
_Traits,_Ax>' being compiled
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xstring(1453) :
warning C4530: C++ exception handler used, but unwind semantics are not enabled
. Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xstring
(1444) : while compiling class-template member function 'void std::basic_string<
_Elem,_Traits,_Ax>::_Copy(std::basic_string<_Elem,_Traits,_Ax>::size_type,std::b
asic_string<_Elem,_Traits,_Ax>::size_type)'
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>,
_Ax=std::allocator<wchar_t>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xstring
(1571) : see reference to class template instantiation 'std::basic_string<_Elem,
_Traits,_Ax>' being compiled
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>,
_Ax=std::allocator<wchar_t>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(440) : w
arning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(
592) : see reference to function template instantiation 'std::basic_istream<_Ele
m,_Traits> &std::operator >><char,std::char_traits<char>,std::allocator<_Ty>>(st
d::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Ax> &)' being
compiled
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ty=char,
_Ax=std::allocator<char>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(485) : w
arning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(
601) : see reference to function template instantiation 'std::basic_istream<_Ele
m,_Traits> &std::getline<char,std::char_traits<char>,std::allocator<_Ty>>(std::b
asic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Ax> &,const char)
' being compiled
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ty=char,
_Ax=std::allocator<char>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(553) : w
arning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(
605) : see reference to function template instantiation 'std::basic_ostream<_Ele
m,_Traits> &std::operator <<<char,std::char_traits<char>,std::allocator<_Ty>>(st
d::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_Ax> &)'
being compiled
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ty=char,
_Ax=std::allocator<char>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(440) : w
arning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(
610) : see reference to function template instantiation 'std::basic_istream<_Ele
m,_Traits> &std::operator >><wchar_t,std::char_traits<wchar_t>,std::allocator<_T
y>>(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Ax> &)'
being compiled
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>,
_Ty=wchar_t,
_Ax=std::allocator<wchar_t>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(485) : w
arning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(
619) : see reference to function template instantiation 'std::basic_istream<_Ele
m,_Traits> &std::getline<wchar_t,std::char_traits<wchar_t>,std::allocator<_Ty>>(
std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Ax> &,const
wchar_t)' being compiled
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>,
_Ty=wchar_t,
_Ax=std::allocator<wchar_t>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(553) : w
arning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\string(
624) : see reference to function template instantiation 'std::basic_ostream<_Ele
m,_Traits> &std::operator <<<wchar_t,std::char_traits<wchar_t>,std::allocator<_T
y>>(std::basic_ostream<_Elem,_Traits> &,const std::basic_string<_Elem,_Traits,_A
x> &)' being compiled
with
[
_Elem=wchar_t,
_Traits=std::char_traits<wchar_t>,
_Ty=wchar_t,
_Ax=std::allocator<wchar_t>
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xlocnum(96) : w
arning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xlocnum
(89) : while compiling class-template member function 'void std::numpunct<_Elem>
::_Init(const std::_Locinfo &)'
with
[
_Elem=char
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xlocnum
(1290) : see reference to class template instantiation 'std::numpunct<_Elem>' be
ing compiled
with
[
_Elem=char
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xlocnum(96) : w
arning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xlocnum
(89) : while compiling class-template member function 'void std::numpunct<_Elem>
::_Init(const std::_Locinfo &)'
with
[
_Elem=wchar_t
]
C:\Program Files (x86)\Microsoft Visual C++ Toolkit 2003\include\xlocnum
(1296) : see reference to class template instantiation 'std::numpunct<_Elem>' be
ing compiled
with
[
_Elem=wchar_t
]
rc "/Ibuild\release\NSIS Menu" "/IContrib\NSIS Menu" /IC:\wxWidgets-2.8.0\includ
e /IC:\wxWidgets-2.8.0\lib\vc_libnsis\msw "/fobuild\release\NSIS Menu\nsismenu-r
c.res" "Contrib\NSIS Menu\nsismenu\nsismenu.rc"
"C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\bin\Win64\li
nk.exe" /nologo /opt:nowin98 /map "/OUT:build\release\NSIS Menu\NSIS.exe" "/LIBP
ATH:build\release\NSIS Menu" "/LIBPATH:Contrib\NSIS Menu" /LIBPATH:C:\wxWidgets-
2.8.0\lib\vc_libnsis advapi32.lib comctl32.lib gdi32.lib shell32.lib user32.lib
wxbase28.lib wxmsw28_core.lib wxmsw28_html.lib "build\release\NSIS Menu\nsismenu
\nsismenu.obj" "build\release\NSIS Menu\nsismenu\nslinks.obj" "build\release\NSI
S Menu\nsismenu-rc.res"
wxbase28.lib(baselib_object.obj) : warning LNK4078: multiple '.CRT' sections fou
nd with different attributes (40300040)
nsismenu.obj : error LNK2001: unresolved external symbol "public: __thiscall exc
eption::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z)
nslinks.obj : error LNK2001: unresolved external symbol "public: __thiscall exce
ption::exception(class exception const &)" (??0exception@@QAE@ABV0@@Z)
nsismenu.obj : error LNK2001: unresolved external symbol "public: __thiscall bad
_cast::bad_cast(class bad_cast const &)" (??0bad_cast@@QAE@ABV0@@Z)
nslinks.obj : error LNK2001: unresolved external symbol "public: __thiscall bad_
cast::bad_cast(class bad_cast const &)" (??0bad_cast@@QAE@ABV0@@Z)
nsismenu.obj : error LNK2001: unresolved external symbol "public: virtual __this
call bad_cast::~bad_cast(void)" (??1bad_cast@@UAE@XZ)
nslinks.obj : error LNK2001: unresolved external symbol "public: virtual __thisc
all bad_cast::~bad_cast(void)" (??1bad_cast@@UAE@XZ)
nsismenu.obj : error LNK2019: unresolved external symbol "__declspec(dllimport)
public: __thiscall bad_cast::bad_cast(char const *)" (__imp_??0bad_cast@@QAE@PBD
@Z) referenced in function "class std::ctype<char> const & __cdecl std::use_face
t<class std::ctype<char> >(class std::locale const &)" (??$use_facet@V?$ctype@D@
std@@@std@@YAABV?$ctype@D@0@ABVlocale@0@@Z)
nslinks.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) p
ublic: __thiscall bad_cast::bad_cast(char const *)" (__imp_??0bad_cast@@QAE@PBD@
Z)
build\release\NSIS Menu\NSIS.exe : fatal error LNK1120: 4 unresolved externals
scons: *** [build\release\NSIS Menu\NSIS.exe] Error 1120
scons: building terminated because of errors.
D:\Scripts NSIS\NSIS-20070421>

Right, so that didn't help.

In wxbuild.bat, change SHARED=0 to SHARED=1 and tell what's the link line for the final DLL.

Please attach large logs next time.


I tried to uninstall VC2005 and reinstalled VC20003, i get a new error message:

LINK : fatal error LNK1104: cannot open file 'msvcprt.lib'
scons: *** [build\release\NSIS Menu\NSIS.exe] Error 1104
scons: building terminated because of errors.
D:\Scripts NSIS\NSIS-20070421>

Try deleting .sconsign.dblite and .sconf_temp. It might have some cached configuration options about the infamous msvcprt.lib. That might explain the earlier errors as well as that lib should have the exceptions code.


i did it and got the same result


Then you're probably really missing msvcprt.lib. Make sure it exists.


i ve copied msvcprt.lib and msvcrt.lib to thelib folder of my toolkit and it works fine now...

Thanks for your help