Home Help Center

Is ICE compatible with MFC?

I make a based MFC program,just only add two files(Printer.cpp and printer.h) that was create by compile the file of Printer.ice into this project.
then,compile this project,but reports an error.
e:\servermfc\printer.cpp(825) : fatal error C1010: unexpected end of file while looking for precompiled header directive.

I do know whether ICE is compatible with MFC.
appreciate for help.

Comments

  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    Yes. There are other threads in this forum on exactly this topic. You can also look at the MFC demos included with the Ice distribution -- demo/Ice/MFC/...

    I will be presenting a series of articles in Connections about integrating Ice with GUI toolkits (in particular Trolltech's Qt) and the problems that occur -- starting with the next edition. The compilation error that you are encountering is the least of your worries :)
  • mariomario Member
    Hi YuQiao,

    This error is due to the use of precompiled headers, switched on by default in MFC projects.

    You have two options: deactivate the use of precompiled headers (in Printer.cpp or the whole project) or telling slice2cpp to generate the corresponding #include <stdafx.h> with --add-header (Ice 3.x+, see docs).

    Hope that helps.

    Mario
  • hero107hero107 Member
    Thank you very much !!
Sign In or Register to comment.