Solved

static lib link errors VS2013

Posted on 2014-12-16
8
187 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
ID: 40503452
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
ID: 40503575
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
ID: 40503601
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
ID: 40504897
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 86

Accepted Solution

by:
jkr earned 400 total points
ID: 40505123
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
ID: 40505359
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 33

Expert Comment

by:sarabande
ID: 40506671
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
ID: 40513039
I ended up scrapping it since time was running out. The 'Best Solution' got me the closest to having it fixed.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
convert char array to number in c 5 83
What is MicroStrategy.NET? 2 58
Embarcadero WebBroker REST server endpoint parameters 2 54
gdb doesn't stop on breakpoint 2 51
When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

867 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

21 Experts available now in Live!

Get 1:1 Help Now