question

Upvote
Accepted
588 14 21 19

fatal error RC1015: cannot open include file 'afxres.h'

I just downloaded the Elektron SDK 1.0.6 for C++ and I’m trying to build the packages examples. When I load and build the solution (Elektron-SDK1.0.6.win\Ema\Examples\Training\Training_VS140.sln) with my Visual Studio 2015, I get the following error:

5>Ema.rc(9): fatal error RC1015:
cannot open include file 'afxres.h'.

Why do I have this error? Can you please help me?

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apic++example
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi AHS,

This is a fake question I just posted myself.

I'll answer it in a couple of days. Please, don't add any comment.

Upvotes
Accepted
7.6k 15 6 9

@Jenny Johnson

The error seems to generate from ema project because it requires the header file from MFC. As far as I understand, visual studio 2015 default setup does not install Visual C++ MFC package. Therefore you need to modify the Visual Studio 2015 setup and add the MFC .

Please close VS2015 and goto Control Panel->Programs and Features->Microsoft Visual Studio <Professional/Enterprise>->Change->Modify->Add Microsoft Foundation Classes.

Then re-open visual studio 2015 and re-build the solution.


screenshot1.png (26.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

It worked just fine. The examples solution builds perfectly well now.

Thanks you very much for the help.

Upvote

Or, if you don't want to install MFC, you can replace the line:

#include "afxres.h"

with:

#include<windows.h>

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.