开发者

Referencing DLLs for Objective-C (GNUStep on Windows)

开发者 https://www.devze.com 2022-12-23 08:56 出处:网络
How do you开发者_如何学运维 reference DLLs from Objective-C? I use GNUStep Make files on Windows.

How do you开发者_如何学运维 reference DLLs from Objective-C? I use GNUStep Make files on Windows.

RIch


Ooh... this takes me back. A bit of a guess from the most common problem I ever ran into.

If GNUStep's DLLs on Windows work like they did a decade ago, then you:

  1. Link to the DLL like you would any other DLL. I don't remember the explicit syntax, but there should be about a zillion examples available

  2. Make sure you have a static reference to a symbol in each DLL from the main program (or from some other DLL).

In particular, when compiling something that is pure Objective-C, it is quite easy to end up in a situation where the Windows link loader doesn't load a DLL because it doesn't see a hard reference to any symbol in that DLL. When I ran into this with WebObjects applications, I would typically export something like:

int businessLogicDLLVersion;

And then refer to that symbol quite specifically in my main program. That static reference was enough to cause the link loader to load the DLL and the runtime to hook up all the classes.

0

精彩评论

暂无评论...
验证码 换一张
取 消