make issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello once again,
I
 am a beginner in using pjsip. I researched the documents given on the 
website and other forums. However i could not find the solution to the 
problem which is :undefined reference to "various functions"
I have build my linux using the GNU build system 
I have build by following the steps as
1.  ./configure
2. make dep
3. make

all
 goes well to this point. Now I move to building my own application 
using PJSIP with GNU tools , wherein I create a directory "myfile" and 
put both my source code and make file within this directory. The path to
 this directory is 

:~/projects/pjsip/new/pjproject-2.3/pjsip/myfile$
:~/projects/pjsip/new/pjproject-2.3/pjsip/myfile$ls
icedemotest.c  makefile

the makefile contains the following code as directed in the manual.I am using version 2.3 so the make file is as follows

[code]

all: icedemotest

icedemotest:icedemotest.c
    $(CC) -o $@ $< `pkg-config --cflags --libs libpjproject`

clean:
    rm -f icedemotest.o icedemotest

[/code]


now
 when i run make it returns an error stating undefined reference to 
various files .I am posting the error here. As far as i can think of it 
might be an issue with not linking to the library so it shows error. SO 
please help me with this problem. I have a long way to go but i am stuck
 at the start.
Thanks for any kind response. Waiting eagerly for a reply....


~/projects/pjsip/new/pjproject-2.3/pjsip/myfile$ make
cc     icedemotest.c   -o icedemotest
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12
/usr/bin/ld:
 /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 9
 has invalid symbol index 
13                                                                          
  
/usr/bin/ld: 
/usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 10
 has invalid symbol index 
