Thread: include: file not found

  1. #1
    Registered User
    Join Date
    Jul 2020
    Posts
    1

    include: file not found

    Greetings: I'm new to C programming. I was experimenting with an example I found on line. It began #include <fstream>. When I tried to compile it I got the error message fstream file not found. I searched for the file and I found it in folder C:\Program Files (x86)\CodeBlocks\MinGW\lib\gcc\mingw32\5.1.0\inclu de\c++.

    I added this folder to path thinking that would fix it. However, that didn't work.

    Please advise.

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    4,553
    I'm new to C programming.
    It began #include <fstream>.
    Do you know that <fstream> is a C++ header that is not available in a C program?

  3. #3
    null pointer Structure's Avatar
    Join Date
    May 2019
    Posts
    303
    Please advise.

    compile with g++ instead of gcc

    "without goto we would be wtf'd"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. end of file found before }
    By rockodan34 in forum C Programming
    Replies: 9
    Last Post: 10-22-2012, 12:27 AM
  2. Does #include indirectly include the source file too?
    By Lord Asriel in forum C Programming
    Replies: 10
    Last Post: 11-30-2011, 08:20 AM
  3. File not found exception
    By Alexandre in forum C# Programming
    Replies: 4
    Last Post: 10-03-2011, 06:02 PM
  4. Need Help: end of file found before....
    By kamitsuna in forum C++ Programming
    Replies: 5
    Last Post: 02-24-2010, 02:23 PM
  5. unexpected end of file found
    By eam in forum C++ Programming
    Replies: 5
    Last Post: 11-06-2003, 06:10 PM

Tags for this Thread