   Linking a Library within a Library that has externs
  Hello,Im creating a library to interface into drawing a specific file type.  This library needs to pull in a 3rd party library to do some processing on this specific file type.  This 3rd party lib requires the users of it to create some extern functions that it uses to make data types on target hardware.So, it looks like this:------------| | | 3rd Party | |   Lib| | | ------------ | |\/------------| | |  My Lib   | |-----------| |  externs  | ------------ | |\/------------| | |  My App   | | | | | ------------My App calls My Lib and says "draw me file X", My Lib does a bunch of junk eventually calling 3rd Party Lib and says "process file X".  3rd Party Lib requires several externs to be declared that it uses.I made all these externs inside My Lib.  My problem is, when I link My App, its telling me undefined references to all the extern functions.  I can't figure out why.  Heres one of the externs inside My Lib to be called by 3rd Party Lib:// inside typeConversions.cextern int CreateShort(short* shortList, int numShorts){int i;for(i = 0; i < numShorts; i++){BYTE_SWAP_SHORT(shortList);}return ERROR_OK;}When I link My App I get (among several other similar errors):open.cpp: undefined reference to `CreateShort'Where open.cpp is inside the 3rd Party Lib.I have both My Lib and 3rd Party Lib included in My App.  Ideally, I want to not expose users of My Lib to 3rd Party Lib, so for example My App would not have to include 3rd Party Lib at all, they dont know it even exists.  All that should be exposed is My Lib.  Is this possible?  Anyone know how to fix my problem?   
  Your idea is sound. I just tried it out on Visual Studio 2005 by the following steps:1.) Created a new solution2.) Added two static lib projects and a Win32 executable project3.) Added a single cpp file to each lib3.) Placed a call to a function "MyFunction()" in the first lib4.) Added the line:extern "C" void MyFunction();To tell the compiler that "MyFunction" will be found at link time (i.e. it is "non-static"), with the "C" modifier to tell the compiler to leave off C++ symbol decoration.5.) Created the function:extern "C" void MyFunction() {}In the cpp file of the second lib.The linker joined the two libs just fine.Can you provide some information on your setup: the development environment you're using, and how you are building and linking the files.Also: don't forget about your option of using a DLL for your intermediate library, if that may fit your deployment better.   ;  Sorry, forgot to mention I'm using Eclipse 3.3.0 and My Lib is written in C.  If I put " extern "C" " I get parse errors when compiling My Lib.I dont have any special flags set in the make properties, is there anything I should do in there?  I've tried setting the -static flag, but that doesn't seem to do anything.   