Plain Framework 11 is mainly used for the development of Network (game) C + + Framework installation Chapter

Source: Internet
Author: User
Tags odbc vc9 mysql command line

The last time we introduced the basic information about the plain framework, the framework is officially open for release today. The address of the project is hosted on GitHub and I believe most of my friends should know. Today's introduction to the framework's directory infrastructure, as well as examples of installation on Linux and Windows platforms, respectively. In order to let beginners or technology is not too solid friends can quickly get started, I am here step by step from the development environment of the building to tell the first more complete example (Gateway server), each step is today from the blank system began to operate in a timely manner, by Jane into the deep, if you do not understand please go to the Exchange Group inquiry. (New system centos7.0 and above my script is temporarily unable to install through the environment)

Source Address

Https://github.com/viticm/plainframework1

Directory structure

Framework Basic Introduction

Address: http://www.cnblogs.com/lianyue/p/3972492.html

Reference Manuals

Reference manuals are being written in the process, will first sync to the blog, because these articles may not go home, interested friends may wish to pay attention to the blog.

Continuous update

If the framework finds a new bug or has content updates, it will continue to sync to the GitHub project.

LINUX INSTALL

This selection of Linux system is CentOS (6.5), you can try other Linux systems can also. With a Linux system installed, or a Linux system already in place, we start to build the LNMP environment (Web development environment). You can find the relevant information on the Web, or use the script I provided to install, but PHP version is preferably more than 5.4 version, this is for future expansion reservation.

First you have to make sure that Git is installed on your system, and if it is not installed, install it with the following command (Networking required):

Yum Install git

Then install the framework source code in your development directory, such as:

mkdir&& git clone https://github.com/viticm/plainframework1

1. Use the script within the framework for online installation (must be installed with root permission)

CD plainframework1/tools/script/linux/installsudosh install_web_develop. SH

2, using the provided offline package and script for offline installation (must use root privileges, no network to note the following instructions)

Can go to Baidu Cloud disk to take the offline installation package: Link: http://pan.baidu.com/s/1eQzQMem Password: BYCV

Place the package in the/web directory and unzip it with the following command:

mkdir tar -XJVF web. tar. bz2

If you do not have a network, you guarantee that after installing the necessary tools such as GCC, g++, CMake, the Cdownload=on parameter of the setup script install_web_develop.sh is off.

Run the script to install it (approximately 30-50 minutes):

sh install_web_develop. SH #运行脚本

Installation succeeded:

After the installation is successful, install the framework's development environment (using root installation):

CD tools/script/linux/installsh install_environment. SH--full

Development environment Success:

To create a user database (for gateway servers):

# go to the script directory # go to MySQL command line MySQL DEFAULT CHARSET UTF8; Create a database MySQL> source sword_user.sql; Execute script

To configure a data source:

# Editing a configuration file

The final configuration is as follows, but it can be changed:

[Sword_user]Driver=/usr/local/lib/mysqlodbc/libmyodbc5a.sodatabase=sword_userdescription= MySQL ODBC 5.3Ansi Driver testserver=Localhostuid=Rootpassword=SOCKET=[Sword_character]Driver=/usr/local/lib/mysqlodbc/libmyodbc5a.sodatabase=sword_characterdescription= MySQL ODBC 5.3Ansi Driver testserver=Localhostuid=Rootpassword=SOCKET=
Compiling the framework

The framework uses tools such as CMake to compile, and if you use a script that I provide, the compilation environment can be configured without its own configuration.

1. Compilation dependency

CD ~/work/plainframework1/pf/dependencies/lua/ #luacmake. /make ~/work/plainframework1/pf/dependencies/iconv/ #iconvcmake. / make

2. Compile Frame Core

CD ~/work/plainframework1/pf/core/cmake. / make
Compiling the complete example

A gateway server is provided in the complete example, which uses the core interfaces of the network, database, and so on.

CD ~/work/plainframework1/applications/gateway/cmake. / make
Run the sample

1. Copy Run Library

CD ~/work/plainframework1/applications/bin/CP ~/work/plainframework1/pf/dependencies/dll/lib*.so./  CP ~/work/plainframework1/pf/core/dll/libpf_core.so./

2. Configuration files

CD ~/work/plainframework1/applications/bin/vim config/gateway_info.ini
[System]Dbip=Localhostdbport=3306Dbconnectionordbname=sword_user;connection or database nameDbuser=Rootdbpassword=Mysqldbconnectortype=0;Connection Type 0 ODBC, 1 MySQL, 2 SQL Server, 3 MongoDB (now ODBC only)Encryptdbpassword=0;whether the database password is encryptednetlistenip=127.0.0.1;Network listening IPnetlistenport=12680;Network Listening Portnetconnectionmax=10240;maximum number of supported network Connections

3. Operation

CD ~/work/plainframework1/applications/bin/. /gateway
RESULT:

WINDOWS INSTALL

It is relatively easy to install the development environment on Windows because it is not installed using source code compilation. I'm using Wamp as a web development environment, and ODBC is using the system's own ODBC32 bit, and if your machine is not 64 bits, it doesn't matter. If you want to compile the framework and the app to 64 bits then use 64-bit ODBC, as for the reason I don't explain.

SOURCE download

If you are using GitHub as a friend, you can use GitHub's client to open the source connection:

PHP environment variable Settings

It is important to set the path of the PHP execution file to your environment variables in order to run some of the scripts in the framework.

Compiling the framework

Because a duplicate file name is not linked correctly to the target in the VS compile time, there are many duplicate filenames in the framework, so the tools compiled for Windows are used here.

Path: Tools\script\bat\rename_forvsbuild.bat

Double-click Open, and then enter the following options:

Carriage return wait for the tool to finish executing:

Enter Pf\core\scripts Open Project Pf_core.vc9.sln to compile (currently only supports release compilation), of course you can convert this project to other versions of VS.

Compiling examples

As with the compilation framework, the compilation of the example also requires rewriting the project file.

Open Tools\script\bat\rename_forvsbuild.bat

Whether the revert to standard is reverted to normal, no input, direct carriage return, the project will be automatically restored the second time the operation is performed.

Open the project file Applications\gateway\scripts\gateway.vc9.sln to compile.

Installing the ODBC driver for MySQL

Address: http://dev.mysql.com/downloads/connector/odbc/version 3.5 or more can be

Create a database

Create a database named Sword_user, set the encoding to ODBC, and execute script tools\script\sql\sword_user.sql under the database.

Configure ODBC

Since I am using a 32-bit application, I use 32-bit ODBC,

Add your MySQL connection information as follows, with the connection named Sword_user:

Run the sample

Copy dependencies and framework dynamic libraries into the Applications\bin directory.

Dependent Dynamic Library: pf\dependencies\dll\release

Framework Dynamic Library: Pf\core\dll\release

Ensure MySQL and database are successfully run under the premise of Gateway.exe

RESULT

Member recruitment (long-term validity)

If you are also interested in open source knowledge, if you are interested in Web applications or online games, if you are interested in the framework, you can join our QQ group (348477824).

Welcome to the group to exchange learning with each other, but also welcome all friends to the framework for their own efforts.

Plain Framework 11 is mainly used for the development of Network (game) C + + Framework installation Chapter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.