Home Dashboard Directory Help

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



Sign in
to vote
Type: Bug
ID: 785691
Opened: 4/26/2013 10:43:45 AM
Access Restriction: Public
User(s) can reproduce this bug


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/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)
Sign in to post a workaround.
Posted by Indinfer on 4/26/2013 at 11:05 AM
One reason the project source code for a .lib library might not be distributed with the .lib is to deter stealing of the source code while allowing use of the .lib functions and objects. If so, maybe the free PreEmptive Dotfuscator and Analytics found under the Visual Studio Tools menu would be a workaround solution.

I have not tried it, but the website is http://www.preemptive.com/ . The website is where I got my information.

A reason that the whole set of project files for the .lib might not be distributed is just common sense and simplicity. Why should umpteen files need to be distributed? Would seem that only the .lib and the .h file should be enough to distribute through a company and otherwise. For that, Dotfucator would not help.
File Name Submitted By Submitted On File Size  
ms_malloc Ex 1 Alloc and Dealloc.zip (restricted) 4/26/2013 -