shiyilei / protobuf-c

Automatically exported from code.google.com/p/protobuf-c
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Linking of libprotobuf-c.so failing while building executable #73

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. installed protobuf-c & protoc-c n Ubuntu 11.10 using sudo apt-get install , 
protoc & protobuf were already installed by default on Ubuntu installation. 
(installation by downloading package has failed)
2. tried to compile sample program with linking libprotobuf-c.so
3. Linking failure happend , but failing to find out whats really going wrong 

What is the expected output? What do you see instead?

Error like:
neel@ubuntu:~/Work$ cc -o serial serialize.c -I../GPB/protobuf-c-0.15/src/ 
-L/usr/lib -lprotobuf-c
/usr/bin/ld: cannot find -lprotobuf-c
collect2: ld returned 1 exit status
neel@ubuntu:~/Work$ 

but i have all the required libraries with linking

What version of the product are you using? On what operating system?

Ubuntu 11.10

neel@ubuntu:~/Work$ type protoc
protoc is hashed (/usr/bin/protoc)
neel@ubuntu:~/Work$ type protoc-c
protoc-c is hashed (/usr/bin/protoc-c)
neel@ubuntu:~/Work$ ls -l /usr/lib/*proto* 
lrwxrwxrwx 1 root root      33 2011-06-23 16:13 
/usr/lib/libgstdataprotocol-0.10.so.0 -> libgstdataprotocol-0.10.so.0.29.0
-rw-r--r-- 1 root root   18600 2011-06-23 16:13 
/usr/lib/libgstdataprotocol-0.10.so.0.29.0
-rw-r--r-- 1 root root 1903982 2011-08-11 22:20 /usr/lib/libprotobuf.a
lrwxrwxrwx 1 root root      22 2011-06-11 00:45 /usr/lib/libprotobuf-c.so.0 -> 
libprotobuf-c.so.0.0.0
-rw-r--r-- 1 root root   63856 2011-06-11 00:45 /usr/lib/libprotobuf-c.so.0.0.0
-rw-r--r-- 1 root root     980 2011-08-11 22:20 /usr/lib/libprotobuf.la
-rw-r--r-- 1 root root  326892 2011-08-11 22:20 /usr/lib/libprotobuf-lite.a
-rw-r--r-- 1 root root    1015 2011-08-11 22:20 /usr/lib/libprotobuf-lite.la
lrwxrwxrwx 1 root root      25 2011-08-11 22:20 /usr/lib/libprotobuf-lite.so -> 
libprotobuf-lite.so.7.0.0
lrwxrwxrwx 1 root root      25 2011-08-11 22:20 /usr/lib/libprotobuf-lite.so.7 
-> libprotobuf-lite.so.7.0.0
-rw-r--r-- 1 root root  166368 2011-08-11 22:20 
/usr/lib/libprotobuf-lite.so.7.0.0
lrwxrwxrwx 1 root root      20 2011-08-11 22:20 /usr/lib/libprotobuf.so -> 
libprotobuf.so.7.0.0
lrwxrwxrwx 1 root root      20 2011-08-11 22:20 /usr/lib/libprotobuf.so.7 -> 
libprotobuf.so.7.0.0
-rw-r--r-- 1 root root  977792 2011-08-11 22:20 /usr/lib/libprotobuf.so.7.0.0
lrwxrwxrwx 1 root root      18 2011-08-11 22:20 /usr/lib/libprotoc.so.7 -> 
libprotoc.so.7.0.0
-rw-r--r-- 1 root root  778312 2011-08-11 22:20 /usr/lib/libprotoc.so.7.0.0
neel@ubuntu:~/Work$

Please provide any additional information below.

The GPB source files i.e the package lies on -I../GPB/protobuf-c-0.15/ folder.

Original issue reported on code.google.com by anjangos...@gmail.com on 18 Dec 2011 at 1:16

GoogleCodeExporter commented 8 years ago
Hi

the problem has been solved once i install gcc & g++ freshly on my Ubuntu & 
then installed protobuf-c & protobuf package on my system.

N.B:

1) make install requires root credentials hence - "sudo make install" will work.
2) dont forget to compile *.pb-c.c with your source code.

Thanks
Anjan

Original comment by anjangos...@gmail.com on 22 Dec 2011 at 7:52

GoogleCodeExporter commented 8 years ago
Please close this bug.

Original comment by sodab...@gmail.com on 1 Aug 2012 at 9:03