Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] windows DLL link question

Date2006-08-24 18:40
FromMichael Gogins
SubjectRe: [Cs-dev] windows DLL link question
Yes, it is absolutely required on Windows to declare any symbol exported from a DLL as __declspec(DllExport).

However, that symbol can be a function, or it can be data, or it can be a class method, or it can even be an entire class in one go, in which case the methods and public member variables of that class also are exported.

We know that the functions actually _are_ exported, because the Python interface on Windows, which works, calls them (i.e. _csnd.dll calls the Csound shared library itself) and because the Lisp cffi interface calls them as well.

As for csound.hpp, it was cleverly written by Istvan Varga with entirely inline method definitions. Therefore, it is not necessary to export the Csound class. When an application using the csound.hpp is compiled, the compiler for the client application expands the non-exported method calls because they are declared inline, i.e. within the body of the class declaration in csound.hpp, and replaces them with the method bodies, which are just calls to the Csound "C" API, which of course is exported. This is true of the constructor as well.

The pvsindata and pvsoutdata members that you have added to csound.hpp will not be visible within the Csound library, or the Csound engine, but only to clients of the API. Perhaps you should add them to the CSOUND structure. On the other hand, you don't seem to use these members, so perhaps they can be removed.

I continue to say: we should change the CSOUND structure into a proper C++ class (as Istvan is doing in his version) and then csound.hpp will not be necessary. It would also simplify the future development and maintenance of Csound and should have no adverse consequences for performance.

Hope this helps,
Mike

-----Original Message-----
>From: Victor Lazzarini 
>Sent: Aug 24, 2006 12:30 PM
>To: andres@geminiflux.com, Developer discussions 
>Subject: [Cs-dev] windows DLL link question
>
>A question probably for Michael...
>
>In C++ is it necessary to use PUBLIC (dllexport) to make DLL
>functions available to the outside or all public methods of a class
>are exported by default?
>
>I ask the question because all C API functions in csound.h have PUBLIC
>before them, but none of the Csound class methods in csound.hpp
>have it.
>
>I have never tried to use the Csound DLL from C++ on Windows, I
>am wondering whether it actually works.
>
>
>
>Victor Lazzarini
>Music Technology Laboratory
>Music Department
>National University of Ireland, Maynooth 
>
>
>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>Csound-devel mailing list
>Csound-devel@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/csound-devel




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net