ImportC, Dub and Static inline

Jean-Philippe davidjenkins7473 at gmail.com
Mon Mar 9 10:29:17 UTC 2026


On Friday, 6 March 2026 at 08:48:43 UTC, Serg Gini wrote:
> On Thursday, 5 March 2026 at 19:07:05 UTC, libxmoc wrote:
>> On Sunday, 22 February 2026 at 22:37:13 UTC, Sergey wrote:
>>> Any automatic way to make C library with "static inline" 
>>> functions working automatically within dub library?
>>
>> Have you tried "sourceLibrary" target type as workaround?
>
> Yes, and cSourceLibrary.
> The issue is that in the final .so/.dylib such methods are not 
> presented
>
> For my case I had to do this semi-manually now:
> I've extracted all such functions and run `ctod` for them and 
> then fix some small parts manually.

Yes, that makes sense. If the methods aren’t exposed in the final 
.so/.dylib, handling them semi-manually is often the only 
practical workaround. Extracting the functions, running ctod, and 
then fixing the remaining parts manually sounds like a reasonable 
approach for now.


More information about the Digitalmars-d mailing list