0

I am able to successfully build a C++ project, but when I go to run the application, for whatever reason it builds successfully but then outputs on the console " (exit value: -1,073,741,511)".

Nothing is under "Problems" as well when I check there.

  1. where does one find references or documentation for what these mean? I cannot find this information.
  2. Any suggestions for dealing with this? I don't understand why it builds successfully but then gives the error when running.
  3. Why is there no more details given? The termination exit value implies a DLL file is missing, but yet no information is given about what's missing. How do I output more information? Console Output
Prospero
  • 109
  • 1
  • 11
  • When you see a crazy number like -1,073,741,511, convert it to hex (C0000139) and see if it's more recognizable. C0000139 is a Windows error code for "Couldn't find a DLL" (More precisely, "entry point not found", but that's almost always because a DLL is missing). Microsoft will have a big list of their codes, but I don't know where they have stashed in. – user4581301 Nov 09 '21 at 16:07
  • @user4581301 Thank you. I'm new to Eclipse. When you get an error that "couldn't find a DLL", does this mean likely I'm missing something like cygwin.dll or it's not in the system path? How was the program able to "build" though and not run because wouldn't all the compiling and linking be done in the building stage and the "run" stage is merely where I run the executable? Confused on that. – Prospero Nov 09 '21 at 16:39
  • @Prospero -- A DLL is not involved in the build process. DLL's only come into play when you actually run the program, and Windows attempts to search for it (and can't find the DLL file). – PaulMcKenzie Nov 09 '21 at 16:58
  • Haven't used Cygwin in years and never under Eclipse, but if Eclipse couldn't find cygwin's dlls, the build probably wouldn't even start. Eclipse could be running the program with a different path, though. Side note: Are you using cygwin for a reason? There are many easier to use and manage toolchains for Windows ([here's instructions for a good one](https://stackoverflow.com/a/30071634/4581301)), so unless you need the POSIX layer, you may be causing yourself needless problems. – user4581301 Nov 09 '21 at 17:34
  • @user4581301 I'm not sure if it's Cygwin's DLL Eclipse can't find, I was just guessing. How do I get more information from this cryptic hex output and why is it in hex to begin with? How can I see more detailed termination output? I also just updated the post with a picture of what shows up. So you're sure it's because Eclipse can't locate some sort of DLL file? Now how do I know which one it can't? – Prospero Nov 09 '21 at 17:44
  • I use a tool called [Process Monitor](https://learn.microsoft.com/en-us/sysinternals/downloads/procmon) (and used to use [Dependency Walker](https://en.wikipedia.org/wiki/Dependency_Walker)) to help figure out what DLL is missing. – user4581301 Nov 09 '21 at 17:53
  • @user4581301 _Microsoft will have a big list of their codes, but I don't know where they have stashed in._ Unfortunately, definitions of all those error codes are scattered across several Windows header files. However, Microsoft provide their [Error Lookup Tool](https://learn.microsoft.com/en-us/windows/win32/debug/system-error-code-lookup-tool) for quick decoding. Just feed it the error code as an argument on command line. (Also, if you run this tool with no arguments, a list of almost 200 currently searched headers will be shown.) – heap underrun Nov 09 '21 at 18:48
  • @user4581301 Can you explain how I would use this Process Monitor tool in Eclipse exactly? Please describe the process for using it. How does this happen where the DLL is missing when I've already built it? What DLL could be missing for the build stage but not the execution stage? Perhaps this can help me narrow it down to which I should be looking at. Thanks. – Prospero Nov 09 '21 at 22:21
  • @heapunderrun Do you know what's going on here and what could be missing and why I can build but not run my program? – Prospero Nov 09 '21 at 22:23
  • There used to be really good documentation on the usage. Now it seems to be bundled into a book. Bummer. Filter process monitor to look only at the executable that's failing to run, then run the program. One of the last things in the trace will be the DLL it's looking for. Depending on how complicated the program is there might be a lot of other stuff done as the program shuts down. Here's a decent outline: https://www.codeproject.com/Articles/560816/Troubleshooting-dependency-resolution-problems-usi – user4581301 Nov 09 '21 at 22:36
  • @Prospero On Windows, executables compiled from C++ source code usually need specific DLLs (called run-time libraries) to run. (This is unless you link run-time libraries statically during the build.) Sometimes, those run-time library DLLs can be installed system-wide, but if not, those need to be present either in the same folder as the executable itself or at least in the Windows standard DLL search path. Try manually locating (in Windows File Explorer) and double-clicking the executable you've just built, and see if a more detailed error will pop up. – heap underrun Nov 09 '21 at 22:43
  • @heapunderrun Thanks. When I find the executable and click it, I get more details, but still cryptic: "procedural entry point "opal_database_is_monotonic" could not be located in dynamic link library c:\cygwin\bin\cygmppi-40.dll". This implies it has something to do with MPI I am using with Cygwin I assume, correct? What does the "opal_database_is_monotonic" mean in this context? – Prospero Nov 10 '21 at 19:29
  • This is a much more detailed and helpful error message. Googling around, I think you've misspelt the DLL's name: it's `cygmpi-40.dll` (with just one P), as well as the missing function's name: it's `opal_datatype_is_monotonic` (i.e., datatype, not database). I'm not familiar with Open MPI, but just guessing: maybe you have an older version of that DLL installed, which didn't provide that particular function yet? Or perhaps it is a 64-bit DLL, and your EXE is 32-bit (or vice versa)? Or maybe you have more than one `cygmpi-40.dll` installed in your system, and this one is somehow incompatible? – heap underrun Nov 10 '21 at 23:36

0 Answers0