Solved

static lib link errors VS2013

Posted on 2014-12-16
8
186 Views
Last Modified: 2014-12-22
Hello Experts,

I have a static library that I built using c++ on VS2008. That lib now needs to be linked in to a DLL that is compiled using VS2013. The VS2013 linker gives the errors that are in the attached file. I need to know what settings I should change in the VS2008 static lib to make this work. Changing the VS2013 DLL app properties is not an option. Compiling the VS2008 static lib with Vs2013 is also not an option.
link-errors.txt
0
Comment
Question by:BrianDumas
8 Comments
 
LVL 86

Expert Comment

by:jkr
Comment Utility
What are your project's settings, i.e. what is selected under "Configuration Properties|C/C++|Code Generation" as "Runtime Library" and what is "Configuration Properties|Linker|Command Line"?
0
 

Author Comment

by:BrianDumas
Comment Utility
Thanks for the Quick response jkr. I've attached a PDF  file with screen captures of the settings you asked for.
LIB-settings.pdf
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
Ah, you have '/NODEFAULTLIB' set. This makes the linker ignore all default libraries, as the name implies. Remove that by going to "Linker|Input" and set "Ignore Default Libraries" to "No".
0
 

Author Comment

by:BrianDumas
Comment Utility
Hello jkr, I tried what you suggested and there was no change in the linking errors. they are identical to the original errors. I verified that the change was actually done, and did a rebuild just in case.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 86

Accepted Solution

by:
jkr earned 400 total points
Comment Utility
OK, I see that you also have UNICODE set. Can you try to set 'Treat wchar_t as Built-In Type' to 'No'? (You'll find that under "C/C++|Language")
0
 
LVL 16

Assisted Solution

by:HooKooDooKu
HooKooDooKu earned 100 total points
Comment Utility
Was the library built with Unicode?

Have you tried rebuilding the library in VS2013?

Another thing I've tried when i get libraries the programs that don't want to link due to incompatible project settings is to simply rebuild the projects from scratch (i.e. new project file and simply copy all the source code to the new project).
0
 
LVL 32

Expert Comment

by:sarabande
Comment Utility
a static library is a container of object modules which is equivalent to a folder containing object files. because of that, different compilers may produce different object code which cannot be linked together. for example if the vs2008 code calls a c++ function which is no longer available in vs2013 or has different arguments, the linker would not be able to solve this. worse,  a new compiler even could have changed the c++ name mangling (which puts some decoration around function names such that t

the best way out is to follow the advice HooKooDooKu gave and port the static library to vs2013. that solves the issue if the project builds correctly.

Sara
0
 

Author Closing Comment

by:BrianDumas
Comment Utility
I ended up scrapping it since time was running out. The 'Best Solution' got me the closest to having it fixed.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now