gavinpugh / vs-android

Integrated development of Android NDK C/C++ software with Microsoft Visual Studio.
Other
119 stars 34 forks source link

Dependencies link in the wrong order #64

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create three projects, A, B & C compiled as static libraries, with 'Link 
Library Dependencies' enabled
2. Set up dependencies as B depends on A, C depends on A and B. Set C as the 
Default Project
3. Attempt to compile

What is the expected output? What do you see instead?
Expected output is a successful compile & link. However, looking at the command 
line for linking C, the dependencies are placed in order of dependence: A is 
first, then B. However, GCC links in reverse order to Visual Studio (most 
dependent library should come first), so there is a linker error when trying to 
link in library B without any of the symbols defined in A.

What version of the product are you using? On what operating system?
vs-android 0.93, Windows 7

Please provide any additional information below.
This issue can be worked around by turning off 'link library dependencies' and 
specifying libraries in the correct order under Additional Inputs, using the 
'-lname' syntax. Ideally, either the dependencies could be echoed to the 
command line in reverse order or surrounded with -( <dependencies> -) or 
--start-group <dependencies> --end-group which will prompt GCC to recursively 
try to resolve missing symbols. I tried making this change myself, but it seems 
to be something either locked into the build system or is controlled inside the 
DLL

Original issue reported on code.google.com by tjohn...@gmail.com on 14 Feb 2012 at 1:38

GoogleCodeExporter commented 9 years ago

Original comment by gavin.dj.pugh on 14 Feb 2012 at 5:33

GoogleCodeExporter commented 9 years ago

Original comment by gavin.dj.pugh on 21 Feb 2012 at 11:38

GoogleCodeExporter commented 9 years ago
This can also be worked around by enabling 'Use Library Dependency Inputs', but 
it's not the best option for very large projects.

Original comment by asafhel...@gmail.com on 27 Feb 2012 at 7:07

GoogleCodeExporter commented 9 years ago

Original comment by gavin.dj.pugh on 25 Jul 2012 at 1:47

GoogleCodeExporter commented 9 years ago
Confirmed I have the same error, However I found another way to solve it, I 
just change ther order of the libraries on the "Additiona Dependencies" field.

Original comment by Lucas.go...@gmail.com on 2 Sep 2012 at 1:49