头文件在dev-C ++中 [英] Header files in dev-C++

查看:690
本文介绍了头文件在dev-C ++中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图向dev-C ++添加一个头文件,但是当我编译它时,它不起作用。
这里是我的确切步骤(对于我的例子,我试图让mysql.h工作):


  1. copy mysql.h放入c:\ dev-c ++ \ include

  2. 检查在dev-C ++工具>编译器选项>目录> c includes和c ++ include包含 c:\dev-c ++ \includes

  3. 在我的文件顶部包含#include

  4. 已编译
  5. $ 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):

  1. copy "mysql.h" into c:\dev-c++\includes
  2. check that in dev-C++ tools > compiler options > directories > c includes and c++ includes have the path to "c:\dev-c++\includes"
  3. include #include at the top of my file
  4. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