Archive: Multiple defines problem


Multiple defines problem
I have a couple of installer scripts (actually, 4) that share a lot of common features, functions and settings, and as such, I created a common include file to contain all said commonailites. I don't know if its relevant or not, but I used to have each installer script have everything within it, which was a pain to maintain, but at least it worked.

The problem: During compilation, when parsing the common header file, the compiler is complaining about a couple of multiply defined symbols, but there is no where that these symbols are defined before hand. Perhaps there is some implications that I am unaware of when splitting up an installer over multiple files.

Anyways, here is the code:

Common header file: http://pastebin.com/m1ceacc50
One of the 4 scripts: http://pastebin.com/m36a79415

The compiler first complains when it reaches line 35 of the common header file. It says that MUI_WELCOMEFINISHPAGE_BITMAP is already defined. If I comment out that line or put !ifndef !endif around it, it then complains about MUI_UNWELCOMEFINISHPAGE_BITMAP, and then MUI_ICON, and MUI_UNICON, and a few others beyond that.

I can't figure this out. It's probably something really stupid, but sometimes you need a fresh pair of eyes to see it.

Thanks in advance.


Has no one seen this before? Even if I check the log and look for the !define statement of the apparently already defined symbol, I only find the one instance that it errors on. If the symbol was defined before, should it not show up in the log?


Try switching to MUI2.nsh

Stu


Thanks for the advice, Afrow, I just tried it. It managed to not error on MUI_WELCOMEFINISHPAGE_BITMAP and MUI_UNWELCOMEFINISHPAGE_BITMAP, but it did on MUI_ICON. So it may a little bit of a difference, but didn't quite fix the problem. Curious!


I should mention i am using the latest NSIS with the latest UNICODE branch (downloaded and installed today).

Also, I tried putting !undef in front of all the macros that have the problem. The installer completes, but the welcome page is blank. This is when using MUI2.nsh.

With MUI.nsh, the installer gets to the end, but stops with this error:

Processed 1 file, writing output: Adding plug-ins initializing function... Done! Error: resolving uninstall function "un.Nsis2Io" in function "un.mui.WelcomePre_92.7.5.9" Note: uninstall functions must begin with "un.", and install functions must not Error - aborting creation process

I managed to get almost everything to work, simply by placing the section (not installer section, but rather code section, separated by large comment blocks) titled "setup" after my page definitions. The only problem now is that my header image won't load. It always did with MUI, but MUI2 doesn't seem to want to load it.