如何在编译DLL时添加includes
How to add includes when compiling DLL
我是C/C++中的beginer,我遇到了无法编译DLL(64位)的问题。我有标题和源代码(一个是主代码,另一个被调用),当我试图编译时,我坚持认为我需要包括c:\Program Files(x86)\Microsoft Visual Studio 10.0\VC\include\stdint.h中的stdint.h,而这个标题包括other和other。。。并且我不能以这种方式设置编译。
当我尝试使用gcc:时
gcc -c mdi_helper.c
In file included from mdi_helper.h:5:0,
from mdi_helper.c:18:
stdint.h:6:19: fatal error: yvals.h: No such file or directory
compilation terminated.
并在VS2010中尝试编译得到了相同的结果。
有人能帮我吗?从来没有做过这样的事。
您需要为包含所需头文件的每个目录提供包含路径。
对于gcc,请使用-I
命令行参数。
对于VS,请使用/I
命令行参数。
尝试VS2010:
cl mdi_helper.c /I"C:Program Files(x86)Microsoft Visual Studio 10.0VCinclude"
此外,对于VS2010,您可以在IDE的PROJECT->Properties->Configuration Properties->C/C++->General下,在Additional Include Directories中进行设置。
请参阅本文中的类似问题,如何在GCC搜索路径中包含头文件?
相关文章:
- 将成员变量添加到共享库中的类中,不会破坏二进制兼容性吗
- 如何在C++中从两个单独的for循环中添加两个数组
- POCO::PostgreSQL:如何将std::vector支持添加到`Binder::bind`
- 如何仅为一个函数添加延迟
- 如何防止 c++ 在从浮点型转换为双精度型(不适用于 IO)时添加额外的小数?
- 使用std::transform将一个范围的元素添加到另一个范围中
- 如何将更多文件夹添加到c++include路径
- 如何将元素添加到数组的线程安全函数?
- QT通过C++添加映射QML项目
- 如何将点击的信号和插槽添加到qt中的自定义按钮中
- 如何使用重载的相等(==)运算符向测试用例添加描述
- 为什么Mat类的两个对象可以在不重载运算符+的情况下添加
- 如何防止clang格式在流运算符调用之间添加换行符<<
- 只能向C++添加一定数量的字符
- Qt和C++:将QLineEdit添加到QTabWidget中
- 将QIcon添加到QTableView单元格
- 为什么我必须在C++中添加一个赋值符号来声明一个数组
- 为什么除非添加括号,否则构造函数上的模板替换会失败?
- 将图像添加到资源文件夹UWP C++
- 如何在编译DLL时添加includes