Archive: scons errors


scons errors
For the last 10 days I have not been able to compile NSIS source.
I get the following warnings while compiling the source files:
cl : Command line warning D4002 : ignoring unknown option '/G-'

and the following error while linking the exe:
Ui.obj : error LNK2019: unresolved external symbol ___security_cookie referenced in function _outernotify@4
util.obj : error LNK2001: unresolved external symbol ___security_cookie
decompress.obj : error LNK2019: unresolved external symbol ___security_cookie referenced in function _BZ2_decompress@4
bgbg.obj : error LNK2019: unresolved external symbol ___security_cookie referenced in function _BG_WndProc@16
exec.obj : error LNK2001: unresolved external symbol ___security_cookie
fileform.obj : error LNK2019: unresolved external symbol ___security_cookie referenced in function _verProc@16
Main.obj : error LNK2001: unresolved external symbol ___security_cookie
Ui.obj : error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function _DialogProc@16
util.obj : error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function _myCreateProcess@8
decompress.obj : error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function _BZ2_decompress@4
bgbg.obj : error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function _BG_WndProc@16
exec.obj : error LNK2001: unresolved external symbol @__security_check_cookie@4
fileform.obj : error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function _verProc@16
Main.obj : error LNK2001: unresolved external symbol @__security_check_cookie@4
build\release\stub_bzip2\stub_bzip2.exe : fatal error LNK1120: 2 unresolved externals
scons: *** [build\release\stub_bzip2\stub_bzip2.exe] Error 1120
scons: building terminated because of errors.


I am using the Microsoft Visual C++ Toolkit 2003 and the Microsoft SDK from Feb 2003.
This combination worked fine until about 10 days ago.
So what changed?


OK, upgrading to the latest SDK (Server 2003 R2) did not help.
Upgrading to Visual Studio 2005 Express resulted in a whole bunch of deprecated code warnings, as well as new unresolved externals:
build.obj : error LNK2019: unresolved external symbol __imp__SendMessageA@16 referenced in function "public: void __thiscall CEXEBuild::notify(enum notify_e,char const *)const " (?notify@CEXEBuild@@QBEXW4notify_e@@PBD@Z)
DialogTemplate.obj : error LNK2001: unresolved external symbol __imp__SendMessageA@16
build.obj : error LNK2019: unresolved external symbol __imp__CharNextExA@12 referenced in function "private: int __thiscall CEXEBuild::preprocess_string(char *,char const *,unsigned short)" (?preprocess_string@CEXEBuild@@AAEHPADPBDG@Z)
build.obj : error LNK2019: unresolved external symbol __imp__wsprintfA referenced in function "private: int __thiscall CEXEBuild::add_intstring(int)" (?add_intstring@CEXEBuild@@AAEHH@Z)
script.obj : error LNK2001: unresolved external symbol __imp__wsprintfA
DialogTemplate.obj : error LNK2019: unresolved external symbol __imp__CreateDialogIndirectParamA@20 referenced in function "public: struct HWND__ * __thiscall CDialogTemplate::CreateDummyDialog(void)" (?CreateDummyDialog@CDialogTemplate@@QAEPAUHWND__@@XZ)
DialogTemplate.obj : error LNK2019: unresolved external symbol __imp__DestroyWindow@4 referenced in function "public: void __thiscall CDialogTemplate::PixelsToDlgUnits(short &,short &)" (?PixelsToDlgUnits@CDialogTemplate@@QAEXAAF0@Z)
DialogTemplate.obj : error LNK2019: unresolved external symbol __imp__MapDialogRect@8 referenced in function "public: void __thiscall CDialogTemplate::PixelsToDlgUnits(short &,short &)" (?PixelsToDlgUnits@CDialogTemplate@@QAEXAAF0@Z)
DialogTemplate.obj : error LNK2019: unresolved external symbol __imp__DeleteDC@4 referenced in function "public: struct tagSIZE __thiscall CDialogTemplate::GetStringSize(unsigned short,char *)" (?GetStringSize@CDialogTemplate@@QAE?AUtagSIZE@@GPAD@Z)
DialogTemplate.obj : error LNK2019: unresolved external symbol __imp__DeleteObject@4 referenced in function "public: struct tagSIZE __thiscall CDialogTemplate::GetStringSize(unsigned short,char *)" (?GetStringSize@CDialogTemplate@@QAE?AUtagSIZE@@GPAD@Z)
DialogTemplate.obj : error LNK2019: unresolved external symbol __imp__GetTextExtentPoint32A@16 referenced in function "public: struct tagSIZE __thiscall CDialogTemplate::GetStringSize(unsigned short,char *)" (?GetStringSize@CDialogTemplate@@QAE?AUtagSIZE@@GPAD@Z)
DialogTemplate.obj : error LNK2019: unresolved external symbol __imp__SelectObject@8 referenced in function "public: struct tagSIZE __thiscall CDialogTemplate::GetStringSize(unsigned short,char *)" (?GetStringSize@CDialogTemplate@@QAE?AUtagSIZE@@GPAD@Z)
DialogTemplate.obj : error LNK2019: unresolved external symbol __imp__CreateFontIndirectA@4 referenced in function "public: struct tagSIZE __thiscall CDialogTemplate::GetStringSize(unsigned short,char *)" (?GetStringSize@CDialogTemplate@@QAE?AUtagSIZE@@GPAD@Z)
DialogTemplate.obj : error LNK2019: unresolved external symbol __imp__CreateCompatibleDC@4 referenced in function "public: struct tagSIZE __thiscall CDialogTemplate::GetStringSize(unsigned short,char *)" (?GetStringSize@CDialogTemplate@@QAE?AUtagSIZE@@GPAD@Z)
DialogTemplate.obj : error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "public: struct tagSIZE __thiscall CDialogTemplate::GetStringSize(unsigned short,char *)" (?GetStringSize@CDialogTemplate@@QAE?AUtagSIZE@@GPAD@Z)
DialogTemplate.obj : error LNK2019: unresolved external symbol __imp__GetObjectA@12 referenced in function "public: struct tagSIZE __thiscall CDialogTemplate::GetStringSize(unsigned short,char *)" (?GetStringSize@CDialogTemplate@@QAE?AUtagSIZE@@GPAD@Z)
makenssi.obj : error LNK2019: unresolved external symbol __imp__IsWindow@4 referenced in function _main
script.obj : error LNK2019: unresolved external symbol __imp__CharNextA@4 referenced in function "private: void __thiscall CEXEBuild::ps_addtoline(char const *,class GrowBuf &,class StringList &)" (?ps_addtoline@CEXEBuild@@AAEXPBDAAVGrowBuf@@AAVStringList@@@Z)
script.obj : error LNK2019: unresolved external symbol __imp__CharPrevA@8 referenced in function "private: int __thiscall CEXEBuild::doParse(char const *)" (?doParse@CEXEBuild@@AAEHPBD@Z)
build\release\makensis\makensis.exe : fatal error LNK1120: 17 unresolved externals


