Archive: Problem building the NSIS source


Problem building the NSIS source
Hello,

I am trying to build the NSIS source and I am having some real problems. I have installed wxWidgets 2.8.4 and scons and python as instructedby the manual, and I have set a WXWIN environmental variable to the wxWidgets install directory, and I have run wxbuild.bat. After doing all that I run scons and get the following... (I don't really know how much output is useful but here's the last few lines)


link /nologo /opt:nowin98 /map /entry:DllMain /NODEFAULTLIB /dll /out:build\rele
ase\nsDialogs\nsDialogs.dll kernel32.lib user32.lib gdi32.lib shell32.lib comdlg
32.lib ole32.lib build\release\nsDialogs\browse.obj build\release\nsDialogs\inpu
t.obj build\release\nsDialogs\nsDialogs.obj build\release\nsDialogs\nsis.obj bui
ld\release\nsDialogs\rtl.obj build\release\nsDialogs\dialog-rc.res build\release
\nsDialogs\SHLIBEMITTER.obj
Creating library build\release\nsDialogs\nsDialogs.lib and object build\relea
se\nsDialogs\nsDialogs.exp
cl /nologo /GS- /O1 /W3 /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /c
Contrib\nsExec\nsexec.c /Fobuild\release\nsExec\nsexec.obj
nsexec.c
cl /nologo /GS- /O1 /W3 /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /c
SCons\Config\memset.c /Fobuild\release\nsExec\SHLIBEMITTER.obj
memset.c
link /nologo /opt:nowin98 /map /entry:DllMain /NODEFAULTLIB /dll /out:build\rele
ase\nsExec\nsExec.dll kernel32.lib user32.lib advapi32.lib build\release\nsExec\
nsexec.obj build\release\nsExec\SHLIBEMITTER.obj
Creating library build\release\nsExec\nsExec.lib and object build\release\nsE
xec\nsExec.exp
cl /nologo /GS- /O1 /W3 /MD /EHsc /TP /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_N
O_WARNINGS /IC:\wxWidgets-2.8.4\include /IC:\wxWidgets-2.8.4\lib\vc_libnsis\msw
/c "Contrib\NSIS Menu\nsismenu\nsismenu.cpp" "/Fobuild\release\NSIS Menu\nsismen
u\nsismenu.obj"
nsismenu.cpp
C:\wxWidgets-2.8.4\include\wx/platform.h(196) : fatal error C1083: Cannot open i
nclude file: 'wx/setup.h': No such file or directory
scons: *** [build\release\NSIS Menu\nsismenu\nsismenu.obj] Error 2
scons: building terminated because of errors.
C:\Documents and Settings\hdevlin\Desktop\NSIS\nsis-2.30-src>


So it couldn't find the setup.h file, but it it was there in a different folder, so I just copied it over, which worked, but then I got this output and there is still a problem...


C:\Documents and Settings\hdevlin\Desktop\NSIS\nsis-2.30-src>scons
scons: Reading SConscript files ...
Delete("nsis-13-Sep-2007.cvs")
Delete(".instdist")
Delete(".test")
Using Microsoft tools configuration
Checking for memset requirement... (cached) yes
Checking for C library gdi32... (cached) yes
Checking for C library user32... (cached) yes
Checking for C library pthread... (cached) no
Checking for C library iconv... (cached) no
Checking for C library version... (cached) yes
Checking for C library dl... (cached) no
Checking for C library gdi32... (cached) yes
Checking for C library iconv... (cached) no
Checking for C library pthread... (cached) no
Checking for C library user32... (cached) yes
Checking for C library version... (cached) yes
Checking for C++ library cppunit... (cached) no
scons: done reading SConscript files.
scons: Building targets ...
cl /nologo /GS- /O1 /W3 /MD /EHsc /TP /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_N
O_WARNINGS /IC:\wxWidgets-2.8.4\include /IC:\wxWidgets-2.8.4\lib\vc_libnsis\msw
/c "Contrib\NSIS Menu\nsismenu\nsismenu.cpp" "/Fobuild\release\NSIS Menu\nsismen
u\nsismenu.obj"
nsismenu.cpp
cl /nologo /GS- /O1 /W3 /MD /EHsc /TP /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_N
O_WARNINGS /IC:\wxWidgets-2.8.4\include /IC:\wxWidgets-2.8.4\lib\vc_libnsis\msw
/c "Contrib\NSIS Menu\nsismenu\nslinks.cpp" "/Fobuild\release\NSIS Menu\nsismenu
\nslinks.obj"
nslinks.cpp
rc /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /IC:\wxWidgets-2.8.4\inc
lude /IC:\wxWidgets-2.8.4\lib\vc_libnsis\msw "/fobuild\release\NSIS Menu\nsismen
u-rc.res" "Contrib\NSIS Menu\nsismenu\nsismenu.rc"
link /nologo /opt:nowin98 /map "/OUT:build\release\NSIS Menu\NSIS.exe" /LIBPATH:
C:\wxWidgets-2.8.4\lib\vc_libnsis advapi32.lib comctl32.lib gdi32.lib shell32.li
b user32.lib wxbase28.lib wxmsw28_core.lib wxmsw28_html.lib "build\release\NSIS
Menu\nsismenu\nsismenu.obj" "build\release\NSIS Menu\nsismenu\nslinks.obj" "buil
d\release\NSIS Menu\nsismenu-rc.res"
LINK : fatal error LNK1181: cannot open input file 'wxbase28.lib'
scons: *** [build\release\NSIS Menu\NSIS.exe] Error 1181
scons: building terminated because of errors.
C:\Documents and Settings\hdevlin\Desktop\NSIS\nsis-2.30-src>


So it seems to not be able to find wxbase28.lib, which is fair enough because after running a search I found that the file doesn't exist, which is weird. What I have also noticed is I keep seeing the file vc_libnsis mentioned, and vc_mswnsis, both of which again don't exist on my computer. Does anyone have any idea what is going on?

Thanks in advance for any help!

Hayden Devlin


I have solved this problem now.

For anyone else who experiences this same thing... the problem stems from a problem with the environmental variable, which makes wxbuild.bat not work. To fix the problem you should go into your Visual Studio Command Prompt, which is accessible through the start menu in the Visual Studio group in the tools bit. Open that and run wxbuild.bat from there. This will make wxbuild.bat work fine. Then you can run scons to build NSIS from the normal command line and it will work fine :)


Might be a good idea to add Hayden's note to the Wiki (http://nsis.sourceforge.net/Docs/AppendixG.html). For example, change this:

"To build NSIS Menu, install wxWidgets 2.8, create an environment variable named WXWIN containing the path to the installation directory of wxWidgets, run Contrib\NSIS Menu\wx\wxbuild.bat and build NSIS as usual."

...to...

"To build NSIS Menu, install wxWidgets 2.8, create an environment variable named WXWIN containing the path to the installation directory of wxWidgets, run Contrib\NSIS Menu\wx\wxbuild.bat and build NSIS as usual. You will probably need to build using a command shell invoked by starting from 'Visual Studio Command Prompt', typically found under Visual Studio Tools."

Anyway, just a suggestion.