1. Win32 not finding a DLL after Binding
- Posted by penpal0andrew Jun 11, 2009
- 1009 views
After binding a Euphoria program which uses Win32, and moving it along with the C language DLL which I use, to another computer, the Euphoria program (exe) did not find the DLL. I keep the DLL in the same directory/folder as the exe. Is there anything in the computer environment which could cause this problem?
0.70.4 is the win32 library version
A. Katz
2. Re: Win32 not finding a DLL after Binding
- Posted by jacquesd Jun 11, 2009
- 978 views
- Last edited Jun 12, 2009
dll are searched in the following order:
1) main program directory
2) %windir%\system32
If the DLL's are in same directory as main program it should find them but it may depend on user access rights. Check security tab in the directory properties dialog to see if the user as sufficient access rights. This is true only for windows 2000/xp/vista member of a domain. For personnal edition or professional edition not member of an active directory domain there is no security tab visible. In that case you should open cmd.exe and use cacls.exe to display and modify access control list for the directory.
to display ACL for directory:
to give "user_name" full control to "app_dir" type in cmd.exe
cacls app_dir /E /T /G:user_name F
jacques
After binding a Euphoria program which uses Win32, and moving it along with the C language DLL which I use, to another computer, the Euphoria program (exe) did not find the DLL. I keep the DLL in the same directory/folder as the exe. Is there anything in the computer environment which could cause this problem?
0.70.4 is the win32 library version
A. Katz
3. Re: Win32 not finding a DLL after Binding
- Posted by penpal0andrew Jun 12, 2009
- 960 views
This is not the problem. No matter where I place the files on the destination computer, the DLL is not found. And no matter where I place the files on the development computer, the DLL is found. Thinking this may be a DLL problem, I went to the destination computer and re-created the DLL from source files. The result was the same. I looked into Euphoria, and this is base Euphoria, and not win32. The code in Euphoria is:
draw_dll = open_dll ("Draw_MGS.dll") -- xxxx if draw_dll = 0 then abortErr( "DLL file not found" ) end if
This issue needs to be resolved. I suspect it is related to the binding process. Another possibility is that the destination computer once had Euphoria on it and it was removed incorrectly?
dll are searched in the following order:
1) main program directory
2) %windir%\system32
If the DLL's are in same directory as main program it should find them but it may depend on user access rights. Check security tab in the directory properties dialog to see if the user as sufficient access rights. This is true only for windows 2000/xp/vista member of a domain. For personnal edition or professional edition not member of an active directory domain there is no security tab visible. In that case you should open cmd.exe and use cacls.exe to display and modify access control list for the directory.
to display ACL for directory:
to give "user_name" full control to "app_dir" type in cmd.exe
cacls app_dir /E /T /G:user_name F
jacques
After binding a Euphoria program which uses Win32, and moving it along with the C language DLL which I use, to another computer, the Euphoria program (exe) did not find the DLL. I keep the DLL in the same directory/folder as the exe. Is there anything in the computer environment which could cause this problem?
0.70.4 is the win32 library version
A. Katz
4. Re: Win32 not finding a DLL after Binding
- Posted by penpal0andrew Jun 12, 2009
- 1000 views
This may be a Dev C issue. Euphoria being bound or not does not matter. There may be something which causes a DLL to not be found which does not mean it is not found. It means it is not a valid DLL?
5. Re: Win32 not finding a DLL after Binding
- Posted by mattlewis (admin) Jun 12, 2009
- 947 views
This is not the problem. No matter where I place the files on the destination computer, the DLL is not found. And no matter where I place the files on the development computer, the DLL is found. Thinking this may be a DLL problem, I went to the destination computer and re-created the DLL from source files. The result was the same. I looked into Euphoria, and this is base Euphoria, and not win32. The code in Euphoria is:
draw_dll = open_dll ("Draw_MGS.dll") -- xxxx if draw_dll = 0 then abortErr( "DLL file not found" ) end if
Here are a few ideas:
- Have you tried using absolute paths?
- Do you have the dll installed to Windows\System32 on the dev machine, but not on the production machine?
- Can you open the file for reading?
draw_dll = open( "Draw_MGS.dll", "r" )
Matt
6. Re: Win32 not finding a DLL after Binding
- Posted by penpal0andrew Jun 12, 2009
- 1005 views
This is not the problem. No matter where I place the files on the destination computer, the DLL is not found. And no matter where I place the files on the development computer, the DLL is found. Thinking this may be a DLL problem, I went to the destination computer and re-created the DLL from source files. The result was the same. I looked into Euphoria, and this is base Euphoria, and not win32. The code in Euphoria is:
draw_dll = open_dll ("Draw_MGS.dll") -- xxxx if draw_dll = 0 then abortErr( "DLL file not found" ) end if
Here are a few ideas:
- Have you tried using absolute paths?
- Do you have the dll installed to Windows\System32 on the dev machine, but not on the production machine?
- Can you open the file for reading?
draw_dll = open( "Draw_MGS.dll", "r" )
Matt
I found the problem. There are nested dependencies in the DLL I developed. And it happened to find these libraries from another application I installed, which does not exist in the other computer. The tool to use to find DLL dependencies is http://www.dependencywalker.com/ . This is not a Euphoria issue thank goodness.
7. Re: Win32 not finding a DLL after Binding
- Posted by ghaberek (admin) Jun 12, 2009
- 1003 views
I found the problem. There are nested dependencies in the DLL I developed. And it happened to find these libraries from another application I installed, which does not exist in the other computer. The tool to use to find DLL dependencies is http://www.dependencywalker.com/ . This is not a Euphoria issue thank goodness.
I love Dependency Walker. I'd be lost without it sometimes.
-Greg
8. Re: Win32 not finding a DLL after Binding
- Posted by mattlewis (admin) Jun 12, 2009
- 991 views
I found the problem. There are nested dependencies in the DLL I developed. And it happened to find these libraries from another application I installed, which does not exist in the other computer. The tool to use to find DLL dependencies is http://www.dependencywalker.com/ . This is not a Euphoria issue thank goodness.
It always seems so obvious in hindsight. Depdencywalker is a great tool.
Matt