OAH's link.exe gets used in unrelated builds
I have a weird problem here: I have installed OAH, built some stuff, all was okay. Then I tried to build Qt, and the build failed with the following output:
"C:\Program Files\OAH Build\bin\link.exe" /LIBPATH:
-src-4.5.0\lib /LIBPATH:
UG /MANIFEST /MANIFESTFILE:
/SUBSYSTEM:WINDOWS /MANIFESTDEPEND
on-Controls' version='6.0.0.0' publicKeyToken=
ocessorArchitec
\LOCALS~
LINK : fatal error LNK1181: cannot open input file 'name='
on-Controls''
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\link.EXE"' : return code '0x49d'
Stop.
As you can see, it runs OAH's link.exe for some reason. Question: why and how to fix it? It's not on PATH, it's not something in the visual studio installation. Did OAH write something to registry which causes Qt use OAH's link.exe?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- OAH Build Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- muntyan
- Solved:
- Last query:
- Last reply:
Revision history for this message
|
#1 |
First of all; My apologies. We should have informed the user (you) that when OAH is installed, it actually replaces microsofts link.exe like this:
1. Move $(VCInstalledDi
2. Install (oah link.exe wrapper) link.exe to $(VCInstalledDi
When visual studio/msbuild (or other build system. You are using NMAKE??) executes link.exe (oah wrapper), it will parse .rsp files and look for nested .rsp files, which then again will be expanded as an additional argument and given to microsofts link.exe (which is located in C:\Program Files\OAH Build\bin\link.exe for your system)
From your question, it could seem like there is a bug in our link.exe wrapper. I'm guessing that something is wrong with the arguments that are being proxied from oahs link.exe to ms link.exe. I'll look into it some day soon.
So you have to alternatives:
1. Uninstall OAH build and wait for the fix
2. Manually re-replace the ms link.exe by copying C:\Program Files\OAH Build\bin\link.exe to C:\Program Files\Microsoft Visual studio 9.0\VC\bin\link.exe
Revision history for this message
|
#2 |
Yeah, as a workaround I simply uninstall OAH, it's small and easy to install/uninstall when needed. But of course it's not very convenient. Thanks!
Revision history for this message
|
#3 |
OHH!!
(Before I rant, let me just say *THANKYOU* for the work you've been doing.. Your easy, clean glib builds have saved me more hours than I care to imagine! Ok on to my rant..)
You *MUST* put some UI on your installers!! And yes, notify the user of changes you're making (like uh, replacing link?)
I just spent THREE hours dealing with this:
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
"link.exe" @"C:\Program Files (x86)\OAH Build\source\
Revision history for this message
|
#4 |
Yeah, I'm really sorry about that. I'll see what I can do about it before OAH 0.4 release.
Revision history for this message
|
#5 |
I am seeing the same problem (infinite loop in link with more and more ~~~~~).
IMHO, it is *unacceptable* to replace another application's executables, even more so without asking or even notifying the use to that effect.
What is the problem that linkwrapper.exe solves? I would like to help find another solution.
Revision history for this message
|
#6 |
> I am seeing the same problem (infinite loop in link with more and more ~~~~~).
>
This is mainly because OAH_INSTALLED_PATH environment variable isn't set when you link.
> IMHO, it is *unacceptable* to replace another application's executables, even more so without asking or
> even notifying the use to that effect.
>
Well, if you think so, don't use it! Simply uninstall.
> What is the problem that linkwrapper.exe solves? I would like to help find another solution.
>
Source code: http://
Microsofts link.exe doesn't support nested RSP files! So when you build with VCBuild, it will generate a temporary RSP file.
As you might know OAH uses pkg-config. The dependent LIBPATHs and libraries will be stored in an own file which again will be used as a RSP file for the link tool. This means that you get the pkg-config generated RSP file referenced inside the VCBuild generated RSP file. So linkwrapper.exe finds nested RSP files (prefixed with '@') and generates a new temporary RSP file where the nested RSP file(s) is/are expanded in the new file. Does this make sense?
1) A solution will be to abort if OAH_INSTALLED_PATH isn't found in the environment. See line 181 to 184 in linkwrapper.cpp.
2) Ditch OAH, which is what I've done already I'm afraid.
There are a lot of workarounds in OAH to fit Visual Studio and mostly what is known as VCBuild. I cant say I like the build system, and I found to my surprise one year ago that other languages like C# are using another build system called MSBuild.
So I started a new project called HSBuild which sits ontop of MSBuild instead of the old VCBuild. See https:/
Note:
Last fall (2009) I found that in VS2010 (by checking out beta2) Microsoft will move from VCBuild (which have been the build system for C/C++ based "projects" since VC6 (maybe earlier also)) to MSBuild. So what I've done in HSBuild is very similar to what VS2010 will be when MS releases it! Except that HSBUild will be enabled to resolve dependencies with pkg-config and collect output similar to how it is done on *nx based systems.
Revision history for this message
|
#7 |
On Wed, Jan 6, 2010 at 12:18 PM, Haakon Sporsheim
<email address hidden> wrote:
> This is mainly because OAH_INSTALLED_PATH environment variable isn't set when you link.
I came to the same conclusion after an hour of frustrated debugging :(
> Microsofts link.exe doesn't support nested RSP files! [...]
> So linkwrapper.exe finds nested RSP files (prefixed with '@') and generates a new temporary RSP file where the nested RSP file(s) is/are expanded in the new file. Does this make sense?
Yep.
> 1) A solution will be to abort if OAH_INSTALLED_PATH isn't found in the environment. See line 181 to 184 in linkwrapper.cpp.
That does seem like a good solution. I will send you a patch in the near future.
> 2) Ditch OAH, which is what I've done already I'm afraid.
> There are a lot of workarounds in OAH to fit Visual Studio and mostly what is known as VCBuild. I cant say I like the build system, and I found to my surprise one year ago that other languages like C# are using another build system called MSBuild.
> So I started a new project called HSBuild which sits ontop of MSBuild instead of the old VCBuild. See https:/
Could you add a notice to the front page pointing people to this new project?
Revision history for this message
|
#8 |
What is the best way for me to send you a patch? I do not see a way to attach it to this bug report.
Revision history for this message
|
#9 |
Well, in true launchpad spirit you do:
bzr branch lp:oah
apply your patch / edit files
bzr commit
bzr push lp:~<your launchpad username>
Then I'll merge it in later :)
OR
you could just send med patch if you want. You will probably find my email address in a lot of the source code, but it is <my name> at gmail
Revision history for this message
|
#10 |
Sounds good, I have pushed a new branch under my launchpad account and have submitted it for merge review.
OMG! I ran into this problem myself just after having installed OAH to have a look. I noticed it had added stuff to the system PATH, I thought that was a bit obnoxious, so I undid that. Little did I know it had done something even more obnoxious, and had to spend some hour wondering what the heck is going on, seeing the same kind of link.exe crashes as mentioned above.
Please... Add a warning in HUGE RED LETTERS on the download page that installing OAH will break your VS installation. Tell *exactly* what installing it will do, and how to undo it.