1. dll (probably newbie) issue.

Hello all. I've been away from Euphoria for a very long time, and I'm giving it another go. Unfortunately, I've forgotten quite a bit, and Euphoria has also (it seems) changed quite a bit.

Here is my first hang up. I'm trying to load a dll, and failing.

-- qeuti_dll.e 
 
include std/dll.e 
 
atom dll_handle 
 
global function define_qeuti_proc(object routine_name, sequence arg_types) 
	return define_c_proc(dll_handle, routine_name, arg_types) 
end function 
 
procedure openQeutiDLL() 
	-- TODO: More extensive search, use of platform to handle Linux, etc. 
	dll_handle = dll:open_dll({"qeuti.dll", "./qeuti.dll"}) 
	if dll_handle = 0 then 
		puts(1, "Qeuti: Fatal:  Could not open qeuti.dll\n") 
		abort(1) 
	end if 
end procedure 
 
procedure initialize() 
	openQeutiDLL() 
end procedure 
 
initialize() 

dll_handle is reporting zero, even though I've ensured that the qeuti.dll is in the same directory as the include file, and that I'm running my test file in this directory as well. Also, I've gone out of my way to make sure all dlls qeuti.dll is dependent on is also in the directory. The only hang-up I can think of is that this is a 32-bit dll running in a 64-bit system, but unfortunately the Qt Creator doesn't offer a 64-bit Mingw compiler. Ideas?

PS C:\Users\Travis\Workshop\qeuti\eu> eui --version 
Euphoria Interpreter v4.1.0 development 
   64-bit Windows, Using System Memory 
   Revision Date: 2015-02-02 14:18:53, Id: 6300:57179171dbed 
 
Windows 10 64-bit 

new topic     » topic index » view message » categorize

2. Re: dll (probably newbie) issue.

Travis_Beaty said...

The only hang-up I can think of is that this is a 32-bit dll running in a 64-bit system, but unfortunately the Qt Creator doesn't offer a 64-bit Mingw compiler. Ideas?

PS C:\Users\Travis\Workshop\qeuti\eu> eui --version 
Euphoria Interpreter v4.1.0 development 
   64-bit Windows, Using System Memory 
   Revision Date: 2015-02-02 14:18:53, Id: 6300:57179171dbed 
 
Windows 10 64-bit 

Yes, from the version output, you are using a 64bit eui.exe binary. You can't loead a 32bit dll in a 64bit eui. You can run a 32bit eui on Windoze 10 64-bit OS, though. If you do that, then that should resolve this one issue.

new topic     » goto parent     » topic index » view message » categorize

3. Re: dll (probably newbie) issue.

I tried using the 32-bit version of Euphoria ... still, no good. In the past I've dealt with a lot of "dll hell" when it comes to building Windows apps using the Mingw version of Qt, and I suspect that this might be the cause of my issues. I'm downloading the 64-bit Qt Creator version that uses the VS build tools, and will try again with that. Not the best solution, since I really didn't want to have to juggle two different C compilers between platforms, but we'll see. Will reply again once I get that set up and tested.

new topic     » goto parent     » topic index » view message » categorize

4. Re: dll (probably newbie) issue.

Okay. Odd things are happening, well at least odd to me.

I built qeuti.dll using the Microsoft Visual CPP compiler, but initially forgot to add __declspec(dllexport) to the function definition in my header file. This resulted in a dll that did not have the external function exposed, of course, but what is odd is that Euphoria (now 64-bit Euphoria with 64-bit dll) successfully opened the dll in this state.

Later, when I added the __declspec(dllexport), the function was exposed, but Euphoria once again could not open the dll. What am I missing here?

new topic     » goto parent     » topic index » view message » categorize

5. Re: dll (probably newbie) issue.

Strongly suspecting missing dlls after a little chat with Dependency Walker. /me fills page with raging obscenities concerning dlls.

new topic     » goto parent     » topic index » view message » categorize

6. Re: dll (probably newbie) issue.

Travis_Beaty said...

Okay. Odd things are happening, well at least odd to me.

I built qeuti.dll using the Microsoft Visual CPP compiler, but initially forgot to add __declspec(dllexport) to the function definition in my header file. This resulted in a dll that did not have the external function exposed, of course, but what is odd is that Euphoria (now 64-bit Euphoria with 64-bit dll) successfully opened the dll in this state.

Later, when I added the __declspec(dllexport), the function was exposed, but Euphoria once again could not open the dll. What am I missing here?

not sure if this is exactly the problem reported, a problem is that Qt is c++ so you can't directly link to call routines. euqt is a wrapper for Qt started by Jeremy that creates a shim wrapper. you link to it, then the wrapper links to Qt.

  • assuming you have written a shim dll, I haven't tried using MSVC compiler build of the euqt shim yet but I am not sure if that would be able to work properly, especially for translation. there is a problem with Qt using different compilers than the one the lib was built with. do a search if you are curious. quite the nightmare, though Qt itself is forward and backward compatible to an extent. you have to recompile Qt or use the proper compiler.

which version of Qt?

new topic     » goto parent     » topic index » view message » categorize

7. Re: dll (probably newbie) issue.

ne1uno said...

not sure if this is exactly the problem reported, a problem is that Qt is c++ so you can't directly link to call routines. euqt is a wrapper for Qt started by Jeremy that creates a shim wrapper. you link to it, then the wrapper links to Qt.

I have done this in the past, usually using extern "C". I switched back to trying with the 32-bit Euphoria and the 32-bit dll built by Qt Creator using Mingw. It looks like that even though the dll is 32-bit, it is calling 64-bit libraries, which might be the issue. So I can either have a 64-bit Euphoria that can't open 32-bit dlls, or a 32-bit Euphoria that's trying to open a 32-bit dll that itself calls 64-bit libraries.

Meh. This was just sort of a napkin project anyway, so I may just give this up and try something a bit less taxing.

Or ... try to get Linux work on this newer machine with its wacky UEFI.

new topic     » goto parent     » topic index » view message » categorize

8. Re: dll (probably newbie) issue.

Well ... fwiw having the exact same problem using Xubuntu 15.10.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu