The application was unable to start correctly (0xc

2018-12-31 16:58发布

I have a client/server app which I have been developing on a single PC. Now it needs two serial ports, so I borrowed a PC from a friend.

When I build my app and try to run or debug it (whether in the Delphi IDE or from Windows File manager), it errors "The application was unable to start correctly (0xc000007b)".

Googling doesn't bring up much, but seems to indicate that this is nothing Delphi specific and happens with other apps. It seems to be caused by calling into a 32 bit DLL from a 64 bit app or vice versa.

  • both PCs are Windows 7, 64 bit
  • both have Delphi Xe2 starter edition which can only handle 32 bits
  • The app runs fine on my PC, but not on my friend's
  • Other Delphi apps run just fine on both PCs

Can anyone give me a hint as to how to track this down?

16条回答
旧人旧事旧时光
2楼-- · 2018-12-31 17:04

Also download and unzip "Dependencies" into same folder where you put the wget.exe from

http://gnuwin32.sourceforge.net/packages/wget.htm

You will then have some lib*.dll files as well as wget.exe in the same folder and it should work fine.

(I also answered here https://superuser.com/a/873531/146668 which I originally found.)

查看更多
不再属于我。
3楼-- · 2018-12-31 17:07

It has been mentioned in earlier answers that using dependency walker is the way to go, in my case (my application keeps failing with the error code), dependency walker showed a few dll that are NOT relevant!

Finally figured out that I can run profiling by going to "profile" menu and it will run the application and stop at the exact dll that's cause the problem! I found out a 32bit dll was picked because of path and fixed it.

enter image description here

查看更多
梦寄多情
4楼-- · 2018-12-31 17:10

To start, I would suggest to test whether there is a problem between your application and its dependencies using dependency walker

查看更多
梦寄多情
5楼-- · 2018-12-31 17:13

This may be a case where debugging the debugger might be useful. Essentially if you follow the instructions here you can run two ide's and one will debug into the other. If you un your application in one, you can sometimes catch errors that you otherwise miss. Its worth a try.

查看更多
不流泪的眼
6楼-- · 2018-12-31 17:14

I recently had an issue where I was developing an application (that used a serial port) and it worked on all the machines I tested it on but a few people were getting this error.

It turns out all the machines that the error happened on were running Win7 x64 and had NEVER ONCE been updated.

Running a Windows update fixed all of the machines in my particular case.

查看更多
琉璃瓶的回忆
7楼-- · 2018-12-31 17:16

Just solved this problem for my personal project (thanks to Dries for that). For me it was because the project path was too long. After saving the .sln to a shorter path (C:/MyProjects) and compiling from there it ran without the error.

查看更多
登录 后发表回答