Archive: Compile NSIS 2.10 problem


Compile NSIS 2.10 problem
I have installed:
python-2.4.1
scons-0.96.91
VCToolkit
Windows Server 2003 SP1 Platform SDK

Build.bat (in the NSIS source directory):

@ECHO OFF
set MSSDK=D:\Program Files\Microsoft Platform SDK
set VCToolkitInstallDir=D:\Program Files\Microsoft Visual C++ Toolkit 2003
set Python=D:\Python24

set PATH=%Python%;%PATH%
set INCLUDE=%MSSDK%\include;%INCLUDE%
set LIB=%MSSDK%\lib;%LIB%

scons MSTOOLKIT=yes


But there are errors when I try to compile:
scons: Reading SConscript files ...
Delete("nsis-09-Oct-2005.cvs")
Delete(".instdist")
Delete(".test")
Using Microsoft tools configuration
Checking for main() in C library gdi32... (cached) no
Checking for main() in C library user32... (cached) no
Checking for main() in C library version... (cached) no
Checking for main() in C library pthread... (cached) no
Checking for main() in C library stdc++... (cached) no
Checking for main() in C library iconv... (cached) no
Checking for main() in C library dl... (cached) no
Checking for main() in C++ library cppunit... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
cl /nologo /O1 /W3 /c Contrib\AdvSplash\advsplash.c /Fobuild\release\AdvSplash\a
dvsplash.obj
advsplash.c
Contrib\AdvSplash\advsplash.c(214) : error C2065: 'LWA_ALPHA' : undeclared ident
ifier
Contrib\AdvSplash\advsplash.c(214) : error C2065: 'LWA_COLORKEY' : undeclared id
entifier
Contrib\AdvSplash\advsplash.c(244) : error C2065: 'WS_EX_LAYERED' : undeclared i
dentifier
Contrib\AdvSplash\advsplash.c(270) : error C2065: 'DWORD_PTR' : undeclared ident
ifier
Contrib\AdvSplash\advsplash.c(270) : error C2146: syntax error : missing ')' bef
ore identifier 'myWnd'
Contrib\AdvSplash\advsplash.c(270) : error C2144: syntax error : '<Unknown>' sho
uld be preceded by '<Unknown>'
Contrib\AdvSplash\advsplash.c(270) : error C2144: syntax error : '<Unknown>' sho
uld be preceded by '<Unknown>'
Contrib\AdvSplash\advsplash.c(270) : error C2143: syntax error : missing ')' bef
ore 'identifier'
Contrib\AdvSplash\advsplash.c(270) : error C2198: 'timeSetEvent' : too few argum
ents for call through pointer-to-function
Contrib\AdvSplash\advsplash.c(270) : error C2059: syntax error : ')'
scons: *** [build\release\AdvSplash\advsplash.obj] Error 2
scons: building terminated because of errors.
I read in forum about the same error, it was environment variable problem, but why scons don't find liberaries, all paths is ok.

Does %MSSDK%\Lib\Gdi32.Lib exist? If it doesn't, you might have installed the wrong Platform SDK. There's one that doesn't come with all the libraries and binaries for some weird reason. Maybe it was only for 64-bit. I don't remember right now...


I'm confused. "%MSSDK%\Lib\Gdi32.Lib" exists.


If it exists, it's probably the correct Platform SDK version.

What does config.log show?


This is very strange. After I have remove "nsis-2.10-src" and unpack source again (build.bat file the same):


scons: Reading SConscript files ...
Delete("nsis-09-Oct-2005.cvs")
Delete(".instdist")
Delete(".test")
Using Microsoft tools configuration
Checking for main() in C library gdi32... (cached) yes
Checking for main() in C library user32... (cached) yes
Checking for main() in C library version... (cached) yes
Checking for main() in C library pthread... (cached) no
Checking for main() in C library stdc++... (cached) no
Checking for main() in C library iconv... (cached) no
Checking for main() in C library dl... (cached) no
Checking for main() in C++ library cppunit... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
cl /nologo /O1 /W3 /c Contrib\AdvSplash\advsplash.c /Fobuild\release\AdvSplash\a
dvsplash.obj
advsplash.c
Contrib\AdvSplash\advsplash.c(214) : error C2065: 'LWA_ALPHA' : undeclared ident
ifier
Contrib\AdvSplash\advsplash.c(214) : error C2065: 'LWA_COLORKEY' : undeclared id
entifier
Contrib\AdvSplash\advsplash.c(244) : error C2065: 'WS_EX_LAYERED' : undeclared i
dentifier
Contrib\AdvSplash\advsplash.c(270) : error C2065: 'DWORD_PTR' : undeclared ident
ifier
Contrib\AdvSplash\advsplash.c(270) : error C2146: syntax error : missing ')' bef
ore identifier 'myWnd'
Contrib\AdvSplash\advsplash.c(270) : error C2144: syntax error : '<Unknown>' sho
uld be preceded by '<Unknown>'
Contrib\AdvSplash\advsplash.c(270) : error C2144: syntax error : '<Unknown>' sho
uld be preceded by '<Unknown>'
Contrib\AdvSplash\advsplash.c(270) : error C2143: syntax error : missing ')' bef
ore 'identifier'
Contrib\AdvSplash\advsplash.c(270) : error C2198: 'timeSetEvent' : too few argum
ents for call through pointer-to-function
Contrib\AdvSplash\advsplash.c(270) : error C2059: syntax error : ')'
scons: *** [build\release\AdvSplash\advsplash.obj] Error 2
scons: building terminated because of errors.

I actually wanted the config.log for the non-working build. The working one doesn't show the errors. But if it finds the libraries now, it's not important. The libraries were probably not found because the result was still cached from the last time you built it without the correct environment variables.

But the incorrect header file is a puzzle. It doesn't stop on HINSTANCE, but it does on newer definitions which require _WIN32_WINNT. But _WIN32_WINNT is defined on the same file. This means it takes the header files from another place. Do you have WinUser.h installed in another place than %MSSDK%\Include\WinUser.h?

BTW, you don't need to change INCLUDE and LIB on yourself. SCons handles that on its own and ignores your settings.


You are right there was "%VCToolkitInstallDir%\Include\WinUser.h". After clean VCToolkit install, all compiles fine. Thanks!


Any idea how it got there? Was it there in the default installation of the VC Toolkit?


It is I place liberaries and headers from VC6 to VC Toolkit :)


Ah, that explains it. I've updated the tool definition to give priority to the header and library files in the Platfrom SDK. In case they exist in both, the PSDK's should always be newer anyway.