wdoekes / asterisk-chan-dongle

chan_dongle channel driver for Huawei UMTS cards, works with Asterisk 14+
Other
301 stars 105 forks source link

Compile error: dupe definitions with Asterisk-13.1 and gcc-5 #5

Closed herczegzsolt closed 8 years ago

herczegzsolt commented 8 years ago

Everything seems fine until make command, which gives me a very long error list of "multiple definition". make_output.txt

wdoekes commented 8 years ago

Next time, the steps preceding the make would've been nice.

And the gcc version.

But I think I can add two and two together and conclude that: (a) you run Debian or a derivative with a very old Asterisk 13.1 (b) you run quite a new gcc 5 compiler

That means you lack this changeset: https://github.com/asterisk/asterisk/commit/e48f2e7897079936ef2cb91fd15b88c319a3cdc9#diff-47b4c4af4bc4e5e2b56157c25afbbe86L51

This should do the trick for you:

--- /usr/include/asterisk/inline_api.h.orig 2016-05-10 22:25:56.437154055 +0200
+++ /usr/include/asterisk/inline_api.h  2016-05-10 22:26:00.829154734 +0200
@@ -46,7 +46,7 @@
 #if !defined(LOW_MEMORY) && !defined(DISABLE_INLINE)

 #if !defined(AST_API_MODULE)
-#define AST_INLINE_API(hdr, body) hdr; extern inline hdr body
+#define AST_INLINE_API(hdr, body) static hdr; static inline hdr body
 #else
 #define AST_INLINE_API(hdr, body) hdr; hdr body
 #endif
herczegzsolt commented 8 years ago

I'm very sorry, I wanted to attach the additional information. The affected system is Ubuntu 16.04 LTS, so I think the problem will persist for a longer time.

Preceeding steps was: git clone https://github.com/wdoekes/asterisk-chan-dongle.git cd asterisk-chan-dongle/ aclocal autoconf automake -a ./configure --with-astversion=130100 make

GCC version: gcc (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413 Asterisk version: Asterisk 13.1.0~dfsg-1.1ubuntu4 Uname: Linux test 4.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Thank you very much for the patch, it solves the compilation problem! However I did not recompiled asterisk which your patch applies to, so I don't know if the binary will work or not. I'll test it, and provide feedback.

herczegzsolt commented 8 years ago

The chan_dongle compiled with the patch seems working OK. There are some instability when the dongle is "reused": Dongle needs reset before every asterisk start. I assume it's not related.

Thank you very much for your excellent support, feel free to let me know if I can do anything in return.

wdoekes commented 8 years ago

Glad it works. And no, you did not / should not have to recompile asterisk.

As for the reset before reuse, that should very much be unrelated indeed. You'll need to come up with a lot more debug output to get that fixed ;-)