Static library grouping

I am having a problem and I think it is related to static library interdependency. There are a few flags that can be used to try and fix the problem. However, I can’t work out how to enter them given that VC++ is not a command line system. Under linker options I tried going to advanced and entering the command and my list of libraries but quotation marks and slashes get stripped. The switches that I am interested in trying are:

-( archives -) or --start-group archives --end-group

How would I use these?

I think I have fixed my problem. -Xlinker -start-group and -end-group seemed to work although my problem ended up having another solution. Double slashes also helped with the stripping problem.

Hi Stuggy,

I’m glad you’ve resolved the issue! It’s also worth noting that the build system removes duplicates from the linker input lists, so the only viable option is using the Linker -> Command Line window. Internally, we usually use -Wl,-start-group/-Wl,-end-group to achieve the desired linking order in our projects.

Is there a new equivalent? I now get the errors:
cannot find -l-WI,–start-group
cannot find -l-WI,–end-group

Hi, do you use Linker -> Command Line or Linker -> Additional Dependencies? -Wl,–start-group/-Wl,–end-group can only be used in the former.

We used to use these in Additional Dependencies and it worked fine. I have just been playing around with all of this and it looks as though the only way I can get this to work is to list all of the libs within Additional Dependencies and then again in the Command Line within the start and end group (or at least those required due to dependencies)

There are a couple of issues with implementing linker groups inside the Additional Dependencies property which are related to the way Visual Studio and MSBuild work. Our users usually either use only Additional Dependencies when the linker groups are not needed or only the Command Line otherwise. Combining them, like you did, shouldn’t be a problem for the build process.

We also have some thoughts on improving the user experience in this scenario, but I cannot say anything definite right now.