[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dirty Hack!!!(WAS: Re: [Q] How a method in a category added ?)
From: |
Adam Fedor |
Subject: |
Re: Dirty Hack!!!(WAS: Re: [Q] How a method in a category added ?) |
Date: |
Sun, 13 Jul 2003 11:16:07 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.1) Gecko/20020905 |
S.J.Chun wrote:
> Hi,
>
> To solve linking problem (I've found that even if I explicitly set the linker
> flag so that it link a framework library XXX,
> windows does not link it, if there's no symbolic linkage...), I have to
> specify in the header like following...
>
> #ifndef _EDCommonFramework_Linking_H_
> #define _EDCommonFramework_Linking_H_
>
> @interface NSFramework_EDCommon : NSObject
> @end
>
> static inline void __EDCommonFramework_linking (void) {
> NSFramework_EDCommon *frmInst = [NSFramework_EDCommon alloc];
> }
>
> #endif
>
> With this, linker always link specified framework library. Any more better
> solution? Thanks in advance.
>
I've seen this happend when linking libraries statically, but I don't
have any better solution. Another idea is to put some dummy function in
the framework, like
--- linking.m ----
#include <Foundation/Foundation.h>
#include "AppKit/AppKit.h"
void __objc_gui_linking(void)
{
[GSFontInfo class];
}
And then make sure you call that function from your main program.