Linking C++ Static Libs

This is a discussion on Linking C++ Static Libs within the C++ Programming forums, part of the General Programming Boards category; Could use some direction here; I have a static lib I've created using the correct tools; I know this as ...

Linking C++ Static Libs

Could use some direction here; I have a static lib I've created using the correct tools; I know this as I have a working example test case. The only difference is the simple lib's syms are exported using extern and linked to a plain c prog. The actual use case is a c++ lib linked to a c++ program, so I've not wrapped the apis in extern braces. I've linked the calling app to the lib like this;

So the methods I'm interested are getting exported, and the name mangled polymorphic exports seem ok, but ld can't seem to get its glue on. What else should I be looking at? Should I just go ahead and wrap the methods for unmangled C export as in my test case, even though its a c++ to C++ link?

Are there any more typos you want to declare before anyone wastes anymore time chasing ghosts?
You should always copy/paste your evidence.

> If that were the actual problem the linker would say it can;t find the library, not that it couldn't find a symbol in the library no?
You could try -lthisfiledoesnotexist and see for yourself.
But my experience is that linkers do not typically complain about missing libraries.

I had to change the correct symbol names for contractual reasons. YOU KNOW that the symbol names aren't the issue, you just decided beating your shest and grunting was the easier response.
What's this output say to you??

I see a difference. Get the crap out of your eyes and stop with the snide, holier than thou nonsense. If you don't want to help then don't reply. I don't need some neckbeard hiding in his mother's basement need to lash out at the poor it girl who "can't figure it". I'll figure it out without your help apparently.

Are you using the same compiler to compile the static library as you are using to compile/link the client code?

If not, look up name mangling; because you can not mix C++ Compilers and always expect it to work.
Some GCC C++ versions break compatibilities with others.
Note, the problem is rare under GCC; but, sometimes it is caused by bugs under GCC.
But, nearly all different versions of MSVC++ are not name mangling compatible.

Note: If using an recent GCC 4.x, you might need to read up on visibility options.

"...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Sure, I have issues with ..............s. That 99% of them are men? Hey, that's not my doing.

Actually, you did the following:

* Assumed the participants in the conversation are of specific genders based on no evidence whatsoever
* Proceeded to characterize a board moderator as a "neckbeard" because he dared to ask for more detailed information
* Deliberately pointed out your own gender, as if it's relevant to the topic at hand.

Yes, I am a sexist, so what? Comes from years in IT having to deal with sexism. YEARS of it. But throw that aside for a second. My two previous posts were reasoned and DID include infomation indicating the name of the lib had nothing to do with the problem, but neckie there decided to thrown in two useless, time wasting comments;

Are there any more typos you want to declare before anyone wastes anymore time chasing ghosts?

Hateful remark, and completely unessessary.
And;

But my experience is that linkers do not typically complain about missing libraries.

Obviously wrong. Neckie is also illinformed. Yes, I took particular joy in pointing that out.
But I'm the sexist.

Unfortunately we know from experience that it is necessary. Too many times, people here have wasted HOURS trying to debug people's code only to find out that the code they posted was typed, from memory, while sitting on a toilet. Salem might have been a bit sarcastic about it, but sarcasm is something you seem familiar with so I'm not sure what your problem is.

Obviously wrong. Neckie is also illinformed. Yes, I took particular joy in pointing that out.

No, it is not obviously wrong. Linkers can not possibly know which library provides which symbol. Therefore a linker cannot give an error message of the form "You forgot to link with library X."

But I'm the sexist.

You introduced gender into a discussion for no conceivable reason. Honestly, I doubt not only your manners, but your mental stability.

Unfortunately we know from experience that it is necessary. Too many times, people here have wasted HOURS trying to debug people's code only to find out that the code they posted was typed

If you read the entire post, which isn't that long, that is obviously not the problem, the case is way too simpllistic for that to be an issue. I have one test case that works, and one, that doesn't. BOTH are ONE app linking to ONE lib. Period. How you extrapolate more out of what was given is beyond me.

Linkers can not possibly know which library provides which symbol.

LOOK AT THE CASE! I'm not sure how ANYONE could be confused by that.

You introduced gender into a discussion for no conceivable reason.

Yes, I did. THIS is the reason:

But my experience is that linkers do not typically complain about missing libraries.