LNK4221 and LNK4006 Warnings!

Posted by user295030 on Stack Overflow See other posts from Stack Overflow or by user295030
Published on 2010-03-22T22:44:28Z Indexed on 2010/03/22 22:51 UTC
Read the original article Hit count: 157

Filed under:

Hi, I basically making a static library of my own. I have taken my code which works and now put it into a static library for another program to use. In my library I am using another static library which I don't want the people who will be using my API to know. Since, I want to hide that information from them I can't tell them to install the other static library. Anyway, I used the command line Lib.exe to extract and create a smaller lib file of just the obj's I used. However, I get a bunch of "LNK4006 :second definition ignored" linker warnings for each obj I use followed by "LNK4221 no public symbols found;archive member will be inaccessible".

I am doing this work in vs2008 and I am not sure what I am doing wrong. I am using the #pragma comment line in my .cpp file I have also modified the librarian to add my smaller .lib along with its location. my code simply makes calls to a couple functions which it should be able to get from those Obj file in the smaller lib. All my functions are implemented in .cpp file and my header just have the includes of the third party header files and come standard c++ header files. nothing fancy. I have actually no function definitions in there atm. I was going to put the API definition in there and implement that in the .cpp for this static lib that i was going to make. However, I just wanted to build my code before I added more to it. s

Any help would be appreciated. is this a vs2008 configuration issue? or a program issue I am not sure.

thanks for the help!

© Stack Overflow or respective owner

Related posts about c++