相对路径的问题
在Visual C++ 7.0中,设置相对路径的时候,需要注意的地方在于,如果相对路径设置的位置在Cpp或者头文件中,那么它对应的当前路径是这个文件的路径。比如:工程文件Test.vcproj在b:Test中,而源文件是在b:TestScr中,那么源文件的相对路径的起始路径就是b:TestScr,不是b:Test。
在这里说的,是一种特殊情况下发现的。是某个类库,通过头文件来确定选择使用什么类库,相对路径是在编译期使用的,才是这个样子。否则,如果在运行时使用相对路径,那么应该就是当按F5调试的时候,以工程文件所在目录作为起始目录,在实际运行时候,以运行的可执行文件所在目录作为起始目录。如果编译出来的是一个动态链接库,我还不知道。
In Visual C++ 7.0, when you want to set a relative path, you should notice that if the relative path is setted in the source file or the header file, the start path is the folder which the source file or the header file located in. For example, the project file Test.vcproj is in the folder of b:Test, and the source files are all in b:TestSrc, then relative path is start from b:TestScr, not b:Test. If you want to visit the project file in the source file, you should write ..Test.vcproj, not .Test.vcproj.
But this is not a common regular, this is under a speical situation: a Class Library, which decide use Unicode Edition or ANSI Edition by header files. The relative path is used Compile-Time, not Run-Time. If the relative path is used Run-Time, if you press F5 to debug the project in Visual C++, the start folder is the folder where the project file is located in, if you run it as a executable file, the start folder is the folder where the executable file located in. But if it is a dll file, I don’t know.
标签集合/Tag clouds
C++
Symbain
轻松汇编
算法
论文学习
资治通鉴
Delphi
编程之美
Poco
MFC
Linux
IFC
知乎
汇编
数据分析
交叉编译
poco
j2me
android
XML
Java
DTD
飞信
零宽断言
诺基亚
联系人
编程
真值表
池西木
正则表达式
多线程
命令行
优化
stream
configure
cmake
VIM
UiAutomator
TDD
Symbian
Sqlite
SourceInsight
Python
MPAndroidChart
Kotlin
Flutter
Dokka
Chatgpt