tags:

views:

62

answers:

2

Hi, I have a program that I am sharing with a third party. I will be providing a bin executable to them. It is written in c++ but uses some c as well. they are suggesting that it needs to be c only. Do you guys think this will be a problem since I will be compiling and building it on a sparc station that will somewhat match their system specs like solaris 9 and the chipset (32 or 64) depending on what they use?

is solaris 9 able to compile the c++ code that i used or do they need to add c++ runtime libraries on their end. I am using c++ std classes. in any event if i am building it all on my end why worry about what they have? its not a static/dynamic lib that i am sharing where i think that would come into play.

just curious since they are saying it needs to be a c compilation. I suspect if they are expecting a lib then perhaps I need to address that but if its just a executable then the system specs like os and chipset is all that matters?

if i am wrong in this assumption please let know where.

+1  A: 

Worst case you can always statically link in the C++ runtime library.

If you are only sending them an executable, I don't see why the language makes any difference whatsoever. If you're also sharing code, of course, that's an entirely different story.

+1  A: 

Since you're providing them with only an executable (no shared libraries), you shouldn't have too much trouble.

Just run a ldd command on your binary and see which C++ libraries it links against (you might see libstdc++ for instance, if you use g++); you should include those along with your executable. Don't rely on the user having them, they might be missing or might be incompatible. You will want to use the -rpath (linker switch) to make sure your binary will use the libraries you provide and not any library found in the system.

Also, it's better to compile on an older Solaris to provide compatibility, i.e. don't compile on Solaris 10 for Solaris 7, but on 7 for 10. You get the ideea...

Unknown
if i ran it on solaris 8 does that mean it will run on solaris 9?
Yes, provided that the target machine has all the required libraries for your application. See http://www.sun.com/software/solaris/guarantee.jsp andhttp://bit.ly/aGKKbF
Unknown
It would be useful to know if you're talking about using g++ or the Oracle/Sun C++ compiler. The runtime libraries for the Oracle/Sun compiler are always in /usr/lib, and they get patch updates for new releases of the compilers. You should not need to reship any shared libraries, but the end user might need to install the latest C++ library patches on their Solaris 9 system.
Chris Quenelle
I'm speaking of the GNU compiler; I have little experience with Sun's compilers and the stability of their C++ ABI. Yes, asking the user have C++ library patches installed is an option, as long as the library is compatible with the one used to create your application (as I said I don't know how much Sun is preserving this compatibility).
Unknown