In Heroes of Might and Magic IV (aka Heroes of Might and Magic 4, HOMM 4, HOMM IV) this error occurs when the name of the executable used to launch the program differs:
multiplayer_msg_general_failure
The content of the executable does not matter, it is the name. So both must use for example h4tour351.exe, even though in Equilibris 3.51 it has the same content as h4mod.exe.
The moves following here look like a harmless, automated trade of the minor pieces. But actually I (white) missed a chance to win material here. What should I have done in move 14?
The actual game is below. Find the moves for white that win material.
I have never had problems with JNI. In the few situations when I needed it, it just worked. But last week someone asked me for help with his problem. When I tried to reproduce it, I found out that it had spread even to my old JNI programs which worked until 2006!
When running a program that uses a native function the following error occured:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Test.dll: Can't find dependent libraries
It’s obviously a linker problem related to the generation of the .dll file. I have no idea why it occurs now and didn’t occur in the past. Different OS, compiler version, something like that? For some reason both the linker of Visual Studio and the linker of GCC started to think that is was a good idea to replace all method names by some arbitrary name which then cannot be found at runtime.
Fix for GCC
To fix that with GCC, the linker opion --add-stdcall-alias can be used.
For Microsoft Visual C Compiler it should theoretically be possible with a linker option as well.
Find out the correct linker option
First compile and link in the usual way that didn’t work. This will create the .dll file which results in the error we are talking about. Then use the dumpbin tool to list the procedure names:
dumpbin HelloWorld.dll /EXPORTS
You will find your procedure name, something like _Java_HelloWorld_print@8. Now try to guess what the name should be. My guess in this case would be Java_HelloWorld_print. This would result in the linker option /EXPORT:Java_HelloWorld_print=_Java_HelloWorld_print@8
Option 3 is probably the easiest. After that dumpbin will show that now there is an additional procedure with the correct name:
dumpbin HelloWorld.dll /EXPORTS
I even compared it with the working .dll I created with GCC (see above), and it looks the same! But it doesn’t work, still getting the same error!
50 USD through PayPal for a solution and an explanation why the current way doesn’t work even though the procedure name is the same as in the working .dll created with GCC. (Only the first solution gets the price; only valid as long as this text is here.)
BxB, white’s best option is to take the black queen, then use the bishop to pike the white queen and white rook. This is one possible line: 22. … Bxg2 23. Rxf6 Be4 24. Qf1 Bxf6 25. Qxf6 Re6 26. Qf2 Bxb1 27. d5 Re5 28. Bxe5 dxe5 29. Qb2 Bf5 30. d6
Once again I (black) got in trouble after my opponent engaged multiple threads at once with 20. f4:
Who is the one in trouble?
I used up almost all my time to think of a way out. Usually there is one in such a situation. But I didn’t see that actually there was not only a way to get out with minor material disadvantage, but even with a significant advantage!
20 … Na5 prepares a pin of the white knight to the white king with one of the rooks. Moving the knight away does not work: 21. Nd3 Rhc8+ 22. Kd1 Qa4+, which uses the black queen to fork the white king and the white rook and wins a rook.
Those two major threats considered, this is a reasonable continuation: 20. … Na5 21. fxe5+ Kg7 22. e6. After this delay black has a chance to play out his advantages: 22. … Rhc8 23. Qc3+ Qxc3+ 24. bxc3 Rxc5 25. Rxf7+ Kh6
My own “solution” was a bit puny. If you look at how I won, please consider that after that situation I had only two minutes left :-) show
[Event "rated standard match"]
[Site "Free Internet Chess Server"]
[Date "2008.08.05"]
[Round "?"]
[White "bobbilipili"]
[Black "Magnakai"]
[Result "0-1"]
[WhiteElo "1584"]
[BlackElo "1722"]
[ECO "B54"]
[TimeControl "1200+20"]
1. e4 c5 2. Nf3 d6 3. d4 cxd4 4. Nxd4 a6 5. c4 g6 6. Be3 Bg7 7. Nc3 Nf6 8.
Qd2 Nc6 9. f3 e5 10. Nb3 Be6 11. O-O-O Ke7 12. Bh6 $2 {Crafty (score -0.14 at
depth 11) thinks this is not a good move} ({Crafty suggests:} 12. g4 b5 13.
Nd5+ Bxd5 14. exd5 Na7 15. c5 Qc7 16. c6 Rhc8 $16 {(score 1.14 at depth 9)} )
Bxh6 13. Qxh6 Qb6 14. c5 dxc5 15. Qe3 Nd7 16. Na4 Qb4 17. Naxc5 Nxc5 18. Nxc5
Bxa2 19. Rd7+ Kf6 20. f4 $4 {Crafty (score -3.75 at depth 9) thinks this is a
blunder} ({Crafty suggests:} 20. Rxb7 Qd4 21. Qxd4 Nxd4 22. b4 Rhc8 23. Rb6+
Be6 24. Bxa6 Rc7 25. Rd6 $11 {(score 0.05 at depth 10)} ) Rhd8 $4 {Crafty
(score -0.15 at depth 9) thinks a good move has been missed} ({Crafty
suggests:} 20. ... Na5 21. fxe5+ Kg7 22. e6 Rhc8 23. Qc3+ Qxc3+ 24. bxc3 Rxc5
25. Rxf7+ Kh6 26. c4 Bxc4 27. Bxc4 Rxc4+ $19 {(score -3.75 at depth 9)} ) 21.
fxe5+ Kg7 22. Rxb7 Qd4 23. Ne6+ $4 {Crafty (score -5.36 at depth 12) thinks
this is a blunder} ({Crafty suggests:} 23. Qxd4 Nxd4 24. b3 Rac8 25. Kb2 Rxc5
26. Kxa2 Ra5+ 27. Kb2 Rxe5 28. Bc4 Ne6 29. Bxa6 Rxe4 $11 {(score -0.13 at
depth 11)} ) Kg8 $4 {Crafty (score 5.77 at depth 11) thinks this is a
blunder} ({Crafty suggests:} 23. ... Bxe6 24. Qxd4 Rxd4 25. Rc7 Nxe5 26. g3
Rc8 27. Rxc8 Bxc8 28. Bg2 Bb7 29. Rd1 Rc4+ 30. Kd2 Bxe4 31. Bxe4 Rxe4 $19
{(score -5.36 at depth 12)} ) 24. Nxd4 Rxd4 $4 {Crafty (score 9.95 at depth
12) thinks this move loses more quickly} ({Crafty suggests:} 24. ... Nxd4 25.
Rc7 Rab8 26. Rc3 a5 27. Bc4 Bxc4 28. Rxc4 Nb3+ 29. Kc2 Rd2+ 30. Qxd2 Nxd2 31.
Kxd2 Rxb2+ $18 {(score 5.77 at depth 10)} ) 25. Rc7 $4 {Crafty (score 7.02 at
depth 10) thinks this is not the quickest way to win} ({Crafty suggests:} 25.
Rb6 Rc8 26. Bxa6 Nxe5+ 27. Bxc8 Rc4+ 28. Kd2 Rxc8 29. b3 Bxb3 30. Qxb3 Nc4+
31. Ke2 Nxb6 32. Qxb6 $18 {(score 9.95 at depth 12)} ) Bb3 $4 {Crafty (score
11.16 at depth 10) thinks this move loses more quickly} ({Crafty suggests:}
25. ... Na5 26. Be2 Rad8 27. Rd1 Nb3+ 28. Kc2 Rxd1 29. Bxd1 $18 {(score 7.02
at depth 10)} ) 26. Rxc6 $4 {This offers a mate in 1 to the opponent}
({Crafty suggests:} 26. Be2 a5 27. Rxc6 Rb4 28. Rf1 Rd8 29. Qf3 a4 30. Rd6
Rd4 31. Rxd8+ Rxd8 $18 {(score 11.16 at depth 10)} ) Rd1# {bobbilipili
checkmated} 0-1