I could not slice my ice file with slice2cpp.exe if I write include <Glacier2\Session.ice>

senses1senses1 Member boyue TanOrganization: PersonalProject: Interface of Server

I used -I param in command line but the included file includes other ice files too.
then I specified the include path in ice.msbuilder extenion in vs2017 ,but still not to know how to work.
and I run in Nuget package manage command line with slice2cpp myfile.ice. but It still can not open include file.

and my ice file is

pragma once

include <Glacier2/Session.ice>

module Interface
{
// 消息反馈类型枚举
enum MsgType
{
// 机器人报错
MsgError = 1,
// 机器人定位
MsgLocation = 2,
// 机器人急停
MsgEmergency = 3,
// 通用信息
MsgGeneral = 4
};

//MES系统需要实现的接口,后台应用调用
interface IMESFunctions
{

    void RobotStateMsg(MsgType type, int MsgCode);


    void JobFinish(int iTaskID, string strTaskMark);

};

//后台应用需要实现的接口,MES系统调用
interface IServerFunctions extnds Glacier2::Session
{
    //登录至服务器
    bool Login(string strUser,IMESFunctions* pFuncs);

    //登出服务器
void Logout(string strUser);

    //查询机器人状态
    bool CheckRobotState();

    //发送任务执行
    bool SendTask(string taskMark,int ExecCnt);

    //退出服务程序
    void ExitApp();
};

};

Best Answers

  • xdmxdm La Coruña, SpainJose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Accepted Answer

    This seems related to the Chinese characters in your root path, I was able to reproduce the problem trying to build a project in D:\登录至服务器\hello but same project works fine when build in D:\hello\hello I'm still debugging the cause of this meanwhile you can rename the root directory to workaround the issue.

    Cheers,
    José

  • xdmxdm La Coruña, SpainJose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Accepted Answer

    Seems your C++ project is using zeroc.ice.net package but that is not correct you should use zeroc.ice.v141 (for VS 2017) or zeroc.ice.v140 (for VS 2015)

    The zeroc.ice.net official packages don't include slice2cpp.exe seems you build it your self or copied it from a different distribution, I guess it does not match the 3.7.1 version and that is why you see the errors related to the ignoring invalid global metadata

    You should uninstall zeroc.ice.net package from the C++ projects and then install the zeroc.ice.v141

Answers

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Accepted Answer

    This seems related to the Chinese characters in your root path, I was able to reproduce the problem trying to build a project in D:\登录至服务器\hello but same project works fine when build in D:\hello\hello I'm still debugging the cause of this meanwhile you can rename the root directory to workaround the issue.

    Cheers,
    José

  • senses1senses1 Member boyue TanOrganization: PersonalProject: Interface of Server

    I modified the path name,
    but errors come next like:
    1>D:\ice-csharp\slice\Glacier2\SSLInfo.ice(-1): error : : ignoring invalid global metadata cpp:doxygen:include:Glacier2/Glacier2.h' 1>D:\ice-csharp\slice\Glacier2\SSLInfo.ice(-1): error : 1>D:\ice-csharp\slice\Glacier2\Session.ice(-1): error : : ignoring invalid global metadatacpp:doxygen:include:Glacier2/Glacier2.h'
    1>D:\ice-csharp\slice\Glacier2\Session.ice(-1): error :
    1>D:\ice-csharp\slice\Ice\BuiltinSequences.ice(-1): error : : ignoring invalid global metadata cpp:doxygen:include:Ice/Ice.h' 1>D:\ice-csharp\slice\Ice\BuiltinSequences.ice(-1): error : 1>D:\ice-csharp\slice\Ice\Identity.ice(-1): error : : ignoring invalid global metadatacpp:doxygen:include:Ice/Ice.h'
    1>D:\ice-csharp\slice\Ice\Identity.ice(-1): error :smile:

    I think the file has some character which belongs to doxygen make this.

  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff

    That seems like a different project, the included path D:\ice-csharp\slice\ doesn't match the NuGet package of the previous project, can you turn on the "Detailed" build output in "Options > Projects and Solutions > Build and Run" and post the complete build log

  • senses1senses1 Member boyue TanOrganization: PersonalProject: Interface of Server

    the log file is attached,thank you for your concern

    log.txt 35.8K
  • xdmxdm La Coruña, SpainAdministrators, ZeroC Staff Jose Gutierrez de la ConchaOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Accepted Answer

    Seems your C++ project is using zeroc.ice.net package but that is not correct you should use zeroc.ice.v141 (for VS 2017) or zeroc.ice.v140 (for VS 2015)

    The zeroc.ice.net official packages don't include slice2cpp.exe seems you build it your self or copied it from a different distribution, I guess it does not match the 3.7.1 version and that is why you see the errors related to the ignoring invalid global metadata

    You should uninstall zeroc.ice.net package from the C++ projects and then install the zeroc.ice.v141

  • senses1senses1 Member boyue TanOrganization: PersonalProject: Interface of Server

    The slice passed!!! Thank you!!! Jose

Sign In or Register to comment.