TKD
asked on
mipsel-uclibc-gcc compiles gSOAP project without finding openssl
Hi experts,
I modify the webserver sample in gSOAP sample directory and compile it with gcc compiler. It is successful. But now I use cross-compiler mipsel-uclibc-gcc to compile the webserver sample. The mipsel-uclibc-gcc compiler shows me the error message:
-------------------------- ---------- ---------- ---------- ---------- -------
mipsel-uclibc-gcc -Wall -O2 -I../.. -I../../plugin -I. -L. -DDEBUG -DWITH_OPENSSL -DWITH_COOKIES -D wchar_t="unsigned int" -c ../../plugin/logging.c
In file included from ../../plugin/logging.h:53,
from ../../plugin/logging.c:29:
../../stdsoap2.h:568:26: openssl/bio.h: No such file or directory
../../stdsoap2.h:569:26: openssl/err.h: No such file or directory
../../stdsoap2.h:570:27: openssl/rand.h: No such file or directory
../../stdsoap2.h:571:26: openssl/ssl.h: No such file or directory
../../stdsoap2.h:572:29: openssl/x509v3.h: No such file or directory
../../stdsoap2.h:575:5: #error "Must use OpenSSL 0.9.6 or later"
In file included from ../../plugin/logging.h:53,
from ../../plugin/logging.c:29:
../../stdsoap2.h:1688: parse error before "X509_STORE_CTX"
../../stdsoap2.h:1689: warning: no semicolon at end of struct or union
../../stdsoap2.h:1690: warning: type defaults to `int' in declaration of `ssl'
../../stdsoap2.h:1690: warning: data definition has no type or storage class
../../stdsoap2.h:1691: parse error before '*' token
../../stdsoap2.h:1691: warning: type defaults to `int' in declaration of `ctx'
../../stdsoap2.h:1691: warning: data definition has no type or storage class
../../stdsoap2.h:1700: parse error before '*' token
../../stdsoap2.h:1700: warning: type defaults to `int' in declaration of `session'
../../stdsoap2.h:1700: warning: data definition has no type or storage class
../../stdsoap2.h:1728: parse error before '}' token
../../plugin/logging.c: In function `logging_init':
../../plugin/logging.c:55: dereferencing pointer to incomplete type
../../plugin/logging.c:56: dereferencing pointer to incomplete type
../../plugin/logging.c:57: dereferencing pointer to incomplete type
../../plugin/logging.c:58: dereferencing pointer to incomplete type
make: *** [logging.o] Error 1
-------------------------- ---------- ---------- ---------- ---------- -------
I try to add the [-I/usr/include/openssl] to solve this problem, but the error message stll exists.
What should I do?
I modify the webserver sample in gSOAP sample directory and compile it with gcc compiler. It is successful. But now I use cross-compiler mipsel-uclibc-gcc to compile the webserver sample. The mipsel-uclibc-gcc compiler shows me the error message:
--------------------------
mipsel-uclibc-gcc -Wall -O2 -I../.. -I../../plugin -I. -L. -DDEBUG -DWITH_OPENSSL -DWITH_COOKIES -D wchar_t="unsigned int" -c ../../plugin/logging.c
In file included from ../../plugin/logging.h:53,
from ../../plugin/logging.c:29:
../../stdsoap2.h:568:26: openssl/bio.h: No such file or directory
../../stdsoap2.h:569:26: openssl/err.h: No such file or directory
../../stdsoap2.h:570:27: openssl/rand.h: No such file or directory
../../stdsoap2.h:571:26: openssl/ssl.h: No such file or directory
../../stdsoap2.h:572:29: openssl/x509v3.h: No such file or directory
../../stdsoap2.h:575:5: #error "Must use OpenSSL 0.9.6 or later"
In file included from ../../plugin/logging.h:53,
from ../../plugin/logging.c:29:
../../stdsoap2.h:1688: parse error before "X509_STORE_CTX"
../../stdsoap2.h:1689: warning: no semicolon at end of struct or union
../../stdsoap2.h:1690: warning: type defaults to `int' in declaration of `ssl'
../../stdsoap2.h:1690: warning: data definition has no type or storage class
../../stdsoap2.h:1691: parse error before '*' token
../../stdsoap2.h:1691: warning: type defaults to `int' in declaration of `ctx'
../../stdsoap2.h:1691: warning: data definition has no type or storage class
../../stdsoap2.h:1700: parse error before '*' token
../../stdsoap2.h:1700: warning: type defaults to `int' in declaration of `session'
../../stdsoap2.h:1700: warning: data definition has no type or storage class
../../stdsoap2.h:1728: parse error before '}' token
../../plugin/logging.c: In function `logging_init':
../../plugin/logging.c:55:
../../plugin/logging.c:56:
../../plugin/logging.c:57:
../../plugin/logging.c:58:
make: *** [logging.o] Error 1
--------------------------
I try to add the [-I/usr/include/openssl] to solve this problem, but the error message stll exists.
What should I do?
Do the headers being referenced actually exist int he openssl folder? Have you installed the openssl development package?
ASKER
I can confirm that those headers are in /usr/include/openssl/ .
What is "openssl development package"?
I can compile the source code with gcc compile. But I don't know why I need to install that.
What is "openssl development package"?
I can compile the source code with gcc compile. But I don't know why I need to install that.
Are you using the same compiler options for both compilers ? More specifically, does the cross compiler search in /usr/include for header files ?
>> What is "openssl development package"?
Some Linux distro's have separate user and development packages for some libraries. As long as you have the headers you need then this should compile.
>> I try to add the [-I/usr/include/openssl] to solve this problem
How did you do this? Modify the make file?
Some Linux distro's have separate user and development packages for some libraries. As long as you have the headers you need then this should compile.
>> I try to add the [-I/usr/include/openssl] to solve this problem
How did you do this? Modify the make file?
ASKER
Yes. I modify the Makefile.
GSOAP=../../bin/soapcpp2
SOAPH=../../stdsoap2.h
SOAPC=../../stdsoap2.c
CC=mipsel-uclibc-gcc
#CC=gcc
LIBS=-lz -lrt -ldl -lssl -lcrypto -lsqlite3
COFLAGS=-O2
CWFLAGS=-Wall
CIFLAGS=-I../.. -I../../plugin -I. -I /usr/include/openssl -L.
CMFLAGS=-DDEBUG -DWITH_OPENSSL -DWITH_COOKIES
CFLAGS= $(CWFLAGS) $(COFLAGS) $(CIFLAGS) $(CMFLAGS) -D wchar_t="unsigned int"
all: tr069
tr069: tr069.c tr069.h logging.o httpget.o httpform.o httpda.o md5evp.o $(SOAPH) $(SOAPC)
$(GSOAP) -c -I../../import tr069.h
$(CC) $(CFLAGS) -o tr069 tr069.c logging.o httpget.o httpform.o httpda.o md5evp.o soapC.c soapClient.c soapServer.c $(SOAPC) $(LIBS)
logging.o: ../../plugin/logging.h ../../plugin/logging.c
$(CC) $(CFLAGS) -c ../../plugin/logging.c
httpget.o: ../../plugin/httpget.h ../../plugin/httpget.c
$(CC) $(CFLAGS) -c ../../plugin/httpget.c
httpform.o: ../../plugin/httpform.h ../../plugin/httpform.c
$(CC) $(CFLAGS) -c ../../plugin/httpform.c
httpda.o: ../../plugin/httpda.h ../../plugin/httpda.c
$(CC) $(CFLAGS) -c ../../plugin/httpda.c
md5evp.o: ../../plugin/md5evp.h ../../plugin/md5evp.c
$(CC) $(CFLAGS) -c ../../plugin/md5evp.c
clean:
rm -f *.o soapH.h soapStub.h soapC.cpp soapC.c soapClient.cpp soapClient.c soapServer.cpp soapServer.c soap*Proxy.h
distclean:
rm -f *.o *.wsdl *.xsd *.xml *.nsmap *.log soapH.h soapStub.h soapC.cpp soapC.c soapClient.cpp soapClient.c soapServer.cpp soapServer.c soapClientLib.c soapClientLib.cpp soapServerLib.c soapServerLib.cpp soap*Proxy.h tr069
ASKER
I add the [-I/usr/include/openssl] in CIFLAGS.
CIFLAGS=-I../.. -I../../plugin -I. -I/usr/include/openssl -L.
The output from your compiler doesn't show this as being added. Was this the complete output?
"mipsel-uclibc-gcc -Wall -O2 -I../.. -I../../plugin -I. -L. -DDEBUG -DWITH_OPENSSL -DWITH_COOKIES -D wchar_t="unsigned int" -c ../../plugin/logging.c"
"mipsel-uclibc-gcc -Wall -O2 -I../.. -I../../plugin -I. -L. -DDEBUG -DWITH_OPENSSL -DWITH_COOKIES -D wchar_t="unsigned int" -c ../../plugin/logging.c"
ASKER
That is the original error message. After I add the [-I/usr/include/openssl], the error message is the same.
Also, you should add -I/usr/include, since you already specify the openssl directory in etc.
ASKER
Look:
mipsel-uclibc-gcc -Wall -O2 -I../.. -I../../plugin -I. -I/usr/include/openssl -L. -DDEBUG -DWITH_OPENSSL -DWITH_COOKIES -D wchar_t="unsigned int" -c ../../plugin/logging.c
In file included from ../../plugin/logging.h:53,
from ../../plugin/logging.c:29:
../../stdsoap2.h:568:26: openssl/bio.h: No such file or directory
../../stdsoap2.h:569:26: openssl/err.h: No such file or directory
../../stdsoap2.h:570:27: openssl/rand.h: No such file or directory
../../stdsoap2.h:571:26: openssl/ssl.h: No such file or directory
../../stdsoap2.h:572:29: openssl/x509v3.h: No such file or directory
../../stdsoap2.h:575:5: #error "Must use OpenSSL 0.9.6 or later"
In file included from ../../plugin/logging.h:53,
from ../../plugin/logging.c:29:
../../stdsoap2.h:1688: parse error before "X509_STORE_CTX"
../../stdsoap2.h:1689: warning: no semicolon at end of struct or union
../../stdsoap2.h:1690: warning: type defaults to `int' in declaration of `ssl'
../../stdsoap2.h:1690: warning: data definition has no type or storage class
../../stdsoap2.h:1691: parse error before '*' token
../../stdsoap2.h:1691: warning: type defaults to `int' in declaration of `ctx'
../../stdsoap2.h:1691: warning: data definition has no type or storage class
../../stdsoap2.h:1700: parse error before '*' token
../../stdsoap2.h:1700: warning: type defaults to `int' in declaration of `session'
../../stdsoap2.h:1700: warning: data definition has no type or storage class
../../stdsoap2.h:1728: parse error before '}' token
../../plugin/logging.c: In function `logging_init':
../../plugin/logging.c:55: dereferencing pointer to incomplete type
../../plugin/logging.c:56: dereferencing pointer to incomplete type
../../plugin/logging.c:57: dereferencing pointer to incomplete type
../../plugin/logging.c:58: dereferencing pointer to incomplete type
make: *** [logging.o] Error 1
>> That is the original error message. After I add the [-I/usr/include/openssl], the error message is the same.
Then your modification to the makefile can't be correct. The compiler isn't seeing the instruction to include the openssl directory in its include search path. You can test this by executing the command yourself with that bit added.
mipsel-uclibc-gcc -Wall -O2 -I../.. -I../../plugin -I. -I/usr/include/openssl -L. -DDEBUG -DWITH_OPENSSL -DWITH_COOKIES -D wchar_t="unsigned int" -c ../../plugin/logging.c
Try executing that line by itself (note, you may have to remove any formatting chars embedded by EE).
Then your modification to the makefile can't be correct. The compiler isn't seeing the instruction to include the openssl directory in its include search path. You can test this by executing the command yourself with that bit added.
mipsel-uclibc-gcc -Wall -O2 -I../.. -I../../plugin -I. -I/usr/include/openssl -L. -DDEBUG -DWITH_OPENSSL -DWITH_COOKIES -D wchar_t="unsigned int" -c ../../plugin/logging.c
Try executing that line by itself (note, you may have to remove any formatting chars embedded by EE).
ASKER
Infinity08:
After I add -I/usr/include, the mipsel-uclibc-gcc shows me another error message:
After I add -I/usr/include, the mipsel-uclibc-gcc shows me another error message:
mipsel-uclibc-gcc -Wall -O2 -I../.. -I../../plugin -I. -I/usr/include -I/usr/include/openssl -L. -DDEBUG -DWITH_OPENSSL -DWITH_COOKIES -D wchar_t="unsigned int" -c ../../plugin/logging.c
/usr/include/bits/mathinline.h: In function `atan2':
/usr/include/bits/mathinline.h:426: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `atan2f':
/usr/include/bits/mathinline.h:426: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `atan2l':
/usr/include/bits/mathinline.h:426: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `__atan2l':
/usr/include/bits/mathinline.h:427: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `fmod':
/usr/include/bits/mathinline.h:430: unknown register name `ax' in `asm'
/usr/include/bits/mathinline.h: In function `fmodf':
/usr/include/bits/mathinline.h:430: unknown register name `ax' in `asm'
/usr/include/bits/mathinline.h: In function `fmodl':
/usr/include/bits/mathinline.h:430: unknown register name `ax' in `asm'
/usr/include/bits/mathinline.h: In function `atan':
/usr/include/bits/mathinline.h:467: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `atanf':
/usr/include/bits/mathinline.h:467: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `atanl':
/usr/include/bits/mathinline.h:467: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `log1p':
/usr/include/bits/mathinline.h:540: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `log1pf':
/usr/include/bits/mathinline.h:540: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `log1pl':
/usr/include/bits/mathinline.h:540: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `asinh':
/usr/include/bits/mathinline.h:540: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `asinhf':
/usr/include/bits/mathinline.h:540: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `asinhl':
/usr/include/bits/mathinline.h:540: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `atanh':
/usr/include/bits/mathinline.h:540: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `atanhf':
/usr/include/bits/mathinline.h:540: unknown register name `st(1)' in `asm'
/usr/include/bits/mathinline.h: In function `atanhl':
/usr/include/bits/mathinline.h:540: unknown register name `st(1)' in `asm'
make: *** [logging.o] Error 1
>> Look
Oh, ok it is there :)
How is openssl/bio.h beling included? Is it like this...
#include "openssl/bio.h"
or like this
#include
Have you tried writing a small test program of your own to try including these headers to see if you can get it to build?
Otherwise, I am stumped :) I8, any ideas?
Oh, ok it is there :)
How is openssl/bio.h beling included? Is it like this...
#include "openssl/bio.h"
or like this
#include
Have you tried writing a small test program of your own to try including these headers to see if you can get it to build?
Otherwise, I am stumped :) I8, any ideas?
Ah, inline assembler ... That will be a bit more difficult with a cross compiler ;)
You'll have to port the code to the target system (especially the inline assembler).
>> Also, you should add -I/usr/include, since you already specify the openssl directory
Ah yes, good point -- doh!
Ah yes, good point -- doh!
Yeah, just read that -- good spot :)
ASKER
Hi, evilrix:
It is like this...
#include
I don't write a small test program.
Thank you.
It is like this...
#include
I don't write a small test program.
Thank you.
>> #include
Yeah, I8 has spotted the problem. I should have spotted it too, but hey -- we all have off days :)
Yeah, I8 has spotted the problem. I should have spotted it too, but hey -- we all have off days :)
ASKER
I delete the [-I/usr/include -I/usr/include/openssl] and solve this problem by copying the openssl directory in /usr/include/ to the include directory of cross compiler directory.
>> and solve this problem by copying the openssl directory in /usr/include/ to the include directory of cross compiler directory.
The OpenSSL library has been installed with its headers in the /usr/include directory. It's more proper to keep them there, and to reference them there (in case the OpenSSL library is upgraded for example, and its headers change).
The OpenSSL library has been installed with its headers in the /usr/include directory. It's more proper to keep them there, and to reference them there (in case the OpenSSL library is upgraded for example, and its headers change).
ASKER
Hi, Infinity08:
I think that you're right. When I reference them, I get the error message about "mathinline.h". I need to tell the compiler to link to /opt/brcm/hndtools-mipsel- uclibc-3.2 .3/include /bits/math inline.h not /usr/include/bits/mathinli ne.h. What should I do? Thank you.
I think that you're right. When I reference them, I get the error message about "mathinline.h". I need to tell the compiler to link to /opt/brcm/hndtools-mipsel-
>> I need to tell the compiler to link to /opt/brcm/hndtools-mipsel- uclibc-3.2 .3/include /bits/math inline.h not /usr/include/bits/mathinli ne.h. What should I do? Thank you.
You mean you want to use the standard includes for OpenSSL, but the cross compiler specific includes for mathinline.h ?
You mean you want to use the standard includes for OpenSSL, but the cross compiler specific includes for mathinline.h ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi,Infinity08:
Thank you. After I put [-I/opt/brcm/hndtools-mips el-uclibc- 3.2.3/incl ude -I/usr/include] in that order, I solve this problem.
Thank you. After I put [-I/opt/brcm/hndtools-mips
ASKER
It is so useful for me. Thank you.