Archived

This forum has been archived. Please start a new discussion on GitHub.

when I try the example Application in chapter 3,I get some problem.

when I try the example Application in chapter 3,I got some problem.
The name is "A Hello World Application"

---development platform
vc 7.1
win2000 professional simplified chinese
ice 1.20

when I copy the code in pdf and run it,every thing is ok.
when I change something,I got three error report as follow:

1.
c:\Documents and Settings\administrator\My Documents\Visual Studio Projects\testc\print.cpp(418): fatal error C1010: unexpected end of file while looking for precompiled header directive

2.
C:\Ice-1.2.0\include\IceUtil\Config.h(97): fatal error C1189: #error : "Only unicode libraries can be used with Ice!"

3.
C:\Ice-1.2.0\include\IceUtil\Config.h(107): fatal error C1189: #error : "Only multi-threaded DLL libraries can be used with Ice!"

The thing I do is that,I create new vc projects of .net form,
.net console and win32 console.And copy the useful code of
"A Hello World Application" into my projects. And run them in turn.
But I got same three error report . When I change my configration
to use unicode,the second error disappear.But others are still there.
I think there should be some specification that I don't know
about it. Can you tell me?

Comments

  • xiehua,

    I believe that this is a Visual Studio .NET 2003 configuration problem.

    Check this post on how to configure VS.NET 2003 for ICE. :)

    Hope this helps.

    Alex
  • thank you for your help,Alex
    I go to the post.

    1.
    c:\Documents and Settings\administrator\My Documents\Visual Studio Projects\testc\print.cpp(418): fatal error C1010: unexpected end of file while looking for precompiled header directive

    oh,but when I creat the project of win32 console,the first error
    report is still there.

    And there is another error report:
    4.
    error C2664: "Ice::initialize": cannot convert parameter 2 from '_TCHAR *[]' to 'char *[]'

    when begin,I didn't select the "empty project",so the system
    generate some code for me.Is here any wrong with me?
  • Precompiled header directive

    Hi there,

    I, too, am getting the same result:

    server.cpp(36) : fatal error C1010: unexpected end of file while looking for precompiled header directive

    and the configuration information on the listed posting a couple replies back hasn't been able to rectify it. It very well may be a Visual Studio 2003 .NET configuration issue, but considering I just had it installed and haven't made any changes to it, one would think that it would work out-of-the-box. If not, would it be possible to include instructions on how to get it to work "the first time" with Visual Studio?

    Thanks in advance,

    --Sean
  • turn off precompiled headers

    Nevermind. Just go to Properties->C/C++->PrecompiledHeaders->Create/UsePrecompiledHeader and set it to "Not Using Precompiled Headers".

    Another random thing that needed to be fixed, which I found here on this site, is that if you don't have RTTI on, it will cause some random problems. Set Properties->C/C++->Language->EnableRunTimeTypeInfo to "Yes (/GR)".
  • sean wrote:
    Nevermind. Just go to Properties->C/C++->PrecompiledHeaders->Create/UsePrecompiledHeader and set it to "Not Using Precompiled Headers".

    Another random thing that needed to be fixed, which I found here on this site, is that if you don't have RTTI on, it will cause some random problems. Set Properties->C/C++->Language->EnableRunTimeTypeInfo to "Yes (/GR)".

    a project base on MFC
    compile-error occur when i set it as you said. (VS.Net 2003-VC++7.1)

    error C2146: syntax error : missing ';' before identifier 'm_wndStatusBar'
    MainFrm.h(34) : error C2501: 'CMainFrame::CStatusBar' : missing storage-class or type specifiers
    MainFrm.h(34) : error C2501: 'CMainFrame::m_wndStatusBar' : missing storage-class or type specifiers
    MainFrm.h(35) : error C2146: syntax error : missing ';' before identifier 'm_wndToolBar'
    MainFrm.h(35) : error C2501: 'CMainFrame::CToolBar' : missing storage-class or type specifiers
    MainFrm.h(35) : error C2501: 'CMainFrame::m_wndToolBar' : missing storage-class or type specifiers
    MainFrm.h(50) : error C2146: syntax error : missing ';' before identifier 'm_strUserID'
    MainFrm.h(50) : error C2501: 'CMainFrame::CString' : missing storage-class or type specifiers
  • bernard
    bernard Jupiter, FL
    Hi,

    Please update your signature as described here.

    Thanks,
    Bernard
  • bernard wrote:
    Hi,

    Please update your signature as described here.

    Thanks,
    Bernard

    OK.
    i have updated my signature.
  • matthew
    matthew NL, Canada
    It looks like you are not including the MFC headers. Did you check the MFC demos that accompany the Ice distribution to see how to use MFC & Ice together?
  • matthew wrote:
    It looks like you are not including the MFC headers. Did you check the MFC demos that accompany the Ice distribution to see how to use MFC & Ice together?

    I've got it, just set UsePrecompiledHeader to "Auto..." or "Use ... " and include "stdafx.h" in ice distribution