1

OS: Windows XP

IDE: Visual Studio 2005

Language: C/C++

Coding for: Unigraphics NX (which is a type of CAD software), specifically an external automation in Open C (but this may not be important)

I'm trying to code an external program for NXOpen - which, for those unfamiliar with it, means it runs on Windows, instead of within NX (which would be an internal program). I decided to comment out all the interesting stuff and just test it using some printf statements to make sure that everything was properly linked.

Apparently, it's a good thing I did, because when I try to run the .exe that was generated, I get the error "This application failed to start because libufun.dll was not found. Re-installing the application may fix this problem." libufun.dll belongs to the UG library.

From what I've read so far, the file may be corrupted. However, it may also simply have some strange linking problem (what with all these strange libraries), and I want to look for issues of that sort before trying to find a new copy of the file. I've already checked that the Linker->General->Additional Library Dependencies path is correct, and that the related system variable hasn't changed. All is well, there.

Is there anything else I should check or do to make this work?

Thanks!

Abbas
  • 3,872
  • 6
  • 36
  • 63
Rae
  • 309
  • 3
  • 9
  • @Hans well yes, I did find it; it's with a bunch of other required DLLs which leads me to believe I've got some linking issue with the containing directory. – Rae Aug 11 '11 at 13:18
  • I don't link a DLL. Copy the one you found into the same directory as the main EXE. – Hans Passant Aug 11 '11 at 13:19
  • I did; it just told me I needed another dll, and when I added that one, that I needed another. When I added the path to the containing directory to the PATH environment variable, is stopped giving me this problem, and now I'm getting another error instead: "The procedure entry point ?JPEG_convert_to_rgb@@YAPAEHPAEPAH1@Z could not be located in the dynamic link library libimage.dll" – Rae Aug 11 '11 at 13:29
  • 1
    This problem is solved, now you have another one. Post another question. – Hans Passant Aug 11 '11 at 13:41

2 Answers2

1

There is a environment variable UGII_ROOT_DIR. Find this variable and add it to the PATH variable to get the project working.

PATH=%PATH%;%UGII_ROOT_DIR%;

The main environment variables that drive Unigraphics NX are UGII_BASE_DIR and UGII_ROOT_DIR. UGII_BASE_DIR is the folder in which NX has been installed. UGII_ROOT_DIR is the folder where all the executables are located. When NX is installed these two environment variables are created.

Abbas
  • 3,872
  • 6
  • 36
  • 63
-1

1)find libufun.dll, put it in same folder with your .exe
2)My Computer - Properties - Advanced - Environment Variables, edit PATH variable, add directory containing libufun.dll to PATH
3) set PATH with directory containing libufun.dll inside IDE
If you linked dynamically(as you did), this dll should be in PATH or near (in same folder) your exe everytime you run this application.
If you dont like this, you should link statically with appropriate .lib files, this way you wont need dll.

all
  • 314
  • 5
  • 16
  • 1. Putting libufun.dll right in the folder only earned more errors of the same type, for other missing .dlls, so there must be some sort of missing link to the directory. 2. This answer appeared to work until I got a new error - "The procedure entry point ?JPEG_convert_to_rgb@@YAPAEHPAEPAH1@Z could not be located in the dynamic link library libimage.dll" – Rae Aug 11 '11 at 12:49
  • use second method then, add directory with libufun.dll and other dlls in your system PATH. usually it is "bin" or "lib/xxx_dll" directory inside library directory. **Should be same path you used inside IDE** " Linker->General->Additional Library Dependencies" from your post – all Aug 11 '11 at 12:54
  • Yeah, I just did that...the initial error message went away, but now I'm getting "The procedure entry point ?JPEG_convert_to_rgb@@YAPAEHPAEPAH1@Z could not be located in the dynamic link library libimage.dll" as an error instead. What did I break? – Rae Aug 11 '11 at 13:02
  • I think it means libimage is found, but it doesnt contain appropriate function. (dlls contain function as in regular program but they usually are called from other apps). It means your program calls this function, but cant find appropriate reference. Maybe libimage.dll that loaded into memory doesnt contain this function. Thus you are getting this error. You should explore why it doesnt then. I dont use that library, and cant help further. Maybe you have 2 different libimage.dlls? or there is no libimage.dll in your path? You need to check what libimage.dll is loaded into memory – all Aug 11 '11 at 13:12
  • you can explore loaded dlls using free tool "Process Explorer" – all Aug 11 '11 at 13:22
  • If you wont find clue, link statically(other linker options + libs instead of dlls, check library and IDE docs). – all Aug 11 '11 at 13:25