Valon Lushaj
Valon Lushaj

Reputation: 61

C static program with gSoap

I'm trying to build a static program with gSoap.

I compile the program with the command:

gcc -c -Wall -g  -I./gSoap/   -I/usr/share/gsoap/plugin/    -c -o singlePayment.o singlePayment.c
gcc -o singlePayment singlePayment.o ./gSoap/soapC.c ./gSoap/soapClient.c  -lgsoapssl   -L/usr/lib/mysql -L/usr/lib -L/lib -lmysqlclient -lssl  -lz  -lcrypto -Wl,--no-as-needed -ldl -static -fno-stack-protector

Error after programm run:

 *** stack smashing detected ***: ./singlePayment terminated
======= Backtrace: =========
[0x6ee755]
[0x6ee71e]
[0x59aa2a]
[0x59ab34]
[0x57fcfe]
[0x400762]
[0x6aa4a3]
[0x400469]
======= Memory map: ========
00400000-00833000 r-xp 00000000 08:01 6687104                            /home/valon/paypalSOAP/singlePayment
00a32000-00a43000 rw-p 00432000 08:01 6687104                            /home/valon/paypalSOAP/singlePayment
00a43000-00a72000 rw-p 00000000 00:00 0
017e5000-01863000 rw-p 00000000 00:00 0                                  [heap]
7f2cc5007000-7f2cc501a000 r-xp 00000000 08:01 9962058                    /lib/x86_64-linux-gnu/libresolv-2.13.so
7f2cc501a000-7f2cc5219000 ---p 00013000 08:01 9962058

              ...

7ffe8ffe7000-7ffe8ffe8000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Abgebrochen

The same program works if i complie that as none static.

gcc -c -Wall -g  -I./gSoap/   -I/usr/share/gsoap/plugin/    -c -o singlePayment.o singlePayment.c
gcc -o singlePayment singlePayment.o ./gSoap/soapC.c ./gSoap/soapClient.c /usr/share/gsoap/plugin/logging.c   -lm -lgsoapssl -lssl

any idea why is this happening?

Upvotes: 0

Views: 167

Answers (1)

Dr. Alex RE
Dr. Alex RE

Reputation: 1698

It seems that you are using OpenSSL. If so, compile with gcc -DWITH_OPENSSL to make sure that you can use the soap_ssl_X functions, and the engine context declared in stdsoap2.h will be SSL-enabled.

Upvotes: 1

Related Questions