linking a C program to C++ library with STL

I am trying to retrofit some C++ and STL functions into an existing QNX 6.3 C projects. I am encapsulating the C++ in a single library/project and referancing the “friend” functions via a C interface. This worked up till I included STL in the C++. Now my C projects (a C photon app and a cmdline C testapp, both include -lang-c++ in their common.mk LDFLAGS macro) spew errors about unresolved symbols, all with the signature “std::*”. I assume that I need to forcably include a STL runtime library in each referancing projects configuration, but do not know its name or path. Also, nothing that looks like it could be the runtime library shows up wen I search the c:\QNX630 folder for “stl”, just stl.h, stl.java and stl.html, no stl.a.

Thanks
Rob

Rob,

A couple of things:

  1. Something quick to try. In your C++ code that calls the STL functions, how are you referencing them? In other words do you have a std:: in front of the calls? gcc 2.9.5. didn’t require it but gcc 3.3.1 does. I’m just wondering if maybe all you need is a ‘using namespace std;’ line in top of your C++ files.

  2. Any chance you can just post your Makefile. That would make it a lot easier to see where you might have gone wrong. It doesn’t sound like you have a problem since your app links with your own C++ code.

Tim

Tim:
Not sure what I did other than use the same version of gcc on both the library and the test application.

It all links now so I’m happy.
Thanks.