can PB create LINUX shared objects or MacOSX dylibs?

Everything else that doesn't fall into one of the other PB categories.
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

can PB create LINUX shared objects or MacOSX dylibs?

Post by Rozek »

Hello!

The question comes up from time to time in this forum - and sometimes the answer is not a complete "no", although there is never an explanation of how a "yes" could look like...

Thus: is it possible to create .so files for Linux or .dylib files for MacOSX in a similar way as one can create .dll files for Windows?

One could then implement functions using PB and make them available to other languages and environments.

Thanks in advance for any hint!

Kind regards,

Andreas Rozek
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Post by Foz »

You did check the Compiler Options screen where you select the type of executable didn't you?
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

oops,

I was so fixed to looking into the forum first that I forgot to experiment with PB under MacOS X first...

Thanks for the hint and "mea culpa".

Sorry for bothering you!
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Post by Foz »

Don't worry, it happens to the best of us :lol:
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

Hello again!

Today, after several other projects I found some time to test building dynamically loadable libraries under Mac OS X.

However, I failed - here are my results

- the current "official" version produces a shared object, however, this library does not contain the symbol I tried to export
- the current "beta 4" simply emits a "linker error"
- "beta 5" complains about a missing "_main" symbol

Does anybody have any idea how I can build (the equivalent of) DLLs under Mac OS X (and, later, Linux)?

Thanks in advance for any help!
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

Hmm, strange...

By "playing around" with the creation of "shared objects" under Mac OS X (Version 4.20) I found out:

- the given function names are never exported
- instead, PB exports the following symbols
- PS#, _ClearLoop# and _Procedure# with # = 0,2,4, ...
- _EndProcedure# with # = 0,1,2,3...

Let "n" be the number of functions to be exported, then

- the first series stops at 2*(n-1)
- the second series stops at 2*(n-1)+1

This looks really strange - does anybody have an explanation?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I have, i have! Look at me! Look at me!

What I remember (to be confirmed by Fred):
Actually, it's broken for OS X at the moment. For Linux it should work.
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

oops,

that's bad - is there any information when it will work (again)?
Fred
Administrator
Administrator
Posts: 16681
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Trond is right, dylib on OS X doesn't work for now. It's planned for 4.40.
Rozek
User
User
Posts: 64
Joined: Thu Jul 05, 2007 12:19 pm
Location: Böblingen (Germany)

Post by Rozek »

Thanks for the response!

Hmmm, this means that it will take a while...we are currently within the beta process of 4.30.

Kind regards,

Andreas Rozek
Niffo
Enthusiast
Enthusiast
Posts: 500
Joined: Tue Jan 31, 2006 9:43 am
Location: France

Post by Niffo »

Hello,

Please Fred, can you tell us what is really non-functional in Mac Version of PB :
- the generation (compilation) of dynlibs by PB
- the use of dynlibs (made in C for example) from PB ?
- both ?

Regards
Niffo
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

It's probably only the generation, anything else would be stupid.
Fred
Administrator
Administrator
Posts: 16681
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Yes, it's only the generation from PB code.
Niffo
Enthusiast
Enthusiast
Posts: 500
Joined: Tue Jan 31, 2006 9:43 am
Location: France

Post by Niffo »

Thank you very much Fred for your answer
Niffo
Post Reply