开发者

Referencing DLLs for Objective-C (GNUStep 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