[FS#3704] libubus ubus_invoke function undefined reference to

OpenWrt Bugs openwrt-bugs at lists.openwrt.org
Wed Mar 24 12:51:06 GMT 2021


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - hansdals (hansdals) 

Attached to Project - OpenWrt/LEDE Project
Summary - libubus ubus_invoke function undefined reference to
Task Type - Bug Report
Category - Packages
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Very Low
Reported Version - Trunk
Due in Version - Undecided
Due Date - Undecided
Details - Supply the following if possible:
 - Device problem occurs on
 - Software versions of OpenWrt/LEDE release, packages, etc.
 - Steps to reproduce
   
I'm compiling custom packages that I can unfortunately not share, but the problem is as follows:

This is more a suggestion than a bug report. 
I sometimes get undefined reference to ubus_invoke in libfoo.so.
I have tried to replicate the linking error with a simple c program, but it compiles fine (on my ubuntu machine with latest libubus compiled from source today)..

#include 
#include 

int main()
{
        ubus_invoke(NULL, 0, NULL, NULL, NULL, NULL, 0);
        return 0;
}
gcc test.c -lubus

I think the problem here is that the ubus CMakeLists.txt file has LIB_SOURCES libubus.c (and more), but the definition of ubus_invoke() is in libubus.h. Causing libubus.so to not have that symbol/function.
So if I in a main program call a function in libfoo that calls ubus_invoke, then I can end up with a undefined reference to ubus_invoke ?

Suggest moving the definitions to the .c file , or add libubus.h to LIB_SOURCES

again I'm sorry I couldn't replicate the problem.


More information can be found at the following URL:
https://bugs.openwrt.org/index.php?do=details&task_id=3704

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.



More information about the openwrt-bugs mailing list