473,387 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Error Log while compilation

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
Aug 5 '08 #1
3 3258
JosAH
11,448 Expert 8TB
Try to compile and link all your files in one go:

Expand|Select|Wrap|Line Numbers
  1. gcc *.c -o outputfile
  2.  
If that UNIX flag isn't defined anywhere and you're not on a Unix box: fine; otherwise
define it yourself on the compiler's command line:

Expand|Select|Wrap|Line Numbers
  1. gcc -DUNIX *.c -o outputfile
  2.  
kind regards,

Jos
Aug 5 '08 #2
weaknessforcats
9,208 Expert Mod 8TB
I assume some_text_file_name includes all of the necessary headers. Yes?

Undefined references are caused by using something the compiler has neither seen declared not defined.
Aug 5 '08 #3
JosAH
11,448 Expert 8TB
I assume some_text_file_name includes all of the necessary headers. Yes?

Undefined references are caused by using something the compiler has neither seen declared not defined.
I'm afraid the OP is trying to compile and link each file separately.

kind regards,

Jos
Aug 5 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Sune | last post by:
Hi, previously I used Eclipse CDT for compiling my files just to get started with C and leave C++ behind. Now it's time to get a little more serious so I've moved my files to a new workplace and...
10
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
0
by: psilu | last post by:
Hi , I have created a virtual directory and copied my web services file to corresponding physical directory. But when i am trying to discover the webservice from virtual directory i am getting...
2
by: tshad | last post by:
This has been driving me crazy. I have been trying to get the error handling working on my system and can get parts of it working and others won't work at all. I found that you can't access...
2
by: Balasubramanian Ramanathan | last post by:
I am getting this error while precompiling a website for deployment. Errorstack information error ASPRUNTIME: Object '/c107cdc3_b65c_4b6c_9d8f_82fe5a457fdb/ctofbyvagqsbvrgsc7xzxa5o_9.rem' has...
0
by: roger23 | last post by:
I get this error C:\Program Files\MSBuild\Microsoft\WebDeployment\v8.0\Microsoft.WebDeployment.targets(526,9): error MSB6006: "aspnet_compiler.exe" exited with code 1. at the end of my build...
21
by: Mark Rae | last post by:
Hi, I have an ASP.NET 2 web application (not web site) project and am using a web deployment project to deploy to the testing, then the production server. All has been working well for months...
0
by: dankyy1 | last post by:
hi ,i have an asp.net project runs on local intranet ,i use global.asax's onerror section to catch errors.so i got a simpleauth service does not exists error from some network clients .Error details...
7
by: news.microsoft.com | last post by:
I have an asp.net 2.0 project that when I change the build configuration to release I get the following error: Command line error BC2014: the value 'None' is invalid for option 'debug'. If I...
3
by: Hill | last post by:
This is an simple map, just an exercise. Who can help me fix this compile issue?Thanks in advance. #include <string> #include <vector> #include <iostream> using std::vector; using std::string;...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.