|
|
|
|
#1 |
|
Senior Member
Join Date: Oct 2006
Posts: 106
|
Building NSIS with vc9
I'm trying to build NSIS with Python 2.5, scons 0.98.5 and vc9 but I get an error saying "Couldn't find a good version of libcp.lib". What am I doing wrong? I'm trying to build HEAD
|
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
VC9 is probably not configured properly and so SCons can't tell it's using VC9 or SCons simply doesn't support VC9 yet. Clean the entire directory, run SCons again and look for the first error in config.log.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Oct 2006
Posts: 106
|
This is the (translated) contents of config.log
code: If I try to run the cl command on my own I get this: code: |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Oct 2006
Posts: 106
|
Some clarification and more information:
I ran "scons" from a "Visual Studio 2008 Command Prompt" and that's where it gave me the above output when I tried to run cl.exe. Trying to run cl.exe from a "normal" command prompt it says it can't find cl.exe. So I added the path to cl.exe to %PATH%, rebooted the computer, and reran scons but still got the same error. Running cl.exe from a normal cmd prompt gave a different result though. Now I get a messagebox saying cl.exe can't find mspdb80.dll (it used to say it couldn't find cl.exe) |
|
|
|
|
|
#5 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
SCons doesn't support Visual C++ 2008 yet. A temporary solution would be to use the environment variables to detect the compiler location. We did this for MSVC 2005 until support was added to Scons:
http://nsis.svn.sourceforge.net/view...&revision=4796 |
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Oct 2006
Posts: 106
|
I got much further now
![]() Now I get this: I don't (think) I want to compile NSIS Menu. How do I not compile it?code: |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Oct 2006
Posts: 106
|
I added SKIPUTILS="NSIS Menu"
Finished without errors now
|
|
|
|
|
|
#8 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
Can you post the files you have modified so I can put it in SVN?
|
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Oct 2006
Posts: 106
|
I just added this to the beginning of SCons\Config\ms
Since I just wanted to make it work on my computer I got rid of the "if defenv" stuffcode: |
|
|
|
|
|
#10 | |
|
Senior Member
Join Date: Feb 2007
Posts: 152
|
Quote:
Its too bad it can't be made easier to build... |
|
|
|
|
|
|
#11 | |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
Quote:
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
|
#12 | |
|
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
This is the first time I've tried to compile NSIS from source. (actually, this is also the first experience I've had with using Scons too.)
I seem to be having the same problem as the original thread: Error "couldn't find a good version of libcp.lib". I've got Visual C++ 2008 Express, Python 2.5 and Scons 0.98.5 on a Windows XP SP3 box. I have confirmed that the file libcp.lib is NOWHERE on my system. (I search the entire local drive.) one post says this: Quote:
![]() Can someone help clarify? |
|
|
|
|
|
|
#13 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
SCons still does not support MSVC 2008. You need to add the workaround TobbeSweden posted.
|
|
|
|
|
|
#14 |
|
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
OK, I did as you recommended and now I'm getting this error:
scons: *** No SConstruct file found. File "C:\Python25\Lib\site-packages\scons-0.98.5\SCons\Script\Main.py", line 817, in _main I'm not sure how to decipher this. Do I maybe just need something added to my PATH variable? |
|
|
|
|
|
#15 |
|
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
Some more info:
I tried installing VC++ 2005 edition thinking that might help, but unfortunately it didn't. After digging into the logs more, I found an error that Kernel32.lib was not found. I fixed this by adding "C:\Program Files\Microsoft Visual Studio 8\VC\lib" to the end of my windows path statement (since that's where I found Kernel32.lib) That seemed to get me further along, but now I'm getting this error: code: I have attached a copy of my current MS file in case it might help. |
|
|
|
|
|
#16 |
|
Junior Member
Join Date: Aug 2008
Posts: 2
|
I'm also trying to build NSIS from source and running into similar problems. I need to rebuild Unicode NSIS with logging enabled for proper Japanese language support.
I am unable to get past the problem with not being able to find a good version of libcp. I tried the above modifications to the "ms" file, but didn't have any luck. I have VS2008, VS2005 as well as VC5 and 6 installed on my development machine. If I make the modifications to the "ms" file (changing the defenv section as in Tobbe's post) I still see the "Couldn't find a good version of libcp.lib". I'm not really familiar with scons or python (I've used ant more than make), could the wiki be updated with more build instructions? http://nsis.sourceforge.net/Building_NSIS_from_SVN I actually got fairly far with help from Jim Park, but the build process reached the point where all of the header files couldn't be found unless I modified all of the include statements to have an absolute path to the location of the header file. That seemed very wrong, at which point I figured it was a good time to ask for help. Regards, ~Dave |
|
|
|
|
|
#17 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
SCons is probably trying to use MSVC 2005, which is the most recent version supported. Do you also have the Windows SDK installed?
|
|
|
|
|
|
#18 |
|
Senior Member
Join Date: Sep 2007
Posts: 204
|
Also, installing MSVS 2008 causes Scons to find it instead of MSVS 2005. This is a problem because Scons currently can't handle MSVS 2008. So Dave, when I said my build system was messed up, I was encountering the same problem you were. I had to actually hack Scons to make it find my copy of MSVS 2005 instead of trying to use MSVS 2008. I emailed you a logging build of Unicode NSIS. I hope that works for you.
Unicode NSIS advocate -- http://www.scratchpaper.com for latest build and source. |
|
|
|
|
|
#19 |
|
Senior Member
Join Date: Sep 2007
Posts: 204
|
For those of you trying to build the logging version of NSIS using MSVS 2005, here's the little edit you'll need to do in your \Scons\Config\ms file. Basically, you need to skip the libcp test because from MSVS 2005 on, there is no longer any need to link to the single threaded version of the runtime library. The linker will automatically link it in for you if you need it.
So in around line 43, you'll need to wrap the whole check in a if MSVS_VERSION < 8.0 check: code: Unicode NSIS advocate -- http://www.scratchpaper.com for latest build and source. |
|
|
|
|
|
#20 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
When this check fails the problem is usually a compiler detection problem. So I'm afarid you'll just get another error.
|
|
|
|
|
|
#21 |
|
Senior Member
Join Date: Sep 2007
Posts: 204
|
I should have made it clear that the case I was trying to fix was building with Vc8 not Vc9. So with Vc8 (MSVS 2005 / 8.0), you can build the special logging build without the single threaded C runtime. Vc9 is still broken as you mentioned. Vc9 stores the header files differently so the Scons folks will have to fix that problem.
If you have installed Vc9 and have Vc8 on your machine, even if you set the environment variables to use MSVS 8.0 you will still have problems because Scons will go look in your registry and discover you have MSVS 9.0, try to use it and fail. You'll have to hack a Scons Python script to make it return MSVS 8.0 not 9.0. If you are interested in that hack, I can send you the file. Unicode NSIS advocate -- http://www.scratchpaper.com for latest build and source. |
|
|
|
|
|
#22 |
|
Junior Member
Join Date: Aug 2008
Posts: 2
|
Jim,
Thank you for the help, the logging build of the unicode version works perfectly with nicely displayed Japanese characters. |
|
|
|
|
|
#23 |
|
Senior Member
Join Date: Mar 2005
Posts: 186
|
BUMP!
Perhaps the patches above should be added to SVN? Does anyone object if I commit them? bye, pabs |
|
|
|
|
|
#24 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
Which patch exactly are we talking about? TobbeSweden's is a hack to ignore the fact SCons couldn't recognize his VC version and will make multiple installations of VC mess with SCons' selection. jimpark's patch does the same and ignores the fact ofstream can't be properly built.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#25 |
|
Senior Member
Join Date: Mar 2005
Posts: 186
|
Hmm, OK. So there is no way to make the scons stuff compatible with all of Microsoft's C/C++ compilers?
bye, pabs |
|
|
|
|
|
#26 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
SCons releases a lot of new versions lately. Are you sure the latest 1.1.0 doesn't already support VC9? If it doesn't, the best method would be submitting a patch for scons\SCons\Tool\msvs.py. For NSIS, you can add a temporary tool and add it to the environment if it claims it found VC9.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#27 | ||
|
Senior Member
Join Date: Mar 2005
Posts: 186
|
Pasting the below on behalf of Thomas Gaugler, who did the System::Call port to GCC...
Quote:
bye, pabs |
||
|
|
|
|
|
#28 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
That's exactly TobbeSweden's patch which ignores SCons and assumes the user has configured everything properly. It's not the SCons way of things and doesn't assure everything is properly compiled.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#29 |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
Maybe we can provide an option to use the user environment instead of SCons detection?
|
|
|
|
|
|
#30 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
We already do.
code: NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#31 |
|
Senior Member
Join Date: Sep 2007
Posts: 204
|
Scons 1.2.0 does not fix the compilation issues with MSVS 2008 (VC9), unfortunately. However, there is a simple patch you can apply to msvc.py in your Python\Lib\site-packages\scons-1.2.0\Scons\Tool. The URL for the bug report and the patch is here: http://scons.tigris.org/issues/show_bug.cgi?id=2224
One thing we probably should do with Vc9 is add: code: to Platform.h The reason for this is that in the newer SDKs, the FOF macros are now defined in shellapi.h instead of elsewhere. This causes MACRO redefinition warnings to appear since Platform.h defines them and then shellapi.h defines them again. Unicode NSIS advocate -- http://www.scratchpaper.com for latest build and source. |
|
|
|
|
|
#32 |
|
Senior Member
Join Date: Sep 2007
Posts: 204
|
I should also mention that the above patch only works in the command line where you run vsvars32.bat to set up the environment variables correctly.
Unicode NSIS advocate -- http://www.scratchpaper.com for latest build and source. |
|
|
|
|
|
#33 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
shellapi.h added, thanks. But that SCons patch is, again, against SCons spirit and that's why it requires vsvars32.bat. Those paths are surely saved somewhere in the registry or in some XML file.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#34 |
|
Senior Member
Join Date: Sep 2007
Posts: 204
|
Well, hopefully they will figure it out on their next release. They're approach still doesn't help you if you have multiple versions of MS Developer Studio installed on your machine. It always assumes that you will want to compile with the latest and that is not true -- for instance that fact that Scons doesn't support Vc9 makes you wish you can tell Scons to just use Vc8. So I think really the best way to get that intent across to Scons is either add a parameter to Scons to tell it which version of which compiler to use, or it reads the needed information through environment variables, assuming that the user knows what he's doing. This whole going into the registry to figure out what's installed and trying to glean the setup information just doesn't work when Microsoft just decides that some of that information will be in some new other mechanism. For every release of MSDEV, Scons will be behind.
Unicode NSIS advocate -- http://www.scratchpaper.com for latest build and source. |
|
|
|
|
|
#35 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
You can tell it which version of MSVC to use by passing MSVS_VERSION to the environment.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#36 |
|
Senior Member
Join Date: Sep 2007
Posts: 204
|
I'm not sure that it works.
Every compiler I know takes cues from the environment and Microsoft's compiler is no exception. If your cmd.exe environment is setup for Vc9 and then you try to compile it for Vc8, is it guaranteed to work? Or would you have the potential for conflicting header files and libraries? It just seems to me that Scons' most fragile feature is the gleaning of the environment variables from the registry. Scons is so useful but I think it shoots itself in the foot when it tries to do something that it really ought not. Let the developer set up the usual environment for the compiler. Trust that he knows what he's doing. Have Scons worry about the project settings being correct for that compiler minus what's usually gotten from the environment. Then I would imagine that Scons won't break as often when a compiler vendor comes out with a new version. Each compiler vendor has to support a command line environment that works -- so make use of that environment. Of course, this is just my two cents. Unicode NSIS advocate -- http://www.scratchpaper.com for latest build and source. |
|
|
|
|
|
#37 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
But it does work
![]() It redefines the environment according to the selected version (defaulting to the highest) and ignores anything you define on your on in your cmd.exe. That's what Visual Studio does as well, so there's no reason it shouldn't work. As for letting the developer setup his environment, I'd rather not. We are not talking about Linux. Most developers I know and certainly most developers I've gotten questions from, don't know much about the environment. I love it that SCons sets it up for them. New versions are bound to come along but ignoring the old versions won't solve anything. An option is something else and still not a perfect solution as the flags might be all wrong. I will probably be creating a VC9 tool definition for scons soon for another project. If that happens, I'll submit it as a patch to scons after I add it to NSIS. NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#38 |
|
Junior Member
Join Date: Jun 2010
Posts: 1
|
Building NSIS 2.46: Python v2.65 + Scons 1.3.0 + VS2010 Express + Windows SDK v7.1
1. Download Python Windows installer 2.x from: http://www.python.org/download/ and install it, for example into: C:\Dev\Python26 2. Download latest Scons for Windows from: http://scons.org/download.php and install it. 3. Download NSIS source from: http://nsis.sourceforge.net/Download and unpack all NSIS files, for example, into C:\Dev\NSIS 4. Open file named ms located at C:\Dev\NSIS\SCons\Config dir. Comment the following lines and save file: code: 5. Open file named SConstruct located at C:\Dev\NSIS dir. Add after line: code: the following line: code: 6. Run Visual Studio 2010 command prompt: Start > All Programs > Microsoft Visual Studio 2010 Express > Visual Studio Command Prompt 2010 Set current directory to NSIS: code: Run the following command: code: |
|
|
|
|
|
#39 |
|
Junior Member
Join Date: Jul 2009
Posts: 10
|
Thank you for the detailed build instructions.
I was now able to build NSIS on XP + VS2010 Express + Windows SDK v7. Please note, that the python version must be 2.6 or greater. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|