Vector header in C/C++

This is a discussion on Vector header in C/C++ within the C Programming forums, part of the General Programming Boards category; I'm using the Code::Blocks compiler if that's important. I'm trying to include vectors, since it is required as part of ...

  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
    2,747
    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


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