Thread: Vector header in C/C++

  1. #1
    Registered User
    Join Date
    Jan 2011
    Location
    Northern Ireland
    Posts
    2

    Question Vector header in C/C++

    I'm using the Code::Blocks compiler if that's important.

    I'm trying to include vectors, since it is required as part of the practical work for my University module, otherwise I'd just find a simpler way to do this.

    However, when I try to use:

    #include <vector>

    I receive an error message:

    C++\Project_001\main.c|1|error: vector: No such file or directory|

    Now I went though the files and I can find a vector file inside the includes folder, but it is not a header file.

    Anyone got any ideas?

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by PoeRaven View Post
    I'm using the Code::Blocks compiler if that's important.
    C++\Project_001\main.c|1|error: vector: No such file or directory
    Use a file with an C++ extension like ".cpp" instead of ".c"

    Note: vector is NOT a valid C header!

  3. #3
    Registered User
    Join Date
    Jan 2011
    Location
    Northern Ireland
    Posts
    2
    Use a file with an C++ extension like ".cpp" instead of ".c"
    Thanks, that seems to have helped that problem, now to fix the new errors.

Popular pages Recent additions subscribe to a feed

Tags for this Thread