discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] CMake Linking Problem


From: Marcus Müller
Subject: Re: [Discuss-gnuradio] CMake Linking Problem
Date: Fri, 18 Nov 2016 20:38:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

Hi Devin,

in include/my_mod/api.h you'll find a #define like this

#define MY_MOD_API __STUFF

use MY_MOD_API in front of the classes and free-standing functions you want to export, like

uint32_t MY_MOD_API crc32(unsigned int, void const*, unsigned long);

Best regards,
Marcus

PS: having written your own CRC is cool, but you can probably use one of the many existing implementations!


On 18.11.2016 17:15, devin kelly wrote:
Hello,

I've created my own GR module with GR mod tool.  I added two files

   include/my_mod/crc.h
   lib/crc.cc

And I can use the functions (crc32 for example) in those files perfectly fine within classes that wind up in libgnuradio-my_mod.so.  However, I can't use the functions in crc.h/crc.cc in external applications that link to libgnuradio-my_mod.so. 

The correct symbols exist in libgnuradio-my_mod.so however the symbols are local, not global.

$ readelf -a lib/libgnuradio-my_mod.so | grep crc32
   192: 0000000000228440  1024 OBJECT  LOCAL  DEFAULT   24 crc32_tab
   426: 000000000000f3f0    52 FUNC    LOCAL  DEFAULT   11 _Z5crc32jPKvm

How can I expose crc32 to the outside world?  Do I have to make the change in one of my CMakeLists.txt files or one of the source files?  The function (crc32) isn't a static.

Thanks for any help,
Devin


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

[Prev in Thread] Current Thread [Next in Thread]