It goes well when dynamic linking, using command like this:
      gcc -lssl error.o wrapsock.o wrapunix.o driverUtility.o driver.o -o
driver
then I want to link openssl lib statically so I do not need to install
openssl when  I run my application on another linux platform,but after I
change the command into this:
      gcc -static /usr/lib/libssl.a /usr/lib/libcrypto.a error.o wrapsock.o
wrapunix.o driverUtility.o driver.o -o driver
      I get these compile errors:
driver.o: In function `logout':
driver.c:(.text+0x16e): undefined reference to `SSL_library_init'
driver.c:(.text+0x173): undefined reference to `SSL_load_error_strings'
driver.c:(.text+0x178): undefined reference to `SSLv23_client_method'
driver.c:(.text+0x180): undefined reference to `SSL_CTX_new'
driver.c:(.text+0x1b8): undefined reference to `SSL_new'
driver.c:(.text+0x1fa): undefined reference to `SSL_set_fd'
driver.c:(.text+0x232): undefined reference to `SSL_connect'
driver.c:(.text+0x329): undefined reference to `SSL_write'
driver.c:(.text+0x378): undefined reference to `SSL_shutdown'
driver.c:(.text+0x38c): undefined reference to `SSL_free'
driver.c:(.text+0x39a): undefined reference to `SSL_CTX_free'
       I checked and found that there does exist /usr/lib/libssl.a
/usr/lib/libcrypto.a in my system, I don't konw why? Is there probably
something wrong with the /usr/lib/libssl.a /usr/lib/libcrypto.a? Can someone
tell me how to statically link openssl lib to my application?
 2009-11-04
------------------------------
zhujj

Reply via email to