Author Topic: fatal error LNK1104: cannot open file 'game.def'  (Read 10565 times)

Offline THE_SUFFERER

  • Multiple posting newcomer
  • *
  • Posts: 20
fatal error LNK1104: cannot open file 'game.def'
« on: January 11, 2020, 08:09:23 pm »
I am trying to compile a gamex86.dll for a 1999 game. My compiler is Microsoft Visual ToolKit 2003.
Firstly the compilation gave me a lot of errors like "cannot open .lib\.h file".
Then after settings all "Linker settings" and "Search directories" they stopped to appear. Now I still have a similar error but this time .def file can't be opened. I don't know what to do cause it's not either .lib or .h, it's a different thing.

LINK : fatal error LNK1104: cannot open file 'game.def' >:(

At the same time I mentioned it in the paths, too, but Code::Block still doesn't want to cooperate with me... :'(
« Last Edit: January 11, 2020, 08:12:20 pm by THE_SUFFERER »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #1 on: January 11, 2020, 08:26:22 pm »
I'd start with the stuff depicted here: http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Do you have a def file? Do you really need to use it? Modern compilers/linkers don't need those, I think, but I might be wrong, because I'm not actively using windows any more.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline THE_SUFFERER

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #2 on: January 12, 2020, 06:11:27 pm »
I have read the page you gave me. There's no word about .def file missing, only about .lib, .h and so on.

Well, if my game sdk requires this game.def file, then it's needed for some reason.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #3 on: January 12, 2020, 06:54:13 pm »
The link has generic instructions and some examples.
Have you checked every command C::B executes?
Have you checked that the game.def file is passed to the correct executable and the command line flags are correct? (this is depicted in the link  8) )

And if you don't post the full build log we can't do much. Even if you post it some of the problems can be resolved only by executing some tools (like objdump and nm) on your local files.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline THE_SUFFERER

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #4 on: January 12, 2020, 07:23:23 pm »
The fact of the matter is that actually there hasn't to be any necessity to check something in the code itself because what I am compiling wasn't written by me. It's SDK from the game developers. They just gave it to public. So, it should work and all code which is inside is correct.

Moreover, I was doing everything due to the instruction - https://kingpin.info/?p=compiling-with-codeblocks

The problem is the author of the article says he has no errors - just foolow the instruction and compilations goes perfctly. When I try doing the same, I have some problems. Firstly, I had issues with missing .lib and .h files, now I solved it by adding some additional paths. I guess this error (game.def) can be solved with a few mouse clicks, too but I don't know what it can be. Neither does the author himself cause he doens't have an idea why I am dealing with all of this stuff while he isn't...

If you want you can try following that instruction, too, I can give that SDK that contains those .c and .h files for compilation. If it works for you perfectly - the problem is at my side. If you have some troubles, the guide is broken.

Attaching the build log and build messages.


Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #5 on: January 12, 2020, 09:25:24 pm »
Moreover, I was doing everything due to the instruction - https://kingpin.info/?p=compiling-with-codeblocks

No you didn't. The author of that "guide" doesn't seem to know what he is really doing and therefor offers some random try-and-error advices how to fix things because he did them wrong in the first place.

One of these advices is to try different path specifications to that def file. That seems to be the problem in your case, that file is not in the working directory of the compiler which should be the directory of the CodeBlocks project file. Determine the relative path to the def file starting at the directory of the project file and add that to the compiler settings, then it will be found.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline THE_SUFFERER

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #7 on: January 14, 2020, 04:47:07 pm »
Moreover, I was doing everything due to the instruction - https://kingpin.info/?p=compiling-with-codeblocks

No you didn't. The author of that "guide" doesn't seem to know what he is really doing and therefor offers some random try-and-error advices how to fix things because he did them wrong in the first place.

One of these advices is to try different path specifications to that def file. That seems to be the problem in your case, that file is not in the working directory of the compiler which should be the directory of the CodeBlocks project file. Determine the relative path to the def file starting at the directory of the project file and add that to the compiler settings, then it will be found.

I mentioned this "game.def" file EVERYWHERE ;D I could (attaching screens) but still it it's not found.
Plus I put the ToolKit 2003 folder into the CodeBlock directory.

Well, kind of some mystery.... :o

Offline THE_SUFFERER

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #8 on: January 14, 2020, 04:47:43 pm »
Moreover, I was doing everything due to the instruction - https://kingpin.info/?p=compiling-with-codeblocks

No you didn't. The author of that "guide" doesn't seem to know what he is really doing and therefor offers some random try-and-error advices how to fix things because he did them wrong in the first place.

One of these advices is to try different path specifications to that def file. That seems to be the problem in your case, that file is not in the working directory of the compiler which should be the directory of the CodeBlocks project file. Determine the relative path to the def file starting at the directory of the project file and add that to the compiler settings, then it will be found.

Offline THE_SUFFERER

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #9 on: January 14, 2020, 04:48:23 pm »
Moreover, I was doing everything due to the instruction - https://kingpin.info/?p=compiling-with-codeblocks

No you didn't. The author of that "guide" doesn't seem to know what he is really doing and therefor offers some random try-and-error advices how to fix things because he did them wrong in the first place.

One of these advices is to try different path specifications to that def file. That seems to be the problem in your case, that file is not in the working directory of the compiler which should be the directory of the CodeBlocks project file. Determine the relative path to the def file starting at the directory of the project file and add that to the compiler settings, then it will be found.

Offline THE_SUFFERER

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #10 on: January 14, 2020, 04:49:08 pm »
Moreover, I was doing everything due to the instruction - https://kingpin.info/?p=compiling-with-codeblocks

No you didn't. The author of that "guide" doesn't seem to know what he is really doing and therefor offers some random try-and-error advices how to fix things because he did them wrong in the first place.

One of these advices is to try different path specifications to that def file. That seems to be the problem in your case, that file is not in the working directory of the compiler which should be the directory of the CodeBlocks project file. Determine the relative path to the def file starting at the directory of the project file and add that to the compiler settings, then it will be found.

Offline THE_SUFFERER

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #11 on: January 14, 2020, 04:50:25 pm »
Moreover, I was doing everything due to the instruction - https://kingpin.info/?p=compiling-with-codeblocks

No you didn't. The author of that "guide" doesn't seem to know what he is really doing and therefor offers some random try-and-error advices how to fix things because he did them wrong in the first place.

One of these advices is to try different path specifications to that def file. That seems to be the problem in your case, that file is not in the working directory of the compiler which should be the directory of the CodeBlocks project file. Determine the relative path to the def file starting at the directory of the project file and add that to the compiler settings, then it will be found.

Offline THE_SUFFERER

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #12 on: January 14, 2020, 04:51:06 pm »
Moreover, I was doing everything due to the instruction - https://kingpin.info/?p=compiling-with-codeblocks

No you didn't. The author of that "guide" doesn't seem to know what he is really doing and therefor offers some random try-and-error advices how to fix things because he did them wrong in the first place.

One of these advices is to try different path specifications to that def file. That seems to be the problem in your case, that file is not in the working directory of the compiler which should be the directory of the CodeBlocks project file. Determine the relative path to the def file starting at the directory of the project file and add that to the compiler settings, then it will be found.

Offline THE_SUFFERER

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #13 on: January 14, 2020, 04:52:55 pm »
Moreover, I was doing everything due to the instruction - https://kingpin.info/?p=compiling-with-codeblocks

No you didn't. The author of that "guide" doesn't seem to know what he is really doing and therefor offers some random try-and-error advices how to fix things because he did them wrong in the first place.

One of these advices is to try different path specifications to that def file. That seems to be the problem in your case, that file is not in the working directory of the compiler which should be the directory of the CodeBlocks project file. Determine the relative path to the def file starting at the directory of the project file and add that to the compiler settings, then it will be found.

By the way, I even put this file into each directory I also mentioned (include\libs...) but still nothing... ;D

Offline THE_SUFFERER

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: fatal error LNK1104: cannot open file 'game.def'
« Reply #14 on: January 14, 2020, 04:54:53 pm »
Moreover, I was doing everything due to the instruction - https://kingpin.info/?p=compiling-with-codeblocks

No you didn't. The author of that "guide" doesn't seem to know what he is really doing and therefor offers some random try-and-error advices how to fix things because he did them wrong in the first place.

One of these advices is to try different path specifications to that def file. That seems to be the problem in your case, that file is not in the working directory of the compiler which should be the directory of the CodeBlocks project file. Determine the relative path to the def file starting at the directory of the project file and add that to the compiler settings, then it will be found.