Archive: NSIS 2.27 - NSIS Menu fails to link


NSIS 2.27 - NSIS Menu fails to link
I have followed all setup instructions in the NSIS Docs Appendix. I have wxWidgets 2.8.3; WXWIN is correctly set; Python 2.5.1; Scons 0.96.93; using a Visual Studio .NET 2003 terminal.

The compilation is fine, but I cannot get it to link:


cl /nologo /GS- /O1 /W3 /MD /EHsc /TP /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_N
O_WARNINGS /IC:\wxWidgets-2.8.3\include /IC:\wxWidgets-2.8.3\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.3\include /IC:\wxWidgets-2.8.3\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.3\inc
lude /IC:\wxWidgets-2.8.3\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.3\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"
wxbase28.lib(baselib_filename.obj) : error LNK2019: unresolved external symbol _
_imp__CoCreateInstance@20 referenced in function "public: bool __thiscall wxFile
Name::GetShortcutTarget(class wxString const &,class wxString &,class wxString *
)" (?GetShortcutTarget@wxFileName@@QAE_NABVwxString@@AAV2@PAV2@@Z)
wxmsw28_core.lib(corelib_app.obj) : error LNK2019: unresolved external symbol __
imp__OleUninitialize@0 referenced in function "void __cdecl wxOleUninitialize(vo
id)" (?wxOleUninitialize@@YAXXZ)
wxmsw28_core.lib(corelib_clipbrd.obj) : error LNK2001: unresolved external symbo
l __imp__OleUninitialize@0
wxmsw28_core.lib(corelib_app.obj) : error LNK2019: unresolved external symbol __
imp__OleInitialize@4 referenced in function "bool __cdecl wxOleInitialize(void)"
(?wxOleInitialize@@YA_NXZ)

There are a total of 72 linker errors link this.

Add ole32 to libs in Contrib\NSIS Menu\SConscript and let me know if it works.


Actually, forget about that. You should rebuild wxWidgets with wxbuild.bat. Make sure you delete any intermediate files in the wxWidgets directory before you do that.

Nothing from OLE should be used, as wxUSE_OLE is defined as 0 in setup.h.


Sorry, I forgot to mention that I had already done that. I first tried with wxWidgets 2.8.3 and when that failed I tried with 2.8.0. When that also failed, I reverted back to 2.8.3.


Then try deleting everything, installing wxWidgets 2.8.4, running wxbuild.bat and compiling again. Somewhere along the way, a wrong setup.h has gotten into your previous build.


No change. Any ideas?


Actually, let me remove the NSIS directory and re-extract and give it one more try.


Nope, it's still not working.


It worked just fine for me yesterday with wxWidgets 2.8.4. OLE is definitly should not be used due to wxUSE_OLE and that specific code part that the compiler complains about is surrounded with #ifdef wxUSE_OLE. I don't know what's wrong with your build. There must be a stray setup.h laying around somewhere.


I'm currently re-installing my development applications and will try again...


Manually building wxWidgets while making sure it's using the correct setup.h will do. There's no need to reinstall everything.


So, which setup.h is the correct one? And where should it go?


I have been able to get it to build finally. When I ran the wxbuild.bat from Contrib\NSIS Menu\wx instead of from the root of the extracted NSIS directory, all worked fine.

Thanks for all the help kichik!


Thanks, I've updated wxbuild.bat to check for that too.