'FILE fp is private within this context'

This is a discussion on 'FILE fp is private within this context' within the C++ Programming forums, part of the General Programming Boards category; Depends on what you're doing. If you're in an IDE (Dev-cpp, codeblocks, VS) putting everything into one single project will ...

  1. #16
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Depends on what you're doing. If you're in an IDE (Dev-cpp, codeblocks, VS) putting everything into one single project will do the right thing automagically.

  2. #17
    Registered User
    Join Date
    Oct 2007
    Posts
    118
    all i've dealt with so far is writing code and compiling it, on dev-c++ and then importing it to linux to compile again, don't know how to make a project.

  3. #18
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    You fix it by properly compiling:

    Quote Originally Posted by anon View Post
    Or in other words, since you say you are getting linker errors it means that you must be compiling only main.cpp and not any of the other files.

    So again, have you created a project with Dev-C++ and added all the cpp files to it? You can compile single-file programs without a project but you need one if you have more files.
    Edit: If you're compiling on the command line, you need to specify all the .cpp files.

  4. #19
    Registered User
    Join Date
    Oct 2007
    Posts
    118
    ya, its working ok now. last time i did this is didnt make a project but it looks like i have to now.

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

Similar Threads

  1. disposing error
    By dropper166 in forum C# Programming
    Replies: 2
    Last Post: 03-31-2009, 12:53 AM
  2. Need Help Fixing My C Program. Deals with File I/O
    By Matus in forum C Programming
    Replies: 7
    Last Post: 04-29-2008, 08:51 PM
  3. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  4. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 01:13 AM
  5. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 04:39 AM

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