discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking Frameworks


From: Nicola Pero
Subject: Re: Linking Frameworks
Date: Thu, 11 Mar 2004 11:29:32 +0000 (GMT)

> Hello all,
> I'm fairly certain this has been dicussed/documented somewhere, but 
> after a few hours of searching, I am still at a loss.
> I am writing an application that depends on a framework.
> 
> In the application's GNUmakefile I have:
> 
> APP_NAME = myApp
> PACKAGE_NAME = ${APP_NAME}
> 
> SUBPROJECTS = myFramework
> 
> ...
> 
> ADDITIONAL_INCLUDE_DIRS += -framework myFramework
> myApp_GUI_LIBS += -framework myFramework
> 
> include $(GNUSTEP_MAKEFILES)/aggregate.make
> include $(GNUSTEP_MAKEFILES)/application.make
> 
> The framework compiles just fine and sits in 
> myFramework/myFramework.framework
> But when it tries to link myApp, the linker gives the following error 
> and dies:
>       /usr/bin/ld: cannot open myFramework: File format not recognized
> 
> Presumably this is because the -framework flag is not causing the same 
> behaviour it does on OS X.

That flag does not exist on non-Apple.  

You can use -

ADDITIONAL_INCLUDE_DIRS += 
-L./myFramework/myFramework.framework/Versions/Current/$(GNUSTEP_TARGET_LDIR)/
myApp_GUI_LIBS += -lmyFramework.


> So how should I modify the makefile in order to actually have it link 
> in the framework?
> Further, on OS X it is possible for a framework to live inside an 
> application bundle,  how can I get this behaviour?

It's unlikely you can get this behaviour cleanly on linux.  You'd need the
linker to look for the framework inside the application's directory.  
Quite tricky if you want the user to be able to install the application
somewhere on disk.

But if the point is that you want to package your application with the
framework in a binary bit that the user can install, then you can use,
say, an RPM package, you could put both the application and the framework
in the same binary RPM package.  Even if they are not in the same
directory, the user gets them together in the binary package; installing
the package installs both and they both work.  Uninstalling the package
removes both.  That's the linux way of solving this problem of shipping a
framework and an application together.  Or even better, put the framework
in a separate package if multiple applications might share it.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]