13                                                                         
  
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 20 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 21 has invalid symbol index 22
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
/tmp/ccR1Z0pn.o: In function `icedemo_perror':
icedemotest.c:(.text+0x5f): undefined reference to `pj_strerror'
icedemotest.c:(.text+0x67): undefined reference to `pj_log_get_level'
icedemotest.c:(.text+0x8d): undefined reference to `pj_log_1'
/tmp/ccR1Z0pn.o: In function `err_exit':
icedemotest.c:(.text+0xc3): undefined reference to `pj_log_get_level'
icedemotest.c:(.text+0xdc): undefined reference to `pj_log_3'
icedemotest.c:(.text+0xf2): undefined reference to `pj_ice_strans_destroy'
icedemotest.c:(.text+0xfe): undefined reference to `pj_thread_sleep'
icedemotest.c:(.text+0x11e): undefined reference to `pj_thread_join'
icedemotest.c:(.text+0x12b): undefined reference to `pj_thread_destroy'
icedemotest.c:(.text+0x141): undefined reference to `pj_ioqueue_destroy'
icedemotest.c:(.text+0x157): undefined reference to `pj_timer_heap_destroy'
icedemotest.c:(.text+0x163): undefined reference to `pj_caching_pool_destroy'
icedemotest.c:(.text+0x168): undefined reference to `pj_shutdown'
/tmp/ccR1Z0pn.o: In function `handle_events':
icedemotest.c:(.text+0x1f1): undefined reference to `pj_timer_heap_poll'
icedemotest.c:(.text+0x281): undefined reference to `pj_ioqueue_poll'
icedemotest.c:(.text+0x28f): undefined reference to `pj_get_netos_error'
icedemotest.c:(.text+0x2a8): undefined reference to `pj_thread_sleep'
/tmp/ccR1Z0pn.o: In function `cb_on_rx_data':
icedemotest.c:(.text+0x351): undefined reference to `pj_log_get_level'
icedemotest.c:(.text+0x378): undefined reference to `pj_sockaddr_print'
icedemotest.c:(.text+0x3ac): undefined reference to `pj_log_3'
/tmp/ccR1Z0pn.o: In function `cb_on_ice_complete':
icedemotest.c:(.text+0x406): undefined reference to `pj_log_get_level'
icedemotest.c:(.text+0x42a): undefined reference to `pj_log_3'
icedemotest.c:(.text+0x44d): undefined reference to `pj_strerror'
icedemotest.c:(.text+0x455): undefined reference to `pj_log_get_level'
icedemotest.c:(.text+0x47b): undefined reference to `pj_log_1'
icedemotest.c:(.text+0x486): undefined reference to `pj_ice_strans_destroy'
/tmp/ccR1Z0pn.o: In function `log_func':
icedemotest.c:(.text+0x4c2): undefined reference to `pj_log_write'
/tmp/ccR1Z0pn.o: In function `icedemo_init':
icedemotest.c:(.text+0x52c): undefined reference to `pj_log_set_log_func'
icedemotest.c:(.text+0x531): undefined reference to `pj_init'
icedemotest.c:(.text+0x552): undefined reference to `pjlib_util_init'
icedemotest.c:(.text+0x573): undefined reference to `pjnath_init'
icedemotest.c:(.text+0x5ab): undefined reference to `pj_caching_pool_init'
icedemotest.c:(.text+0x5b7): undefined reference to `pj_ice_strans_cfg_default'
icedemotest.c:(.text+0x5ed): undefined reference to `pj_pool_create'
icedemotest.c:(.text+0x60f): undefined reference to `pj_timer_heap_create'
icedemotest.c:(.text+0x648): undefined reference to `pj_ioqueue_create'
icedemotest.c:(.text+0x6a1): undefined reference to `pj_thread_create'
icedemotest.c:(.text+0x6c4): undefined reference to `PJ_AF_INET'
icedemotest.c:(.text+0x710): undefined reference to `pj_dns_resolver_create'
icedemotest.c:(.text+0x751): undefined reference to `pj_dns_resolver_set_ns'
collect2: error: ld returned 1 exit status
make: *** [icedemotest] Error 1
  		 	   		  
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  


        
    
    

    










  

    
    
  

  
                                                                                                                      

From: biswajitjobapp@xxxxxxxxxxxxx
To: pjsip at lists.pjsip.org
Subject: make issue
Date: Mon, 22 Dec 2014 10:27:07 +0000




 
Hello everyone. 
I am a beginner in using pjsip. I researched the documents given on the website and other forums. However i could not find the solution to the problem which is :undefined reference to "various functions"
I have build my linux using the GNU build system 
I have build by following the steps as
1.  ./configure
2. make dep
3. make

all goes well to this point. Now I move to building my own application using PJSIP with GNU tools , wherein I create a directory "myfile" and put both my source code and make file within this directory. The path to this directory is 

:~/projects/pjsip/new/pjproject-2.3/pjsip/myfile$
:~/projects/pjsip/new/pjproject-2.3/pjsip/myfile$ls
icedemotest.c  makefile

the makefile contains the following code as directed in the manual.I am using version 2.3 so the make file is as follows

[code]

all: icedemotest

icedemotest:icedemotest.c
    $(CC) -o $@ $< `pkg-config --cflags --libs libpjproject`

clean:
    rm -f icedemotest.o icedemotest

[/code]


now when i run make it returns an error stating undefined reference to various files .I am posting the error here. As far as i can think of it might be an issue with not linking to the library so it shows error. SO please help me with this problem. I have a long way to go but i am stuck at the start.
Thanks for any kind response. Waiting eagerly for a reply....


~/projects/pjsip/new/pjproject-2.3/pjsip/myfile$ make
cc     icedemotest.c   -o icedemotest
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 13                                                                            
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 13                                                                           
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 20 has invalid symbol index 13
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 21 has invalid symbol index 22
/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_line): relocation 0 has invalid symbol index 2
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
/tmp/ccR1Z0pn.o: In function `icedemo_perror':
icedemotest.c:(.text+0x5f): undefined reference to `pj_strerror'
icedemotest.c:(.text+0x67): undefined reference to `pj_log_get_level'
icedemotest.c:(.text+0x8d): undefined reference to `pj_log_1'
/tmp/ccR1Z0pn.o: In function `err_exit':
icedemotest.c:(.text+0xc3): undefined reference to `pj_log_get_level'
icedemotest.c:(.text+0xdc): undefined reference to `pj_log_3'
icedemotest.c:(.text+0xf2): undefined reference to `pj_ice_strans_destroy'
icedemotest.c:(.text+0xfe): undefined reference to `pj_thread_sleep'
icedemotest.c:(.text+0x11e): undefined reference to `pj_thread_join'
icedemotest.c:(.text+0x12b): undefined reference to `pj_thread_destroy'
icedemotest.c:(.text+0x141): undefined reference to `pj_ioqueue_destroy'
icedemotest.c:(.text+0x157): undefined reference to `pj_timer_heap_destroy'
icedemotest.c:(.text+0x163): undefined reference to `pj_caching_pool_destroy'
icedemotest.c:(.text+0x168): undefined reference to `pj_shutdown'
/tmp/ccR1Z0pn.o: In function `handle_events':
icedemotest.c:(.text+0x1f1): undefined reference to `pj_timer_heap_poll'
icedemotest.c:(.text+0x281): undefined reference to `pj_ioqueue_poll'
icedemotest.c:(.text+0x28f): undefined reference to `pj_get_netos_error'
icedemotest.c:(.text+0x2a8): undefined reference to `pj_thread_sleep'
/tmp/ccR1Z0pn.o: In function `cb_on_rx_data':
icedemotest.c:(.text+0x351): undefined reference to `pj_log_get_level'
icedemotest.c:(.text+0x378): undefined reference to `pj_sockaddr_print'
icedemotest.c:(.text+0x3ac): undefined reference to `pj_log_3'
/tmp/ccR1Z0pn.o: In function `cb_on_ice_complete':
icedemotest.c:(.text+0x406): undefined reference to `pj_log_get_level'
icedemotest.c:(.text+0x42a): undefined reference to `pj_log_3'
icedemotest.c:(.text+0x44d): undefined reference to `pj_strerror'
icedemotest.c:(.text+0x455): undefined reference to `pj_log_get_level'
icedemotest.c:(.text+0x47b): undefined reference to `pj_log_1'
icedemotest.c:(.text+0x486): undefined reference to `pj_ice_strans_destroy'
/tmp/ccR1Z0pn.o: In function `log_func':
icedemotest.c:(.text+0x4c2): undefined reference to `pj_log_write'
/tmp/ccR1Z0pn.o: In function `icedemo_init':
icedemotest.c:(.text+0x52c): undefined reference to `pj_log_set_log_func'
icedemotest.c:(.text+0x531): undefined reference to `pj_init'
icedemotest.c:(.text+0x552): undefined reference to `pjlib_util_init'
icedemotest.c:(.text+0x573): undefined reference to `pjnath_init'
icedemotest.c:(.text+0x5ab): undefined reference to `pj_caching_pool_init'
icedemotest.c:(.text+0x5b7): undefined reference to `pj_ice_strans_cfg_default'
icedemotest.c:(.text+0x5ed): undefined reference to `pj_pool_create'
icedemotest.c:(.text+0x60f): undefined reference to `pj_timer_heap_create'
icedemotest.c:(.text+0x648): undefined reference to `pj_ioqueue_create'
icedemotest.c:(.text+0x6a1): undefined reference to `pj_thread_create'
icedemotest.c:(.text+0x6c4): undefined reference to `PJ_AF_INET'
icedemotest.c:(.text+0x710): undefined reference to `pj_dns_resolver_create'
icedemotest.c:(.text+0x751): undefined reference to `pj_dns_resolver_set_ns'
collect2: error: ld returned 1 exit status
make: *** [icedemotest] Error 1
  		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20150106/291d4ddc/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux