0

I created a program using C++ with netbeans on my computer. I would like the exe file to open somewhere else. It opens all fine on my computer, but i tested it on a computer in school without netbeans or cygwin. After doing research, i attempted to put a cygwin1.dll file in the same directory as my exe but that just breaks the exe even on my computer.

What is the best way to do this, from another computer? Here are some options i have so far:

1. Install cygwin.dll file on System 32
2. change variable path (Not sure what the path is, but i will find out)

Some options i want to avoid:

1. Installing netbeans or cygwin

Extra notes: only issue i have is opening the compiled .exe file from another computer all computers will be using windows

Links i have looked at http://www.dll-files.com/dllindex/dll-files.shtml?cygwin1 http://pcsupport.about.com/od/findbyerrormessage/a/cygwin1-dll-not-found-missing-error.htm

Darryl Chapman
  • 319
  • 2
  • 8
  • 21
  • 1
    Why do you use cygwin? Do you know mingw? Cygwin is more for developing linux applications (or applications using linux capabilities) on Windows systems (it's a whole linux/posix environment for Windows). Mingw is more for developing Windows applications on Windows. ;) – leemes May 20 '13 at 11:24
  • @leemes Would you recommend i use mingw and simply recompile it then? – Darryl Chapman May 20 '13 at 11:25
  • 1
    If you didn't choose cygwin for a reason, yes. Do you come from the linux world? Did you just start learning programming? – leemes May 20 '13 at 11:26
  • Just started programming, and nope.. Come from Windows and plan to use windows. So i will use mingw :) Thank you very much – Darryl Chapman May 20 '13 at 11:27
  • Mingw should be easy to set up. Once installed, remember to change the compiler in netbeans. Netbeans is only your IDE which *uses* the compiler, so you have to tell netbeans *what* compiler to use. Maybe you have/want to change the *debugger* in netbeans to mingw too, I don't know the settings in netbeans but it might be separate from the compiler settings. The debugger is a program which can be run alongside your program to, well, debug it ;) Then you can step through your program, inspect and change variable values etc. An important tool to find and fix bugs. – leemes May 20 '13 at 11:29
  • I have mingw installed already, i have looked onto the netbeans settings to use this compiler but im not quite sure what im doing. Is there any way you could help? – Darryl Chapman May 20 '13 at 11:31
  • I'm not familiar with Netbeans, but I'm pretty sure you find good instructions in the internet. According to [this post](http://stackoverflow.com/a/771774/592323), the target computer doesn't have any additional DLL installed / shipped with your exe. So this seems to be what you want. :) – leemes May 20 '13 at 11:33
  • I found how to change the build to minGW, and i have done that, rebuilt the program and it builds fine. The only way i can check if it works on another computer is to be on another computer in which i will have to wait for. Thank you very much Leemes, have been a great help! – Darryl Chapman May 20 '13 at 11:35

1 Answers1

2

Unfortunately the executable will search for cygwin.dll by name so renaming it will not work. Also, putting stuff in System32 is a bad idea mainly for security reasons (you don't want to update the school's IT department) and it's possible to mess the machine up by playing around in that folder. Changing the path is ok but, again, the permanence of the change means you should shy away from it.

If I were you, I'd create a .bat file, say myapp.bat which has the lines

set PATH=%PATH%;<location>
<myapp>

where <location> is the location of cygwin.dll and <myapp> is the full path to your executable (including the file name). You could then double click on this batch file. The first line in this file updates the path by appending the location of the dll but only in a way pertinent to that particular session. Make sense?

Bathsheba
  • 220,365
  • 33
  • 331
  • 451