I have a 3rd party open source library I am trying to get a LCB wrapper around. Uncer LC 9.6.8, I have it working on macOS with built .dylib file in <mylibrary>/code/x86_64-mac/ folder. I.E. such as <mylibrary>/code/x86_64-mac/mylibrary.dylib. I have placed the corresponding Windows (32 bit) .dll file (same name, but with .dll extension) in <mylibrary>/code/x86-win32/mylibrary.dll
In my LCB code, I am referring to the libraries with (as a generic example):
foreign handler someAPI (<typed argument list>) \
returns optional <type> \
binds to "c:mylibrary>someAPI"
I have it working on macOS, but the same code does not work on Windows, returning "unable to load foreign library".
Do I have the path wrong to the .dll wrong? Is it that I am running the 64 version of LC 9.6.8, but am trying to use a 32 bit dll library?
Any pointers in the right direction are welcome...
LCB Newbie question on file placement
-
- VIP Livecode Opensource Backer
- Posts: 137
- Joined: Wed Aug 26, 2009 7:42 pm
- Location: Randolph, MA USA
- Contact:
LCB Newbie question on file placement
Paul Dupuis
Researchware, Inc.
Researchware, Inc.
-
- VIP Livecode Opensource Backer
- Posts: 137
- Joined: Wed Aug 26, 2009 7:42 pm
- Location: Randolph, MA USA
- Contact:
Re: LCB Newbie question on file placement
A related question. If I am passing file paths to the FFI should I assume I need to use macOS delimters when on macOS (i.e /) and Windows delimiters when on Windows (i.e. \)?
Paul Dupuis
Researchware, Inc.
Researchware, Inc.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: LCB Newbie question on file placement
From memory, I believe you're correct about the file path delimiters.
Re a 32-bit dll in a 64-bit environment, I'm not sure about either the placement or the feasibility.
Re a 32-bit dll in a 64-bit environment, I'm not sure about either the placement or the feasibility.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
Re: LCB Newbie question on file placement
@paul:
Re file delimiters - it will depend on the thirdparty library's API but yes, almost all cross-platform libraries I have encountered expect native file paths for functions taking paths to files.
Re 32-bit/64-bit - 64-bit processes cannot load 32-bit shared libraries - this is true on every platform. So if you only have a 32-bit build of the dll, then you have to use the 32-bit version of the LiveCode engine.
Re file delimiters - it will depend on the thirdparty library's API but yes, almost all cross-platform libraries I have encountered expect native file paths for functions taking paths to files.
Re 32-bit/64-bit - 64-bit processes cannot load 32-bit shared libraries - this is true on every platform. So if you only have a 32-bit build of the dll, then you have to use the 32-bit version of the LiveCode engine.
-
- VIP Livecode Opensource Backer
- Posts: 137
- Joined: Wed Aug 26, 2009 7:42 pm
- Location: Randolph, MA USA
- Contact:
Re: LCB Newbie question on file placement
Thank you. Using the Win32 version of LC9.6.8 the same code that worked on the macOS works on Windows (with the 32 bit .dll of the library). Okay, so now I guess I have to (re)learn how to actually compile C-something source on my computer to make a 64bit dll library.
All the answers were much appreciated.
All the answers were much appreciated.
Paul Dupuis
Researchware, Inc.
Researchware, Inc.
-
- VIP Livecode Opensource Backer
- Posts: 3581
- Joined: Mon Jan 22, 2007 7:36 am
- Location: Berkeley, CA, US
- Contact:
Re: LCB Newbie question on file placement
LOL.
And thanks for the confirmation, LCMark.
And thanks for the confirmation, LCMark.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev