Author Topic: Compile error - "cannot open include file 'afxres.h'."  (Read 14779 times)

Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Compile error - "cannot open include file 'afxres.h'."
« on: July 05, 2013, 01:29:34 am »
I am running into this error while compiling.

1>OpenXcom.rc(11): fatal error RC1015: cannot open include file 'afxres.h'.

Following the compiling instructions on the wiki, I downloaded VS C++ 2010 express, downloaded the dependencies from the pre-compiled link provided, and ran the .sln. I am familiar wtih git, so I know I have the latest git branch. Where is this missing file from?

Thanks.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Compile error - "cannot open include file 'afxres.h'."
« Reply #1 on: July 05, 2013, 06:27:48 am »
to get rid of this error, you can either:
Delete OpenXcom.rc from the project, as mentioned on the wiki,
or alternatively:
create a new file called afxres.h in the folder: C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\

and paste the following into it:
Code: [Select]
#ifndef __AFXRES_H__
#define __AFXRES_H__

#include <Windows.h>
#include <CommCtrl.h>
#define IDC_STATIC -1

#endif /*__AFXRES_H__*/


Offline Shoes

  • Commander
  • *****
  • Posts: 502
    • View Profile
Re: Compile error - "cannot open include file 'afxres.h'."
« Reply #2 on: July 05, 2013, 05:29:18 pm »
I even read the FAQ and I missed that. This is going to be a long modding project. :x Thanks

Here is the error I get now:

Code: [Select]
1>------ Build started: Project: OpenXcom, Configuration: Debug Win32 ------
1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


I am going to install the dependencies from the 3rd FAQ. The stuff I had was more recent.
« Last Edit: July 05, 2013, 06:14:10 pm by Shoes »