Simple question on creating fucntions

This is a discussion on Simple question on creating fucntions within the C Programming forums, part of the General Programming Boards category; what do you guys use? another ide? maybe I could try it in a fashion that you guys are using ...

  1. #16
    Registered User
    Join Date
    Feb 2009
    Posts
    24
    what do you guys use? another ide? maybe I could try it in a fashion that you guys are using to see if it'll work that way.

  2. #17
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    I use GCC on the command line, Elysia uses Microsoft Visual Studio, another popular IDE is Code::Blocks.

  3. #18
    Registered User
    Join Date
    Feb 2009
    Posts
    24
    I used code blocks and the same exact error came up. It's obviously the same problem in both situations. Here's is what I did. I loaded my example.c, avg.c, avgfunc.c and then hit build and run option. It gave me the 'undefined reference to readValue()

  4. #19
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    You need to add them to a project, otherwise the compiler doesn't know where to find readValue() when it's trying to compile example.c, which is what it's trying to tell you.

    The errors are the same because both Dev-C++ and Code::Blocks use GCC (by default).

  5. #20
    Registered User
    Join Date
    Nov 2008
    Location
    Greece,Athens
    Posts
    17
    i am using Dev-C++.i never had done something like the thing you mention but if adding files in a project is what you want to do you could try this : locate project's little icon on the left (not the one under File but the project tree next to the source) and right click on it,then select "Add to Project".a browser comes up and you select the files you want.please keep a copy of what you have done first, since i am not rly sure if it works.

  6. #21
    Registered User
    Join Date
    Feb 2009
    Posts
    24
    I'm not seeing the add to project file button you are talking about.

    Actually I do see it. It's right below the window menu on mine. The problem is that it is not highlighted. I can't click on it. Not even in any of the menus. Any ideas?

  7. #22
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    Maybe you are in "single file mode"?

    You need to make it a project (create a new project and put your code into it).

  8. #23
    Registered User
    Join Date
    Feb 2009
    Posts
    24
    I made a new project and I was able to add files to the project then. this was it. Thanks for all the help everyone!!

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Simple class question
    By 99atlantic in forum C++ Programming
    Replies: 6
    Last Post: 04-21-2005, 12:41 AM
  2. Simple question about pausing program
    By Noid in forum C Programming
    Replies: 14
    Last Post: 04-02-2005, 09:46 AM
  3. simple question.
    By InvariantLoop in forum Windows Programming
    Replies: 4
    Last Post: 01-31-2005, 12:15 PM
  4. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 04:00 PM
  5. Simple Question from Stupid Person...
    By Monmouth3 in forum A Brief History of Cprogramming.com
    Replies: 6
    Last Post: 10-02-2002, 09:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21