头文件在dev-C ++中 [英] Header files in dev-C++
问题描述
我试图向dev-C ++添加一个头文件,但是当我编译它时,它不起作用。
这里是我的确切步骤(对于我的例子,我试图让mysql.h工作):
- copy mysql.h放入c:\ dev-c ++ \ include
- 检查在dev-C ++工具>编译器选项>目录> c includes和c ++ include包含 c:\dev-c ++ \includes
- 在我的文件顶部包含#include
- 已编译 $ b $这是dev-C ++编译器告诉我的:
13 C:\ Documents and Settings \Steve\Desktop\server code\setup1\main.c`mysql'未声明(首次在此函数中使用)
以及由于未找到头文件而导致的其他错误
概述正确吗?或者还有什么我需要做的,以获得头文件编译。
我尝试了VS2008(在vs2008 include文件夹等中放入mysql.h)
,但仍然有相同的错误。如果可能的话,我想坚持使用Dev-c ++。
Dev-C ++是GCC的一个端口,所以试试这个页面: http://gcc.gnu.org/onlinedocs/cpp /Search-Path.html 。
请注意,您可能不得不使用Makefile。
I'm trying to add an header file to dev-C++ but when I compile it it doesn't work. Here are my exact steps (for my example, I'm trying to get mysql.h to work):
- copy "mysql.h" into c:\dev-c++\includes
- check that in dev-C++ tools > compiler options > directories > c includes and c++ includes have the path to "c:\dev-c++\includes"
- include #include at the top of my file
- compiled
This is what the dev-C++ compiler told me:
13 C:\Documents and Settings\Steve\Desktop\server code\setup1\main.c `mysql' undeclared (first use in this function)
As well as other errors due to not locating the header file
Are the steps I've outlined correct? Or is there something else I need to do to get the header files to compile.
P.S. I tried doing the same with VS2008 (put mysql.h in the vs2008 include folder, etc) but still have the same error. I would like to stick with Dev-c++ if possible.
Dev-C++ is a port of GCC, so try this page: http://gcc.gnu.org/onlinedocs/cpp/Search-Path.html.
Note that you probably have to tinkle with the Makefile.
这篇关于头文件在dev-C ++中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!