I have some .c and .h files in my directory. My aim is to compile the whole file. I am compiling each and every .c file by
gcc -c file_name then I use gcc -o some_text file_name.
I have found out that some file starts with #ifdef UNIX. But UNIX is nowhere defined in either header file(.h file) it includes not in the file itself.
For the time being I am defining as #include UNIX in the file whereever required.
some of the files getting compiled by gcc -c file_name and creates coressponding object file. but when I try to use
gcc -o some_text file_name then get the following error.
/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/tmp/ccsbV9J2.o: In function `CCWebSSLPrintLastError':
CCWebSSL.c:(.text+0xfc): undefined reference to `CCWebLog'
CCWebSSL.c:(.text+0x12a): undefined reference to `ERR_get_error_line_data'
CCWebSSL.c:(.text+0x14e): undefined reference to `ERR_error_string_n'
CCWebSSL.c:(.text+0x24d): undefined reference to `CCWebLog'
/tmp/ccsbV9J2.o: In function `CCWebSSLVerifyCallBack':
CCWebSSL.c:(.text+0x274): undefined reference to `X509_STORE_CTX_get_current_cert'
CCWebSSL.c:(.text+0x281): undefined reference to `X509_STORE_CTX_get_error'
CCWebSSL.c:(.text+0x28d): undefined reference to `X509_get_subject_name'
CCWebSSL.c:(.text+0x29f): undefined reference to `X509_NAME_oneline'
CCWebSSL.c:(.text+0x2b5): undefined reference to `X509_get_issuer_name'
CCWebSSL.c:(.text+0x2c7): undefined reference to `X509_NAME_oneline'
/tmp/ccsbV9J2.o: In function `CCWebSSLClientPasswordCallBack':
CCWebSSL.c:(.text+0x334): undefined reference to `CCWebLog'
/tmp/ccsbV9J2.o: In function `CCWebSSLInitialization':
CCWebSSL.c:(.text+0x36f): undefined reference to `SSL_library_init'
CCWebSSL.c:(.text+0x374): undefined reference to `SSL_load_error_strings'
CCWebSSL.c:(.text+0x379): undefined reference to `CRYPTO_num_locks'
CCWebSSL.c:(.text+0x400): undefined reference to `pthread_mutexattr_init'
CCWebSSL.c:(.text+0x42b): undefined reference to `pthread_mutexattr_setpshared'
CCWebSSL.c:(.text+0x4cd): undefined reference to `pthread_mutexattr_destroy'
CCWebSSL.c:(.text+0x516): undefined reference to `CRYPTO_set_id_callback'
CCWebSSL.c:(.text+0x520): undefined reference to `CRYPTO_set_locking_callback'
CCWebSSL.c:(.text+0x531): undefined reference to `RAND_seed'
CCWebSSL.c:(.text+0x536): undefined reference to `RAND_status'
/tmp/ccsbV9J2.o: In function `CCWebSSLTermination':
CCWebSSL.c:(.text+0x55f): undefined reference to `CRYPTO_set_locking_callback'
CCWebSSL.c:(.text+0x59b): undefined reference to `CRYPTO_num_locks'
/tmp/ccsbV9J2.o: In function `CCWebSSLFreeSessionData':
CCWebSSL.c:(.text+0x5f6): undefined reference to `SSL_SESSION_free'
/tmp/ccsbV9J2.o: In function `CCWebSSL':
CCWebSSL.c:(.text+0xe8a): undefined reference to `SSLv23_client_method'
CCWebSSL.c:(.text+0xed2): undefined reference to `SSLv2_client_method'
CCWebSSL.c:(.text+0xf16): undefined reference to `SSLv3_client_method'
CCWebSSL.c:(.text+0xf67): undefined reference to `SSL_CTX_new'
CCWebSSL.c:(.text+0x1041): undefined reference to `SSL_CTX_set_cipher_list'
CCWebSSL.c:(.text+0x1065): undefined reference to `iConfigurationSSLCertificateCheck'
CCWebSSL.c:(.text+0x1080): undefined reference to `SSL_CTX_load_verify_locations'
CCWebSSL.c:(.text+0x10a9): undefined reference to `SSL_CTX_set_verify'
CCWebSSL.c:(.text+0x10b5): undefined reference to `SSL_new'
CCWebSSL.c:(.text+0x10e7): undefined reference to `SSL_set_fd'
CCWebSSL.c:(.text+0x1108): undefined reference to `SSL_get_error'
CCWebSSL.c:(.text+0x1239): undefined reference to `SSL_set_session'
CCWebSSL.c:(.text+0x1280): undefined reference to `SSL_connect'
CCWebSSL.c:(.text+0x12bd): undefined reference to `SSL_get_error'
CCWebSSL.c:(.text+0x1326): undefined reference to `SSL_shutdown'
CCWebSSL.c:(.text+0x1332): undefined reference to `SSL_free'
CCWebSSL.c:(.text+0x1349): undefined reference to `SSL_CTX_free'
CCWebSSL.c:(.text+0x13ca): undefined reference to `CCWebLog'
CCWebSSL.c:(.text+0x1643): undefined reference to `SSL_get_verify_result'
CCWebSSL.c:(.text+0x168d): undefined reference to `CCWebLog'
CCWebSSL.c:(.text+0x16ad): undefined reference to `SSL_SESSION_free'
CCWebSSL.c:(.text+0x17bd): undefined reference to `SSL_shutdown'
CCWebSSL.c:(.text+0x17c9): undefined reference to `SSL_free'
CCWebSSL.c:(.text+0x17e0): undefined reference to `SSL_CTX_free'
CCWebSSL.c:(.text+0x1810): undefined reference to `SSL_get_verify_result'
CCWebSSL.c:(.text+0x18de): undefined reference to `SSL_get_session'
CCWebSSL.c:(.text+0x1979): undefined reference to `SSL_SESSION_free'
CCWebSSL.c:(.text+0x1a97): undefined reference to `SSL_get1_session'
CCWebSSL.c:(.text+0x1c6e): undefined reference to `SSL_SESSION_free'
CCWebSSL.c:(.text+0x1cb5): undefined reference to `CCWebCookieString'
CCWebSSL.c:(.text+0x24b2): undefined reference to `iDumpLevel'
CCWebSSL.c:(.text+0x24d3): undefined reference to `CCWebLog'
CCWebSSL.c:(.text+0x2514): undefined reference to `SSL_write'
CCWebSSL.c:(.text+0x2546): undefined reference to `SSL_get_error'
CCWebSSL.c:(.text+0x2775): undefined reference to `SSL_pending'
CCWebSSL.c:(.text+0x29aa): undefined reference to `SSL_read'
CCWebSSL.c:(.text+0x29e6): undefined reference to `SSL_get_error'
CCWebSSL.c:(.text+0x2ced): undefined reference to `iDumpLevel'
CCWebSSL.c:(.text+0x2d02): undefined reference to `iDumpLevel'
CCWebSSL.c:(.text+0x2d20): undefined reference to `iDumpLevel'
CCWebSSL.c:(.text+0x2d32): undefined reference to `iDumpLevel'
CCWebSSL.c:(.text+0x2d4a): undefined reference to `iDumpLevel'
/tmp/ccsbV9J2.o:CCWebSSL.c:(.text+0x2d55): more undefined references to `iDumpLevel' follow
/tmp/ccsbV9J2.o: In function `CCWebSSL':
CCWebSSL.c:(.text+0x2d81): undefined reference to `CCWebLog'
CCWebSSL.c:(.text+0x2d87): undefined reference to `iDumpLevel'
CCWebSSL.c:(.text+0x2d92): undefined reference to `iDumpLevel'
CCWebSSL.c:(.text+0x2dd1): undefined reference to `CCWebLog'
CCWebSSL.c:(.text+0x2df7): undefined reference to `ERR_remove_state'
CCWebSSL.c:(.text+0x2e03): undefined reference to `SSL_shutdown'
CCWebSSL.c:(.text+0x2e27): undefined reference to `SSL_free'
CCWebSSL.c:(.text+0x2e4b): undefined reference to `SSL_CTX_free'
collect2: ld returned 1 exit status
Thanks