hashbrown

Hi,

In Visual Studio 2005 C++, is there any way to grab the linker input data to be used in the pre-link build event

Specifically, I am trying to grab all the information in the Linker->Command Line Property page. This information does not seem to be stored in any file. Is there a way of getting this data to be used in the Pre-Link Event automatically (not by copying and pasting what is in the command line property page)

Thanks!



Re: Visual C++ General Visual Studio 2005 C++

einaros

The options for the command line should be stored in the vcproj file of your project, which can be grabbed as the $(ProjectPath) variable in the build event box. I doubt that you'll be able to grab a fully typed up version of this command, however, as that's not generated until the linker is about to execute.





Re: Visual C++ General Visual Studio 2005 C++

hashbrown

Hello,

I am basically trying to grab all the linker command line options. Yes the vcproj does have all the information i would need, but it is too much hassle to parse all of it and come up with what visual studio already does in the Command Line Property page.

It doesn't look like the $(ProjectPath) variable gives all the linker command line options (such as external libraries that are linked in).

So I guess there is really no way of doing this





Re: Visual C++ General Visual Studio 2005 C++

einaros

ProjectPath just gives you the vcproj, not the command line options.

There may be ways of doing this, but I fear that its outside the scope of the ide to provide you with the easy route. One thing I'd check, if I were you, is the pre-link event. The rsp files generated to the linker may perhaps be completed when that event fires, in which case you'd be able to do what you want quite easily. Test some pre-link events and see the build log (html).





Re: Visual C++ General Visual Studio 2005 C++

hashbrown

Can you explain these rsp files I am not familiar with them. Are they generated before the linking stage happens




Re: Visual C++ General Visual Studio 2005 C++

einaros

They are just temporary text files with content passed to the compiler and linker. See the build log and you'll get the picture.





Re: Visual C++ General Visual Studio 2005 C++

hashbrown

Hi einaros,

AH i see what you mean. Unfortunately these files are created and deleted after the pre-link step but before linking, so it doesn't help my case. I guess there really is no other way.

In any case, is there a way to replace the linker that VC2005 uses with another one I can't seem to find an option to specify which linker to use. But I know it is possible since compilers like the intel compiler integrate into visual studio and they have their own linker and compiler.





Re: Visual C++ General Visual Studio 2005 C++

Simple Samples

Must you have all the options combined together as command line options Perhaps you can use VCLinkerTool Members (Microsoft.VisualStudio.VCProjectEngine) somehow.

Also, in the past it was possible to generate a makefile from a project. I think I read that it is not possible to do that anymore but perhaps I am wrong or perhaps there is an alternative solution that would be useful for your requirements.