Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

VS2005 build software project

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Preface

A project project is a solution that has a unique sln file. A solution can have multiple projects. In the project currently in charge, there are 25 projects, which can be said to be 25 modules. The project in the project can be a static library, a dynamic library, or an executable program. In this article, unlike other small projects, we do not copy the source code of some libraries and add them directly to the project, but as a project, add it to the project, and complete the single-step debugging of the project by setting the project's dependencies (select properties, CramCrunch + optimization disables optimization). The solution is configured as Release, and the advantage is that it invokes a third-party dll version of Release and runs seamlessly. (this article does not discuss explicit dynamic loading of dll)

Description

The project includes test (executable program), agg (static library) and iconv (dynamic library).

Create the project directory as follows

Project directory Games\

-release\ (the directory in which the version is released)

-include\ (each project copies the header file to this directory with its own project name as the directory name)

-agg\ header file

-zlib\ header file

-lib\ (each project copies the lib to this directory with its own project name as the file name)

-agg.lib

-zlib.lib

-src\ (the source code of each project is placed in this directory)

-agg\

-zlib\

-test\

Operation steps

1 Construction of agg static library

Create a new Win32 project, name agg, and select the application type: static library. Copy the file of the agg library to the agg project, copy the include header file in agg to the include\ agg\ directory, and add the source file to the project.

Configuration properties:

Administrator output file.\..\ lib\ agg.lib

2 Construction of zlib dynamic library

Create a new Win32 project named zlib and select the application type: dll. Classes or functions provided for external use need to be modified with the keyword: _ _ declspec (dllexport), indicating that they will be exported.

Attribute configuration:

Linker: regular output file.\..\ release\ zlib.dll

Linker: advanced Import Library.\..\ lib\ zlib.lib

Copy.\ zlib.h.\..\ include\ zlib after the generation of the event

3. Build test executable program

Create a new Win32 console application named test, and then select the location, the established Games\ src, create a test project, and do not select the directory to create the solution (this option will create an additional directory for the project to store the source code, unchecked, put the source code and sln solution files in the same directory, and the rest of the projects will be set up the same way). Open the dependencies of the project, select agg,zlib, and then you can debug

Attribute configuration:

C _ include

Linker attach dependency zlib.lib agg.lib

Linker general..\ release\ game.exe

Large-scale projects will be set up as follows:

1) each C++ project has its own namespace, except for the added C library

2) File name lowercase, declaration prefix, std, etc.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report