Avatar of Brian Dumas
Brian DumasFlag for United States of America

asked on 

static lib link errors VS2013

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
C++Microsoft Development

Avatar of undefined
Last Comment
Brian Dumas
Avatar of jkr
jkr
Flag of Germany image

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"?
Avatar of Brian Dumas
Brian Dumas
Flag of United States of America image

ASKER

Thanks for the Quick response jkr. I've attached a PDF  file with screen captures of the settings you asked for.
LIB-settings.pdf
Avatar of jkr
jkr
Flag of Germany image

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".
Avatar of Brian Dumas
Brian Dumas
Flag of United States of America image

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of HooKooDooKu
HooKooDooKu

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of sarabande
sarabande
Flag of Luxembourg image

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
Avatar of Brian Dumas
Brian Dumas
Flag of United States of America image

ASKER

I ended up scrapping it since time was running out. The 'Best Solution' got me the closest to having it fixed.
C++
C++

C++ is an intermediate-level general-purpose programming language, not to be confused with C or C#. It was developed as a set of extensions to the C programming language to improve type-safety and add support for automatic resource management, object-orientation, generic programming, and exception handling, among other features.

58K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo