LNK4221 and LNK4006
I am making a static lib of my own. I took a third party lib to make my code and want basically included that as another lib in my static lib project in vs2008. Can anyone tell me how do i get rid of these?
I usually get a the lnk4006 for every function in the obj followed by a lnk4221 for that obj.
I am just not sure what I am doing wrong. is it the vs2008 config settings? something i am missing?the code is very straight forward that just calls some function from this third party lib and that i do in the .cpp. the .h just has the api in it and all the include file as well as the param for the lib i am using. just need some help on this as I can't seem to get these to go away. i am at a loss here.
LNK4221: no public symbols found; archive member will be inaccessible.
LNK4006......second definition ignored.
Every function in your lib or every function in the third-party lib?
(And I'm just going to assume for now that the license for the third-party lib allows redistribution....)
every function in the third party lib. none of mine.
and yes its a free lib that can be used by anyone. does that help?
I am not currently sitting at a machine with VS on it, so I don't remember the exact clicks, but you're looking for something like project -> properties -> C/C++ -> linker. Somewhere you need to specify the .lib file as a file that gets linked into your project.
Looking it up at MSDN gives .lib Files as Linker Input.
if the solution is a static lib it has somerthing called a librarian that you can set the lib for any dependancies which i did. it does not have the linker option in it. I think if it were some other type of application type other than static lib than those solutions properties has the linker option.
so some of the things i did was have the paragma option with my lib.
I also have it in the librarian
I also found this....
seems like just by adding a resource to my static lib...in this case this third party lib you get the linker warnings.
I am not sure what the solution would be for that......
Check whether you can compile your program as EXE, not LIB. If everything is ok with EXE, then perhaps it is an exporting issue of your code and 3rd party headers. Give some more info about 1-2 exact functions and what the errors are.