Thread: Dev-c++ + own .h files = unable to compile

  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    4

    Dev-c++ + own .h files = unable to compile

    Hi, iam running Dev-c++ on windows.. Everytime i make my own "file.h" and

    #include "file.h"

    the compiler complains about that line while i compile..

    do i need a lib or something?

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    What complaint does it make?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    May 2008
    Posts
    4
    "In file included from items_b0-001/main.c"
    this one means???


    Also two more errors.

    "two or more data types in declaration of 'itemGet'"

    i acctually dont get what this one is meaning. its declared:

    extern int itemGet(struct oItems *itemLib, int index) //in the h file..

    last error..
    []build error[] [items_b0-001/main.o] Error 1

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    "In file included from items_b0-001/main.c"
    this one means???
    That's just introducing the error to you, i.e., telling you where the error was detected.

    "two or more data types in declaration of 'itemGet'"

    i acctually dont get what this one is meaning. its declared:

    extern int itemGet(struct oItems *itemLib, int index) //in the h file..
    I am not sure what is the actual error. You may want to post more code.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by wixz64 View Post
    "In file included from items_b0-001/main.c"
    this one means???
    Exactly what it says: In the file included from (or by) ... main.c, something went wrong.
    [quote
    Also two more errors.

    "two or more data types in declaration of 'itemGet'"

    i acctually dont get what this one is meaning. its declared:

    extern int itemGet(struct oItems *itemLib, int index) //in the h file..

    last error..
    []build error[] [items_b0-001/main.o] Error 1[/QUOTE]

    Not sure what the exact problem is here - you may need to post a small example that shows this problem.

    But it's fairly clear that the problem is _IN_ your header file, not that it can't find your header file - so the problem is not with gcc or Dev-CPP as such, but with what you've got in your header files (or possibly what you HAVEN'T got).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    Registered User
    Join Date
    May 2008
    Posts
    4
    Thanks, problem solved .. missing ";" was the problem..

    hehe typical..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compile multiple files
    By hello in forum C Programming
    Replies: 2
    Last Post: 01-11-2009, 03:11 AM
  2. dev cant compile dos??
    By Yarin in forum C++ Programming
    Replies: 5
    Last Post: 10-29-2007, 11:09 AM
  3. Dev C++ Won't Compile
    By mburt in forum Windows Programming
    Replies: 8
    Last Post: 08-21-2006, 11:14 PM
  4. dev & allegro compile errors
    By Calgore in forum C++ Programming
    Replies: 10
    Last Post: 08-11-2004, 04:41 PM
  5. opengl .h files
    By Unregistered in forum Game Programming
    Replies: 3
    Last Post: 10-18-2001, 08:32 PM