views:

200

answers:

2

Hi,

I am trying to port a C++ program from Linux to Windows using cygwin. I have it building and linking fine now, but when I launch the program, it exits immediately with an error. When I try it in gdb, I get the following 'unknown target exception' result:

$ gdb ../../bin/ARCH.cygwin/release/myApp
GNU gdb 6.8.0.20080328-cvs (cygwin-special)
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html&gt;
This GDB was configured as "i686-pc-cygwin"...
(no debugging symbols found)
(gdb) run
Starting program: bin/ARCH.cygwin/release/myApp.exe
[New thread 1452.0x99c]
gdb: unknown target exception 0xc0000139 at 0x77149eed

Program exited with code 030000000471.
You can't do that without a process to debug.

When not in gdb, it raises dialog that reads: "A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available."

Any ideas what I may have done wrong?

Thanks.

-William

+2  A: 

Microsoft describes 0xC0000139 as STATUS_ENTRYPOINT_NOT_FOUND. That suggests your program isn't being linked properly. Double-check your build scripts to make sure it compiles and links all relevant files.

If you are using any libraries, then you might have a linking issue there (or maybe you are missing a DLL of some sort).

You might be able to get more information by checking out the error report it has generated - the error message Microsoft associates with that error should include exactly what entry point it couldn't find.

Michael Madsen
+2  A: 

STATUS_ENTRYPOINT_NOT_FOUND typically means that you are linking with a function that is not implemented on the system on which the program is running; i.e. you are trying to call a function on Windows XP but it was only implemented starting with Windows Vista. You could use Dependency Walker to see which particular function(s) cannot be found.

Luke