Re: wxEuphoria cannot load library even if libwxeu.dll is present in path
- Posted by ghaberek (admin) Mar 06, 2018
- 1477 views
What would also be nice would be to tell the user whether the interpreter is running in 32 or 64 bits, for instance Phix has machine_bits().
Do you mean like this? We already have ifdef values for these things, and this is precisely how they should be used.
-- Example 3: -- This routine is phix specific. For compatibility with OpenEuphoria the following can be used (copied from builtins\cffi.e): --/* public function machine_bits() ifdef BITS64 then return 64 elsedef return 32 end ifdef end function --*/
I guess you could put a known 32 bit dll and a known 64 bit dll in the folder, and attempt to open them both. Success on one would indicate the architecture of the interpreter.
No please don't do this. Shared libraries should not be handled this way. Don't let the interpreter decide which architecture library to attempt to load.
Put libraries of the same architecture in C:\Euphoria\bin next to the interpreter and set up multiple environments, or store and load them in your project directory like this:
bin\ 32\ library.dll 64\ library.dll
ifdef BITS64 then constant LIB_PATH = "bin/64" elsedef constant LIB_PATH = "bin/32" end ifdef atom library = open_dll( LIB_PATH & "/library.dll" )
-Greg