I am having problem linking libssl.a libcrypto.a and my own lib to an application.

I began by building the SSL library on my x86 based Redhat 7 that was really straight forward.

Then I compiled my own library that is linked to libssl.a and libcrypto.a, so far so good...

Then as I started building my application I can not get the gcc or g++ to link to my library. At first I thought I was doing something silly... but then after lot of sweat and tears I tried to omit the code in my library that was using the ssl library and after that g++ could link my application to my library!

I have tried changing the include order and the only good that did was not to be able to link to the ssl library.

What is going on here?

Any comment appreciated... I have run out of ideas...

Ragnar Agustsson
Iceland

(I send  a part of my Makefile for reference.)

#
#  Makefile for Linux
#
TOP=                /home/ragnar/tpos3/source
CC=             gcc
INCLUDES=       -I. -I/usr/local/ssl/include
CCFLAGS=        $(INCLUDES) -Dunix -c -fexceptions
CCCFLAGS=       $(INCLUDES) -Dunix -fexceptions
#CCCFLAGS=       $(INCLUDES) -DNO_SSL -fexceptions
#CCFLAGS=        $(INCLUDES) -Dunix -c -fexceptions -fno-gnu-linker -traditional
#CCCFLAGS=       $(INCLUDES) -Dunix -fexceptions -fno-gnu-linker -traditional
EXECNAME=        tpos3client

LFLAGS=                ar rs

#(BTW. I moved the libs into my own directory and I used to use gcc)
tpos3client:                libTpos3.a tpos3client.cpp
                        $(CC) $(CCCFLAGS) -lstdc++ -L. -lssl -lcrypto tpos3client.cpp -lTpos3 -o $(EXECNAME)
tpos3clientNOSSL:        libTpos3.a tpos3client.cpp
                        $(CC) $(CCCFLAGS) -lstdc++ tpos3client.cpp -L. -lTpos3 -o $(EXECNAME)

all:                libTpos3.a



Reply via email to