# C++11 Demos
- [Overview](#overview)
- [Building and Running the Demos on Linux and macOS](#building-and-running-the-demos-on-linux-and-macos)
- [Building and Running the Demos on Windows](#building-and-running-the-demos-on-windows)
- [Building the Demo Apps for Universal Windows Platform (UWP)](#building-the-demo-apps-for-universal-windows-platform-uwp)
## Overview
This directory contains C++ sample programs for various Ice components; they all
use the Ice C++11 mapping. These examples are provided to get you started on
using a particular Ice feature or coding technique.
Most of the subdirectories here correspond directly to Ice components, such as
[IceGrid](./IceGrid), [Glacier2](./Glacier2), and so on. We've also included the
following additional subdirectories:
- [Manual](./Manual) contains complete examples for some of the code snippets
in the [Ice manual][1].
- [Chat](./Chat) contains the C++ server, and two command-line clients
for the ZeroC [Chat Demo][2].
## Building and Running the Demos on Linux and macOS
### Prerequisites
The makefiles require GNU make 3.80 or later.
On macOS, the command-line demos require the Xcode Command Line Tools to be
installed (use `xcode-select --install` to install them). The Xcode sample
program for iOS require the [Ice Builder for Xcode][3].
If you've installed Ice in a non-standard location, you'll need to set the
`ICE_HOME` environment variable with the path name of the
installation directory:
```
export ICE_HOME=~/testing/ice
```
### Building the Demos
Review the settings in `../make/Make.rules`. For example, set `OPTIMIZE=yes`
to build with optimization.
When you're ready to start the build, run `make`, for example:
```
make V=1
```
`V=1` in the example above turns on verbose output.
The `clean` and `distclean` targets allow you clean all the demos. `clean`
removes the binary files created by the build; `distclean` removes all these
files plus the C++ files generated by slice2cpp.
You can also build or clean a single demo with `make <demo-path>[_clean|_distclean]`,
for example:
```
make V=1 Ice/hello
make Ice/hello_distclean
```
To build the Xcode iOS example, open `C++11 demos (iOS).xcworkspace` in Xcode.
### Running the Demos
Refer to the README.md file in each demo directory for usage instructions.
## Building and Running the Demos on Windows
### Prerequisites
The projects for the sample programs require the [Ice Builder for Visual
Studio][5]. Add this extension to Visual Studio before opening the solution.
### Building the Demos
#### Building the demos using NuGet packages:
Open the solution file `C++11 demos.sln` to build the sample programs.
The demos are configured to use Ice C++ binary distribution, packaged with
NuGet. The build downloads automatically the Ice NuGet package.
If you have disabled the automatic download of NuGet packages by Visual Studio,
you need to restore the packages before you build using `Tools > NuGet Package
Manager > Manage NuGet Packages for Solution...` in Visual Studio.
Then select your target configuration (Debug or Release) and platform (Win32
or x64). Right click on the desired demo in the Solution Explorer window and
select `Build`.
#### Building the demos without using NuGet packages:
- Build from command line:
* Open a Visual Studio command prompt
```
cd ice-demos\cpp11
MSBuild /p:ICE_SRC_DIST=all /p:IceHome=<Ice dist path> /p:Configuration=<Release or Debug> "C++11 demos.sln"
```
- Build from Visual Studio
* Open a Visual Studio command prompt
```
set ICE_SRC_DIST=all
devenv
```
* When Visual Studio starts set `Ice home directory` in
`Tools > Options > Projects and Solutions > Ice Builder`
* Disable automatic restoring of NuGet packages in Visual Studio
`Tools > Options > NuGet Package Manager`
* Select your target configuration (Debug or Release) and platform (Win32 or
x64). Right click on the desired demo in the Solution Explorer window and
select `Build`.
### Running the Demos
You need to add the Ice `bin` directory to your PATH before running the demos.
If are building Debug, add both the Debug and Release `bin` directories with a
command similar to:
```
set PATH=%USERPROFILE%\ice-demos\cpp11\packages\zeroc.ice.v140.3.7.0\build\native\bin\x64\Debug;%USERPROFILE%\ice-demos\cpp11\packages\zeroc.ice.v140.3.7.0\build\native\bin\x64\Release;%PATH%
```
This is required because the Debug `bin` directories provide only a subset of all
Ice services and tools. For example, they don't provide `glacier2router`.
If you are building Release, you should add only the Release `bin` directory to
your PATH with a command similar to:
```
set PATH=%USERPROFILE%\ice-demos\cpp11\packages\zeroc.ice.v140.3.7.0\build\native\bin\x64\Release;%PATH%
```
Then refer to the README.md file in each demo directory for usage instructions.
## Building the Demo Apps for Universal Windows Platform (UWP)
### Prerequisites
The projects for the sample programs require the [Ice Builder for Visual Studio][4].
Add this extension to Visual Studio before opening the solution.
### Building the Demos
#### Building the demos using NuGet packages:
Open the solution file `C++11 demos (Universal Windows).sln`.
If you have disabled the automatic download of NuGet packages by Visual Studio,
you need to restore the packages before you build using `Tools > NuGet Package
Manager > Manage NuGet Packages for Solution...` in Visual Studio.
The NuGet packages for UWP consist mostly of static libraries and PDB files
and are very large (about 300 MB compressed for each compiler). As a result, the
first restore can take a long time; subsequent restores on the same computer are
faster as they use the local NuGet cache.
Then select your target configuration (Debug or Release), and platform
(Win32, x64 or ARM). Right click on the desired demo in the Solution Explorer
window and select `Build`.
#### Building the demos using an Ice source build:
- Build from command line:
* Open a Visual Studio command prompt
```
cd ice-demos\cpp11
MSBuild /p:ICE_SRC_DIST=all /p:IceHome:<Ice dist path> "C++11 demos (Universal Windows).sln"
```
- Build from Visual Studio
* Open a Visual Studio command prompt
```
set ICE_SRC_DIST=all
devenv
```
* When Visual Studio starts set `Ice home directory` in
`Tools > Options > Projects and Solutions > Ice Builder`
* Disable automatic restoring of NuGet packages in Visual Studio
`Tools > Options > NuGet Package Manager`
* Select your target configuration (Debug or Release) and platform (Win32, x64
or ARM). Right click on the desired demo in the Solution Explorer window and
select `Build`.
### Running the Demos
Refer to the README.md file in each demo directory for usage instructions.
[1]: https://doc.zeroc.com/display/Ice37/Ice+Manual
[2]: https://doc.zeroc.com/display/Doc/Chat+Demo
[3]: https://github.com/zeroc-ice/ice-builder-xcode
[4]: https://github.com/zeroc-ice/ice-builder-visualstudio
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ice-demos-3.7.0 (2000个子文件)
config.admin 444B
config.admin 444B
config.admin 412B
config.admin 412B
config.admin 359B
config.admin 359B
config.admin 359B
config.admin 359B
config.admin 359B
config.admin 359B
config.admin 359B
config.admin 359B
config.admin 346B
config.admin 346B
config.admin 274B
config.admin 143B
config.admin 143B
config.admin 143B
config.admin 142B
config.admin 142B
Make.rules.AIX 2KB
Package.uwp.appxmanifest 2KB
Package.uwp.appxmanifest 2KB
Package.uwp.appxmanifest 2KB
Package.uwp.appxmanifest 2KB
Package.uwp.appxmanifest 2KB
.babelrc 172B
gradlew.bat 2KB
gradlew.bat 2KB
gradlew.bat 2KB
gradlew.bat 2KB
server.bks 3KB
client.bks 3KB
client.bks 3KB
books 3KB
config.chatserver 902B
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1KB
config.client 1019B
config.client 1019B
config.client 1019B
config.client 1005B
config.client 986B
config.client 976B
config.client 962B
config.client 952B
config.client 947B
config.client 929B
config.client 928B
config.client 927B
config.client 927B
config.client 918B
config.client 906B
config.client 906B
config.client 896B
config.client 883B
config.client 883B
config.client 864B
config.client 864B
config.client 858B
config.client 856B
config.client 856B
config.client 855B
config.client 851B
config.client 851B
config.client 851B
config.client 839B
config.client 837B
config.client 835B
config.client 834B
config.client 834B
config.client 834B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
seebit
- 粉丝: 9
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功