views:

181

answers:

1

I'm using a third party static library in my C++ project that has a dependency on libssl version 0.9.7a. Due to various reasons, the libssl version that my project used is 0.9.8e.

Everything was working fine, until the third party made a recent change to their static library. I wasn't able to successfully compile my application when it included this new version of the static library. The old version compiles fine.

I'm not very familiar with these library dependencies and their backwards compatibility. We were told that we must use the version suggested by the third party. I just want to know if that is really the reason. IMO, I guess it should be backwards compatible, shouldn't it?

Any direction with troubleshooting this issue is very much appreciated.

The following is the compilation error that I'm getting:

cc1plus: note: obsolete option -I- used, please use -iquote instead

In file included from /usr/include/openssl/e_os2.h:56,
                 from /usr/include/openssl/ssl.h:173,
                 from MyClass.cpp:28:

/usr/include/openssl/opensslconf.h:13:30: error: opensslconf-i386.h: No such file or directory
/usr/include/openssl/bn.h:288: error: expected ';' before '*' token
/usr/include/openssl/bn.h:304: error: 'BN_ULONG' does not name a type
/usr/include/openssl/bn.h:407: error: 'BN_ULONG' was not declared in this scope
/usr/include/openssl/bn.h:450: error: 'BN_ULONG' does not name a type
/usr/include/openssl/bn.h:451: error: 'BN_ULONG' does not name a type
/usr/include/openssl/bn.h:452: error: 'BN_ULONG' has not been declared
/usr/include/openssl/bn.h:453: error: 'BN_ULONG' has not been declared
/usr/include/openssl/bn.h:454: error: 'BN_ULONG' has not been declared
/usr/include/openssl/bn.h:455: error: 'BN_ULONG' has not been declared
/usr/include/openssl/bn.h:456: error: 'BN_ULONG' does not name a type
/usr/include/openssl/bn.h:471: error: 'BN_ULONG' has not been declared
/usr/include/openssl/bn.h:764: error: 'BN_ULONG' does not name a type
/usr/include/openssl/bn.h:765: error: 'BN_ULONG' does not name a type
/usr/include/openssl/bn.h:766: error: variable or field 'bn_sqr_words' declared void
/usr/include/openssl/bn.h:766: error: 'BN_ULONG' was not declared in this scope
/usr/include/openssl/bn.h:766: error: 'rp' was not declared in this scope
/usr/include/openssl/bn.h:766: error: expected primary-expression before 'const'
/usr/include/openssl/bn.h:766: error: expected primary-expression before 'int'
/usr/include/openssl/bn.h:767: error: 'BN_ULONG' does not name a type
/usr/include/openssl/bn.h:768: error: 'BN_ULONG' does not name a type
/usr/include/openssl/bn.h:769: error: 'BN_ULONG' does not name a type
/usr/include/openssl/ssl3.h:303: error: 'PQ_64BIT' does not name a type
/usr/include/openssl/pqueue.h:73: error: 'PQ_64BIT' does not name a type
/usr/include/openssl/pqueue.h:80: error: 'PQ_64BIT' was not declared in this scope
/usr/include/openssl/pqueue.h:80: error: expected primary-expression before 'void'
/usr/include/openssl/pqueue.h:89: error: 'PQ_64BIT' has not been declared
/usr/include/openssl/dtls1.h:92: error: 'PQ_64BIT' does not name a type
/usr/include/openssl/dtls1.h:94: error: 'PQ_64BIT' does not name a type

The error message says that there's no such file as opensslconf-i386.h, but it is indeed present.

Any idea what's going wrong?

Thanks for you time!

+1  A: 

The C pre-processor is not finding the opensslconf-i386.h file - so you need to find out why that is failing. You've got a warning from the compiler about using an obsolete option (and it recommends a fix) - do it.

OK - you say the file is present: where is it, and what are the permissions on it? How is it included by opensslconf.h? How is that line different from any other OpenSSL headers that are included. What are the '-I' options you are using other than the deprecated '-I-'?

At this stage, I'd say you've got either a faulty installation or an odd-ball command line.

And the question title is ... not obviously related to the question body.

  • At the operational level, yes, the two interwork for most purposes.
  • At the compilation level, yes, the two are basically compatible (that which worked in 0.9.7a should work with 0.9.8e).
  • At the internals and configuration level, there will be small differences; there may be extra ciphers or modes supported by the more recent version, for example.
Jonathan Leffler
@Jonathan: Thanks a lot for your reply! I think, I made a little progress with your suggestions. I wrote a sample client using the static library to test this problem in isolation and see if the sample client compiles fine (my application is a monster). The sample client compiled fine without any issues. So, the problem, as you suggested, seems to be the command-line. I will now have a look at the command line options being used, and get back to you if I've any doubts.
artknish
@Jonathan: I guess I found the root cause. The OpenSSL libraries were not included in the make file of my application. I added `/usr/include/openssl$` and my application is compiling fine.Thanks again for your help!
artknish
Glad you're up and running again.
Jonathan Leffler