VS 2012 Bug: Cannot link to third party .lib files for C/C++ - by Indinfer

Status : 


Sign in
to vote
ID 785691 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 4/26/2013 10:43:45 AM
Access Restriction Public


I am uploading a zipped file of the example project that has everything that should be needed to compile. However, it will not link to the .lib file.

I tried what was supposed to work in the configuration and in the source code file (See link)


I have the source code for the .lib file. And I know the example works if the library project, source code and all, is added to the example project. However, distributing a VS library project should not be necessary, should it?

All you should need is the .lib file and the .h file, right?

Since none of the things I tried in the configuration and source code worked, I have backed all of them out and made fresh, new project files for the example project that I uploaded.
Sign in to post a comment.
Posted by Microsoft on 4/5/2016 at 2:10 PM

The linker now is able to output a warning message if one input library doesn't provide any contribution and has wrong machine type:

xxx.lib : LNK4272 : library machine type 'X86' conflicts with target machine type 'X64'

Posted by Microsoft on 4/29/2013 at 3:58 PM
Thank you for the suggestion.
We will consider providing this specific message in future releases.
Posted by Microsoft on 4/28/2013 at 7:31 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Indinfer on 4/28/2013 at 8:30 AM
Found that this problem is not a bug in Visual Studio. The problem was a mismatch between the target machines of the library and the application.

See http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/9c15c719-ed1c-414f-9ae9-69ecd0ee822e (same forum link as before) for the resolution.

If Microsoft wants to do more, maybe have the linker provide an error message that states the library targets a different maching, for example the library targets a Win32 maching and app targets x64 machine. This message would be in addition to the "unresolved external symbol error."

Other than that, I don't think of anything more Microsoft could do.

I recommend closing this ticket as "not a bug" or the like. And maybe taking it as a suggestion to enhance an error message from the linker.
Posted by Microsoft on 4/26/2013 at 10:50 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)