Page 1 of 1
libtelldus.so exports no symbols
Posted: Fri Mar 17, 2023 9:45 am
by bbb
I get the following errors when linking:
Code: Select all
>>> g++ -o priv/telldus -ltelldus-core src/telldus.o
src/telldus.o: In function `main':
telldus.cpp:(.text+0x5e): undefined reference to `tdTurnOff'
telldus.cpp:(.text+0x70): undefined reference to `tdDim'
collect2: ld returned 1 exit status
Inspecting further with nm:
Code: Select all
>>> nm -g /usr/lib/libtelldus-core.so
nm: /usr/lib/libtelldus-core.so: no symbols
This can't be right, can it?

Re: libtelldus.so exports no symbols
Posted: Fri Mar 17, 2023 9:45 am
by bbb
Ok, my Linux-fu failed me a bit. It seems symbols are indeed exported. However, I still get the linker error.
Output from
Code: Select all
readelf -Ws /usr/lib/libtelldus-core.so
:
Code: Select all
Symbol table '.dynsym' contains 158 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000003d40 0 SECTION LOCAL DEFAULT 10
2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSs6appendEPKcm@GLIBCXX_3.4 (2)
3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt18basic_stringstreamIwSt11char_traitsIwESaIwEED1Ev@GLIBCXX_3.4 (2)
4: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTVSt18basic_stringstreamIcSt11char_traitsIcESaIcEE@GLIBCXX_3.4 (2)
5: 0000000000000000 0 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.2.5 (3)
6: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSolsEi@GLIBCXX_3.4 (2)
7: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt9basic_iosIwSt11char_traitsIwEE4initEPSt15basic_streambufIwS1_E@GLIBCXX_3.4 (2)
8: 0000000000000000 0 FUNC GLOBAL DEFAULT UND wmemcpy@GLIBC_2.2.5 (3)
9: 0000000000000000 0 FUNC GLOBAL DEFAULT UND memset@GLIBC_2.2.5 (3)
10: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE@GLIBCXX_3.4 (2)
11: 0000000000000000 0 FUNC GLOBAL DEFAULT UND wcslen@GLIBC_2.2.5 (3)
12: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEE4_Rep9_S_createEmmRKS1_@GLIBCXX_3.4 (2)
13: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTVSt9basic_iosIcSt11char_traitsIcEE@GLIBCXX_3.4 (2)
14: 0000000000000000 0 FUNC GLOBAL DEFAULT UND close@GLIBC_2.2.5 (4)
15: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZSt16__ostream_insertIwSt11char_traitsIwEERSt13basic_ostreamIT_T0_ES6_PKS3_l@GLIBCXX_3.4.9 (5)
16: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt8ios_baseC2Ev@GLIBCXX_3.4 (2)
17: 0000000000000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
18: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _Jv_RegisterClasses
19: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _Znam@GLIBCXX_3.4 (2)
20: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTTSt18basic_stringstreamIcSt11char_traitsIcESaIcEE@GLIBCXX_3.4 (2)
21: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZdlPv@GLIBCXX_3.4 (2)
22: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTTSt18basic_stringstreamIwSt11char_traitsIwESaIwEE@GLIBCXX_3.4 (2)
23: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSs7reserveEm@GLIBCXX_3.4 (2)
24: 0000000000000000 0 FUNC GLOBAL DEFAULT UND toupper@GLIBC_2.2.5 (3)
25: 0000000000000000 0 FUNC GLOBAL DEFAULT UND select@GLIBC_2.2.5 (3)
26: 0000000000000000 0 FUNC GLOBAL DEFAULT UND wmemcmp@GLIBC_2.2.5 (3)
27: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt13basic_ostreamIwSt11char_traitsIwEElsEi@GLIBCXX_3.4 (2)
28: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __cxa_rethrow@CXXABI_1.3 (6)
29: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTVSt15basic_stringbufIwSt11char_traitsIwESaIwEE@GLIBCXX_3.4 (2)
30: 0000000000000000 0 FUNC GLOBAL DEFAULT UND malloc@GLIBC_2.2.5 (3)
31: 0000000000000000 0 FUNC GLOBAL DEFAULT UND recv@GLIBC_2.2.5 (4)
32: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSs4_Rep9_S_createEmmRKSaIcE@GLIBCXX_3.4 (2)
33: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSsC1ERKSs@GLIBCXX_3.4 (2)
34: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZSt20__throw_out_of_rangePKc@GLIBCXX_3.4 (2)
35: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_init@GLIBC_2.2.5 (4)
36: 0000000000000000 0 FUNC GLOBAL DEFAULT UND iconv_open@GLIBC_2.2.5 (3)
37: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSsD1Ev@GLIBCXX_3.4 (2)
38: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEE6appendEPKwm@GLIBCXX_3.4 (2)
39: 0000000000000000 0 FUNC GLOBAL DEFAULT UND free@GLIBC_2.2.5 (3)
40: 0000000000000000 0 FUNC GLOBAL DEFAULT UND strlen@GLIBC_2.2.5 (3)
41: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSs4_Rep10_M_destroyERKSaIcE@GLIBCXX_3.4 (2)
42: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_create@GLIBC_2.2.5 (4)
43: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt13basic_istreamIwSt11char_traitsIwEErsERi@GLIBCXX_3.4 (2)
44: 0000000000000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@GLIBC_2.2.5 (3)
45: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt15_List_node_base6unhookEv@GLIBCXX_3.4 (2)
46: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEE6assignERKS2_@GLIBCXX_3.4 (2)
47: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTVSt15basic_streambufIwSt11char_traitsIwEE@GLIBCXX_3.4 (2)
48: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTVN10__cxxabiv117__class_type_infoE@CXXABI_1.3 (6)
49: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEED2Ev@GLIBCXX_3.4 (2)
50: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt15_List_node_base8transferEPS_S0_@GLIBCXX_3.4 (2)
51: 0000000000000000 0 FUNC GLOBAL DEFAULT UND iswdigit@GLIBC_2.2.5 (3)
52: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTVSt9basic_iosIwSt11char_traitsIwEE@GLIBCXX_3.4 (2)
53: 0000000000000000 0 FUNC GLOBAL DEFAULT UND iconv@GLIBC_2.2.5 (3)
54: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_self@GLIBC_2.2.5 (4)
55: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_join@GLIBC_2.2.5 (4)
56: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEE4_Rep10_M_destroyERKS1_@GLIBCXX_3.4 (2)
57: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEE4_Rep20_S_empty_rep_storageE@GLIBCXX_3.4 (2)
58: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSsC1EPKcRKSaIcE@GLIBCXX_3.4 (2)
59: 0000000000000000 0 FUNC GLOBAL DEFAULT UND usleep@GLIBC_2.2.5 (3)
60: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEE12_M_leak_hardEv@GLIBCXX_3.4 (2)
61: 0000000000000000 0 FUNC GLOBAL DEFAULT UND connect@GLIBC_2.2.5 (4)
62: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNKSbIwSt11char_traitsIwESaIwEE4findEwm@GLIBCXX_3.4 (2)
63: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt6localeC1Ev@GLIBCXX_3.4 (2)
64: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt9basic_iosIwSt11char_traitsIwEED2Ev@GLIBCXX_3.4 (2)
65: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __cxa_pure_virtual@CXXABI_1.3 (6)
66: 0000000000000000 0 FUNC GLOBAL DEFAULT UND memcpy@GLIBC_2.2.5 (3)
67: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l@GLIBCXX_3.4.9 (5)
68: 0000000000000000 0 FUNC GLOBAL DEFAULT UND socket@GLIBC_2.2.5 (3)
69: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt9basic_iosIcSt11char_traitsIcEE4initEPSt15basic_streambufIcS1_E@GLIBCXX_3.4 (2)
70: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEED1Ev@GLIBCXX_3.4 (2)
71: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTVN10__cxxabiv120__si_class_type_infoE@CXXABI_1.3 (6)
72: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEE6appendERKS2_@GLIBCXX_3.4 (2)
73: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt8ios_baseD2Ev@GLIBCXX_3.4 (2)
74: 0000000000000000 0 FUNC GLOBAL DEFAULT UND send@GLIBC_2.2.5 (4)
75: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSs6assignEPKcm@GLIBCXX_3.4 (2)
76: 0000000000000000 0 FUNC GLOBAL DEFAULT UND strcpy@GLIBC_2.2.5 (3)
77: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSirsERi@GLIBCXX_3.4 (2)
78: 0000000000000000 0 FUNC WEAK DEFAULT UND pthread_cancel@GLIBC_2.2.5 (4)
79: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSs6assignERKSs@GLIBCXX_3.4 (2)
80: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZSt19__throw_logic_errorPKc@GLIBCXX_3.4 (2)
81: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZdaPv@GLIBCXX_3.4 (2)
82: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEEC1ERKS2_mm@GLIBCXX_3.4 (2)
83: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTVSt18basic_stringstreamIwSt11char_traitsIwESaIwEE@GLIBCXX_3.4 (2)
84: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostate@GLIBCXX_3.4 (2)
85: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEE6assignEPKwm@GLIBCXX_3.4 (2)
86: 0000000000000000 0 FUNC GLOBAL DEFAULT UND strncpy@GLIBC_2.2.5 (3)
87: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZTVSt15basic_streambufIcSt11char_traitsIcEE@GLIBCXX_3.4 (2)
88: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEEC1EPKwRKS1_@GLIBCXX_3.4 (2)
89: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt9basic_iosIcSt11char_traitsIcEED2Ev@GLIBCXX_3.4 (2)
90: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __cxa_end_catch@CXXABI_1.3 (6)
91: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND _ZNSs4_Rep20_S_empty_rep_storageE@GLIBCXX_3.4 (2)
92: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEEC1ERKS2_@GLIBCXX_3.4 (2)
93: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __cxa_begin_catch@CXXABI_1.3 (6)
94: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt18basic_stringstreamIcSt11char_traitsIcESaIcEED1Ev@GLIBCXX_3.4 (2)
95: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt15_List_node_base4hookEPS_@GLIBCXX_3.4 (2)
96: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_lock@GLIBC_2.2.5 (4)
97: 0000000000000000 0 FUNC GLOBAL DEFAULT UND floor@GLIBC_2.2.5 (7)
98: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __gxx_personality_v0@CXXABI_1.3 (6)
99: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_destroy@GLIBC_2.2.5 (4)
100: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _Znwm@GLIBCXX_3.4 (2)
101: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _Unwind_Resume@GCC_3.0 (8)
102: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNKSbIwSt11char_traitsIwESaIwEE7compareEPKw@GLIBCXX_3.4 (2)
103: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSt6localeD1Ev@GLIBCXX_3.4 (2)
104: 0000000000000000 0 FUNC GLOBAL DEFAULT UND pthread_mutex_unlock@GLIBC_2.2.5 (4)
105: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSs6appendERKSs@GLIBCXX_3.4 (2)
106: 0000000000000000 0 FUNC GLOBAL DEFAULT UND iconv_close@GLIBC_2.2.5 (3)
107: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND stdout@GLIBC_2.2.5 (3)
108: 0000000000000000 0 FUNC GLOBAL DEFAULT UND _ZNSbIwSt11char_traitsIwESaIwEE9_M_mutateEmmm@GLIBCXX_3.4 (2)
109: 0000000000000000 0 FUNC GLOBAL DEFAULT UND fflush@GLIBC_2.2.5 (3)
110: 0000000000008fb0 185 FUNC GLOBAL DEFAULT 12 tdAddDevice
111: 000000000000ddb0 113 FUNC WEAK DEFAULT 12 _ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEED1Ev
112: 000000000000bd30 232 FUNC WEAK DEFAULT 12 _ZNSbIwSt11char_traitsIwESaIwEE12_S_constructIPwEES4_T_S5_RKS1_St20forward_iterator_tag
113: 0000000000009b00 210 FUNC GLOBAL DEFAULT 12 tdTurnOn
114: 00000000000094d0 210 FUNC GLOBAL DEFAULT 12 tdStop
115: 0000000000008900 53 FUNC GLOBAL DEFAULT 12 tdRegisterDeviceChangeEvent
116: 000000000000a5c0 258 FUNC GLOBAL DEFAULT 12 tdSetDeviceParameter
117: 0000000000008c80 325 FUNC GLOBAL DEFAULT 12 tdConnectTellStickController
118: 000000000000ecc8 0 FUNC GLOBAL DEFAULT 13 _fini
119: 000000000000a4e0 210 FUNC GLOBAL DEFAULT 12 tdRemoveDevice
120: 000000000000a320 447 FUNC GLOBAL DEFAULT 12 tdLastSentValue
121: 0000000000009de0 447 FUNC GLOBAL DEFAULT 12 tdGetModel
122: 0000000000009230 197 FUNC GLOBAL DEFAULT 12 tdGetNumberOfDevices
123: 0000000000009770 210 FUNC GLOBAL DEFAULT 12 tdExecute
124: 000000000000be20 113 FUNC WEAK DEFAULT 12 _ZNSt15basic_stringbufIwSt11char_traitsIwESaIwEED1Ev
125: 0000000000009940 210 FUNC GLOBAL DEFAULT 12 tdBell
126: 000000000000dcd0 223 FUNC WEAK DEFAULT 12 _ZNSs12_S_constructIPcEES0_T_S1_RKSaIcESt20forward_iterator_tag
127: 00000000000088c0 53 FUNC GLOBAL DEFAULT 12 tdRegisterSensorEvent
128: 0000000000008dd0 232 FUNC GLOBAL DEFAULT 12 tdSendRawCommand
129: 0000000000009150 210 FUNC GLOBAL DEFAULT 12 tdGetDeviceId
130: 00000000000093f0 210 FUNC GLOBAL DEFAULT 12 tdLearn
131: 000000000000a7c0 232 FUNC GLOBAL DEFAULT 12 tdSetName
132: 0000000000008880 5 FUNC GLOBAL DEFAULT 12 tdReleaseString
133: 000000000000a160 447 FUNC GLOBAL DEFAULT 12 tdGetName
134: 0000000000009be0 499 FUNC GLOBAL DEFAULT 12 tdGetDeviceParameter
135: 0000000000009070 210 FUNC GLOBAL DEFAULT 12 tdGetDeviceType
136: 000000000000a8b0 232 FUNC GLOBAL DEFAULT 12 tdSetProtocol
137: 000000000000a9a0 733 FUNC GLOBAL DEFAULT 12 tdSensorValue
138: 0000000000009850 233 FUNC GLOBAL DEFAULT 12 tdDim
139: 00000000000087f0 5 FUNC GLOBAL DEFAULT 12 tdInit
140: 0000000000008940 53 FUNC GLOBAL DEFAULT 12 tdRegisterRawDeviceEvent
141: 0000000000008b30 325 FUNC GLOBAL DEFAULT 12 tdDisconnectTellStickController
142: 0000000000213b00 0 NOTYPE GLOBAL DEFAULT ABS __bss_start
143: 0000000000008890 5 FUNC GLOBAL DEFAULT 12 tdClose
144: 0000000000213b18 0 NOTYPE GLOBAL DEFAULT ABS _end
145: 0000000000008ec0 232 FUNC GLOBAL DEFAULT 12 tdMethods
146: 0000000000009fa0 447 FUNC GLOBAL DEFAULT 12 tdGetProtocol
147: 00000000000088a0 23 FUNC GLOBAL DEFAULT 12 tdUnregisterCallback
148: 0000000000008800 117 FUNC GLOBAL DEFAULT 12 tdSensor
149: 0000000000213b00 0 NOTYPE GLOBAL DEFAULT ABS _edata
150: 0000000000009a20 210 FUNC GLOBAL DEFAULT 12 tdTurnOff
151: 00000000000089c0 357 FUNC GLOBAL DEFAULT 12 tdGetErrorString
152: 0000000000008980 53 FUNC GLOBAL DEFAULT 12 tdRegisterDeviceEvent
153: 000000000000a6d0 232 FUNC GLOBAL DEFAULT 12 tdSetModel
154: 0000000000009300 232 FUNC GLOBAL DEFAULT 12 tdLastSentCommand
155: 0000000000009690 210 FUNC GLOBAL DEFAULT 12 tdUp
156: 00000000000095b0 210 FUNC GLOBAL DEFAULT 12 tdDown
157: 0000000000003d40 0 FUNC GLOBAL DEFAULT 10 _init
Re: libtelldus.so exports no symbols
Posted: Fri Mar 17, 2023 9:45 am
by bbb
Whoa. Unexpected difference between GCC in Ubuntu 11.10 vs Ubuntu 11.04.
Formerly, this worked:
Code: Select all
g++ -o priv/telldus -ltelldus-core src/telldus.o
Now, I need to put -ltelldus-core at the end:
Code: Select all
g++ -o priv/telldus src/telldus.o -ltelldus-core
Re: libtelldus.so exports no symbols
Posted: Fri Mar 17, 2023 9:45 am
by micke.prag
Interesting. I have never seen that "requirement" in gcc before. Good to know!
Re: libtelldus.so exports no symbols
Posted: Fri Mar 17, 2023 9:45 am
by davka003
Order of the linking command arguments can be a nightmare. On my last company we compiled same code base to a handful of target architectures and randomly we needed to reorder the list of libraries. It was even the case that the order needed to be different for some architectures. All compiled with gcc.