Question

I am trying to compile a C file I have written that has the include #include <openssl/evp.h> on Solaris 10. The system OpenSSL files (including evp.h) are located under /usr/local/ssl/include/openssl, but I can't get them picked up running the following command:

gcc -O2 -fPIC -shared -static-libgcc -I$JAVA_HOME/include -I$JAVA_HOME/include/solaris -m64 -lcrypto -lm -std=c99 -o libencrypt64.so encrypt.c

I've tried adding the path to the headers to LD_LIBRARY_PATH and PATH but still get the same errors:

encrypt.c:54:25: openssl/evp.h: No such file or directory

... and the associated type's not found errors.

Can anyone tell me where I'm going wrong please?

Was it helpful?

Solution

I've never seen $JAVA_HOME explicitly put in a gcc command before. What is the value of $JAVA_HOME supposed to be?

Can you try adding the necessary path directly to the gcc command? Just add

-I/usr/local/ssl/include

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top