Is there a known working combination of SDK & compiler that can be used to successfully compile the code?
What does the official release process use?


Looks like its not linking to user32.lib

The official setup used to be MSVC6 SP5+ProcessorPack, not sure if it has changed


The official setup is indeed MSVC6 SP5 + Processor Pack. However, the nightly builds are running with Microsoft Visual C++ Toolkit 2003 and the Platform SDK of February 2003, and that still works. In the latest versions, the express edition of MSVC 2005 should also work.

I'll take a look.


The first problem with the unknown option and the security cookie warnings was probably caused by a 2005 false positive which was in the code before 2.22 was released. The second seems like a problem with stale object files. The scons build code between 2.21 and 2.22 wasn't too stable, so it might have caused a little mess in the build directory. I think a clean build should work. Have you tried deleting .sconf_temp, .sconsign.dblite and build?


I also have a compile problem, i can compile with MSVC2005+platform SP1 but i cant if iuse MSVC2005+platform R2...

I got an error "Windows.h not found"


Originally posted by kichik
The first problem with the unknown option and the security cookie warnings was probably caused by a 2005 false positive which was in the code before 2.22 was released. The second seems like a problem with stale object files. The scons build code between 2.21 and 2.22 wasn't too stable, so it might have caused a little mess in the build directory. I think a clean build should work. Have you tried deleting .sconf_temp, .sconsign.dblite and build?
Yes, I tried a clean build, and still get the errors.
I currently have scons 0.96.93, Visual C++ Toolkit 2003 and Platform SDK Feb 2003 installed.
This is my build script:

set MSSDK=C:\Program Files\Microsoft SDK
set VCToolkitInstallDir=C:\Program Files\Microsoft Visual C++ Toolkit 2003
path %path%;c:\python;c:\Program Files\HTML Help Workshop
call scons MSTOOLKIT=yes
if exist build\release\Docs\chm (
pushd build\release\Docs\chm
if exist style.css attrib -r -s -h -a style.css
if exist chmlink.js attrib -r -s -h -a chmlink.js
if exist nsis.hhp attrib -r -s -h -a nsis.hhp
popd
)
if exist build\release\Docs\html (
pushd build\release\Docs\html
if exist style.css attrib -r -s -h -a style.css
popd
)
call scons MSTOOLKIT=yes PREFIX="C:\Program Files\NSIS" install

My build log is attached.

I also have VS6 SP6 (processor pack is not available for SP6) and .Net Framework SDK 1.1/2.0 installed.
Would this make a difference?


Do you also have a newer version of VS installed? mstoolkit.py didn't set MSVS_VERSION, but something else set it to a value that confused the ms configuration file.

Put the attached mstoolkit.py file in SCons\Tools, see if it works and let me know what it prints as the old MSVS_VERSION value.


Yes, that did the trick.
It was reporting MSVS_VERSION=8.0
I tracked the problem down to scons picking the highest MSVS version number it finds in HKLM\Software\Microsoft\Visual Studio and HKLM\Software\Microsoft\VCExpress, regardless of whether it is still installed or not.
This should be a bug, because HKLM retains these registry settings even after the particular version of MSVS is uninstalled. scons should check the installation path to verify that the MSVS installation still exists.
The build works after removing references to 8.0 from HKLM\Software\Microsoft\Visual Studio and HKLM\Software\Microsoft\VCExpress.


I've uploaded the fixed version to CVS. Mind posting the details on this one to scons?


Done!