# Exports in \_runtime\_swig.pyd

**URL:** <https://www.ruby-forum.com/t/exports-in-runtime-swig-pyd/232630>\
**Category:** GNU Radio\
**Created:** [October 19, 2014, 1:15pm UTC](https://www.ruby-forum.com/t/exports-in-runtime-swig-pyd/232630 "2014-10-19T13:15:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [October 19, 2014, 1:15pm UTC](https://www.ruby-forum.com/t/exports-in-runtime-swig-pyd/232630/1 "2014-10-19T13:15:27Z")

</div>

I’m still trying to understand the build-process and internals of  
GnuRadio. While trying to build the Swig .pyd modules, I notice that  
gnuradio-runtime/swig/runtime\_swig.i has a:  
#define GR\_RUNTIME\_API

Thus functions/vars in \_runtime\_swig.pyd gets a dllexport linkage.  
But comparing to gnuradio-runtime/swig/pmt\_swig.i there is no  
PMT\_API at the top. Why the difference?

–gv

---

<div class="post-metadata">

**Author:** ![Gisle\_V](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b782af/32.png) [@Gisle\_V](https://www.ruby-forum.com/u/Gisle_V)\
**Post date:** [October 19, 2014, 3:15pm UTC](https://www.ruby-forum.com/t/exports-in-runtime-swig-pyd/232630/2 "2014-10-19T15:15:39Z")

</div>

I wrote:

> Thus functions/vars in \_runtime\_swig.pyd gets a dllexport linkage.  
> But comparing to gnuradio-runtime/swig/pmt\_swig.i there is no  
> PMT\_API at the top. Why the difference?

Further to the problem I had with linking in the Swig code for this:  
extern const pmt\_t PMT\_T; (in pmt\_swig.i)

This may work fine with the GNU linker, but MSVC needs explicit  
dllimport. So I patched pmt\_swig.i like this:

— pmt\_swig.i.orig 2014-09-24 13:48:36 +0000  
+++ pmt\_swig.i 2014-10-19 14:51:19 +0000  
@@ -80,11 +80,6 @@  
swig\_int\_ptr. **repr** = lambda self: write\_string(self)  
%}

- 
- extern const pmt\_t PMT\_T;
- extern const pmt\_t PMT\_F;
- extern const pmt\_t PMT\_EOF;
- pmt\_t get\_PMT\_NIL();  
#define PMT\_NIL get\_PMT\_NIL()

* * *

\<pmt/pmt.h\> already has the proper import decoration. No point declaring  
those with ‘extern’. So now .py examples using \_pmt\_swig.pyd works just  
fine.

I noted in the Ettus Gr installation, there where no \_pmt\_swig.pyd.  
Maybe that’s due to the problem they had with link that on Windows.  
Seems imposible w/o correct DLL-linkage.

–gv
