Why does ⎕NA fail with a "FILE ERROR 2"?
Forum rules
The FAQ is a read-only forum which is in general updated only by employees of Dyalog Ltd. It replaces the FAQ page which existed under http://www.dyalog.com. Rather than rejecting other posts to this forum, such posts will be put in a moderation queue, and moved to a more appropriate forum.
The FAQ is a read-only forum which is in general updated only by employees of Dyalog Ltd. It replaces the FAQ page which existed under http://www.dyalog.com. Rather than rejecting other posts to this forum, such posts will be put in a moderation queue, and moved to a more appropriate forum.
1 post
• Page 1 of 1
Why does ⎕NA fail with a "FILE ERROR 2"?
A "FILE ERROR 2 The system cannot find the file specified" for ⎕NA usually means that the DLL cannot be loaded. We use the Windows API LoadLibrary call to load DLLs.
There are two possible reasons why LoadLibrary cannot load your DLL.
The first possibility to explore is that the DLL is not in the same directory as the executable or in a directory on the system path.
First, find the location of the DLL. Now, you can choose one or more of the following three methods to correct this issue.
If you have completed step 1 and the DLL still does not load, your operating system is missing DLLs that the DLL requires. To find out which DLLs are missing, use the Dependency Walker on it. You can download Dependency Walker from http://www.dependencywalker.com.
There are two possible reasons why LoadLibrary cannot load your DLL.
The first possibility to explore is that the DLL is not in the same directory as the executable or in a directory on the system path.
First, find the location of the DLL. Now, you can choose one or more of the following three methods to correct this issue.
- A) Change the ⎕NA call so it also specifies the full path name.
- Code: Select all
'GetEnvironmentVariable'⎕NA'u kernel32|GetEnvironmentVariable* <0T >0T U'
GetEnvironmentVariable'PATH' 4096 4096
B) You can add the location of the DLL to be part of the system path. You can use the following APL code to find out what your system path is currently:
C) Copy the DLL to be in the same directory that your executable is in.
If you have completed step 1 and the DLL still does not load, your operating system is missing DLLs that the DLL requires. To find out which DLLs are missing, use the Dependency Walker on it. You can download Dependency Walker from http://www.dependencywalker.com.
- Vince|Dyalog
- Posts: 413
- Joined: Wed Oct 01, 2008 9:39 am
1 post
• Page 1 of 1
Return to Frequently Asked Questions (FAQ)
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group