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 Software Project Directory Settings

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Scene description

Multiple projects are integrated in the project, the header file needs to be set for compilation, the lib needs to be specified for links, and the operation depends on dll. Whether it is dll, lib or exe, you must specify the output directory for debugging and configuration.

Application description

The project does not allow the use of absolute paths for various directory output settings, otherwise, when downloading the source code, the output path must be reset, so the relative path is used. But how do you know the current path of the project? And when you create a project, there will be a check box in the lower right corner of the project name: how to create a directory for the solution?

The current directory at compile time of the project is where the source code is located, and the solution directory is created just to isolate the solution .sln file from the source file and create an additional directory to hold the project source code. So when setting the relative path of the output directory, you can use relative paths such as..\ test.lib.

Export the test.lib file.

As the main entry exe output file of the project, you only need to specify the relative path of the output and the name of the exe in the linker of the project, and perform debugging.

Will go to the output directory to find the program to load and run.

Exception: if you are copying the exe output file manually, if you need to debug, you need to make the following settings:

There are: project-"Properties -" debugging-"working directory" in VS

The working directory refers to the directory of the EXE files executed by F5/CTRL+f5 in vs

In general, our F5 debugging starts the $(targetFileName) EXE file in the generated DEBUG directory, if

The generated exe is not placed under debug, but copied to the.. / bin directory, so what if you want to debug the program in the compiler?

Make the following settings:

Copy the resources you need to run exe to.. / bin directory.

Project configuration properties = > debugging = > working directory:.. / bin

Destination configuration attribute = > debug = > command:..\ bin\ $(TargetFileName)

If there are command parameters, take the parameters and set the command parameters

Note: VS2010 sets the directory for debugging to be different from VS2005

How to include header files, specify dependent library directories, and specify LIB files:

VC6:

Project, setting, Crample +, Category: Preprocessor, additional include path: fill in the directory where the additional header file is located, comma interval multiple items

Project, setup, Link, Category: Input, additional Library path: fill in the semicolon interval of the directory where the additional dependent library is located

Project, setup, Link, category: Input, object / library module: fill in the name of the additional dependent library .lib space interval multiple items

VS20xx:

Items, attributes, Crample +, additional include directory: fill in the semicolon interval of the directory where the additional header file is located.

Project, attribute, linker, general, additional library directory: fill in the semicolon interval of the directory where the additional dependent library is located

Project, property, linker, input, additional dependency: fill in the name of the additional dependent library .lib space or semicolon interval

How to output header files, LIB files, DLL files

No matter static library or dynamic library, after generating event | after generating event, copy the header file to the directory required by the entry function via copy..\ test.h.\..\ include (note the direction of the slash)

Linker | Advanced | specify the LIB file output path and file name in the import library

Linker | General | specify the DLL file output path and file name in the output file

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