discuss-gnustep
[Top][All Lists]
Advanced

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

Re: is base compilable as a dll under win32


From: Gerard Iglesias
Subject: Re: is base compilable as a dll under win32
Date: Sat, 19 May 2001 16:48:36 +0200

On Saturday, May 19, 2001, at 10:40 , Helge Hess wrote:

You should *always* use shared=yes on Windows even if only a single
piece is shared. Otherwise each DLL will have an own copy of any static
lib linked against it (including static variables !!!) and therefore you
are going to have a lot of trouble.
Particulary libobjc is very sensitive in the respect, always use a
shared one if you use any other ObjC DLL (either bundle or lib).

I tried it, but even when I replace the libobjc at the location /cygwin/mingw32/lib/gcc-lib/.../libobjc.a with the mine compiled with shred=yes(the one in the mingw distrib seems to be static, how do we test this?), then I use the gnustep-base compiled with shared=yes, then I compile the example awake with WITH_DLL=yes BUILD_DLL=no, then when I run the example I got the error : Can't find the class NSAutoreleasePool (something like that, I am on my iMac at home).

If I understand correctly : would I need to do the following things ?

(I made it so often this week, that I can remember the session, without hope...at the end):

My tree is like that:

e:\cygwin

e:\cygwin\mingw32
e:\cygwin\mingw32\bin
e:\cygwin\mingw32\lib\gcc-lib

e:\cygwin\home\adminstrator\developer\
e:\cygwin\home\adminstrator\developer\ libobjcsourcefolder
e:\cygwin\home\adminstrator\developer\ core
e:\cygwin\home\adminstrator\developer\ core\base
e:\cygwin\home\adminstrator\developer\ core\make



1/ run the cygwin bash shell

Environment

2/ export PATH=//e/cygwin/mingw32/bin:$PATH
3/ export CYGWIN_HOME=e:\\cygwin (unless foundation don't find NSTimeZone/localtime)
4/ export GNSUTEP_SYSTEM_ROOT=//e/cygwin/usr/GNUstep/System
5/ export GNUSTEP_HOST=i686-pc-mingw32

Gnustep environment

6/ cd developer/core/make
7/ ./configure --target=i686-mingw32
8/ make install
9/ . /usr/GNUstep/System/Makefiles/GNUstep.sh

Make libobjc

10/ cd ../../libobjcsourcefolder (I don't remember exactly the name, but I got the las version on ftp.gnustep/libs)
11/ change the GNUmakefile to set THREADING=win32 only
12/ make shared=yes
13/ cp shared_obj/.../libobjc /mingw32/lib/gcc-lib/.../libobjc.a (I am forced to do that, I tried the normal install but the linker was unable to open the lib, I made by hand the ld --verbose command to understand why, but ???)
14 / cp shared_obj/.../objc.dll /mingw32/bin (to get the path to the dll in the PATH var)

Repeat the make build to get the configuration take in account the threading setting of my new libobjc

Then make the gnustep-base lib

15/ cd ../core/base
16/ ./configure --target=i686
17/ make shared=yes install

Then make the examples in the Testing folder

The awake example:

18/ cd Testing
19/ make WITH_DLL=yes BUILD_DLL=no awake
20/ run static_obj/..../awake.exe (At this point with my test I got the error NSAutoreleasePool not found)

In fact at this point I made a lot of tests, and one of then was to trace the runtime, hence I built libobjc with the flags -DDEBUG_RUNTIME. This test permitted me to see that when I make a static version the debug trace give me the class tree in the shell window, but when I buid eveything in shred then what I get in the debug trace is some dynamic loading message but no class tree?

For the nsbundle/LoadMe example it seems to me that I would need to do the following

21/ make WITH_DLL=yes BUILD_DLL=no nsbundle
22/ make shared=yes LoadMe
22/ run static_obj/..../nsbundle.exe (At this point with my test I got the error NSAutoreleasePool not found)


In the case of I build libobjc, libgnustep-base and nsbundle static, then LoadMe shared I got the error message that it can't find the principal class.


If you can help me I would be very happy, and I will post one tutorial to install, build and use objc/gnustep under Windows/NT, I will make the example with the 3DKit lib.

Thank you in advance.

--
gerard_iglesias@mac.com
Ph.D. in Computer Graphics MacOS X-Cocoa to have fun
Project manager at www.visiotics.com Win32/MFC to eat


reply via email to

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