Thread: Check if is declared

  1. #1
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318

    Check if is declared

    Is there a function to check if a function or variable is declared?

  2. #2
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    not really... what's your situation?
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  3. #3
    Registered User
    Join Date
    Sep 2004
    Posts
    719
    Quote Originally Posted by major_small
    not really... what's your situation?

    i have a strange feeling it's a circular include
    i seem to have GCC 3.3.4
    But how do i start it?
    I dont have a menu for it or anything.

  4. #4
    Banned
    Join Date
    Jun 2005
    Posts
    594
    Quote Originally Posted by misplaced
    i have a strange feeling it's a circular include

    what is a circular include, ive never heard of it before?

  5. #5
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    oversimplified:

    file1:
    Code:
    #include "file1"
    file2:
    Code:
    #include "file2"
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    > Is there a function to check if a function or variable is declared?
    Yeah, it's called a compiler.
    If it isn't declared, it prints a message.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  7. #7
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Quote Originally Posted by Salem
    > Is there a function to check if a function or variable is declared?
    Yeah, it's called a compiler.
    If it isn't declared, it prints a message.
    you took the easy answer
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  8. #8
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by major_small
    oversimplified:

    file1:
    Code:
    #include "file1"
    file2:
    Code:
    #include "file2"
    What you gave is two examples of self-inclusion. I assume what you meant was;

    file1:
    Code:
    #include "file2"
    file2:
    Code:
    #include "file1"

  9. #9
    Deprecated Dae's Avatar
    Join Date
    Oct 2004
    Location
    Canada
    Posts
    1,034
    I'll take a wild guess at his situation.

    To make sure its not included more than once when compiling, add this at beginning of .h file: #ifndef FILENAMEHERE_H_, and #define FILENAMEHERE_H_, and then #endif at the end of the .h file.
    Warning: Have doubt in anything I post.

    GCC 4.5, Boost 1.40, Code::Blocks 8.02, Ubuntu 9.10 010001000110000101100101

  10. #10
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Quote Originally Posted by grumpy
    What you gave is two examples of self-inclusion. I assume what you meant was;

    file1:
    Code:
    #include "file2"
    file2:
    Code:
    #include "file1"
    yeah, that's what I meant... sorry about any confusion I caused
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  11. #11
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    It might be a double-include.

    file1:
    Code:
    #include "file3"
    file2:
    Code:
    #include "file3"
    file4:
    Code:
    #include "file1"
    #include "file2"

  12. #12
    Registered User
    Join Date
    Nov 2002
    Posts
    491
    To answer your question. C++ requires a build environment of some sort in order to build an application. This is included in part of the Critique of C++ (http://ortdotlove.net/docs/ACritiqueOfC++.pdf). This is why we have things like autotools who's job is to determine if functions exist and if they confrom to a particular implementation. I'd suggest starting by learning Scons. It is an easy to use and learn build environment. And then if you care you can learn autotools which is quite painful and most likely going to give you braindamage. Both work under *NIX and Win32 (win32 requires something like cygwin).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BN_CLICKED, change button style
    By bennyandthejets in forum Windows Programming
    Replies: 13
    Last Post: 07-05-2010, 11:42 PM
  2. How can i check a directory for certain files?
    By patrioticpar883 in forum C++ Programming
    Replies: 13
    Last Post: 02-01-2008, 05:27 PM
  3. how to check input is decimal or not?
    By kalamram in forum C Programming
    Replies: 3
    Last Post: 08-31-2007, 07:07 PM
  4. Please check this loop
    By Daesom in forum C++ Programming
    Replies: 13
    Last Post: 11-02-2006, 01:52 AM
  5. how to check for end of line in a text file
    By anooj123 in forum C++ Programming
    Replies: 6
    Last Post: 10-24-2002, 11:21 PM