Author Topic: Can't #include iostream, vector, string, etc  (Read 6262 times)

Offline Redfox814

  • Single posting newcomer
  • *
  • Posts: 3
Can't #include iostream, vector, string, etc
« on: May 25, 2012, 01:27:44 am »
Like the title says.
I can't include stl files

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5930
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Can't #include iostream, vector, string, etc
« Reply #1 on: May 25, 2012, 02:01:20 am »
Like the title says.
I can't include stl files
I can't help you because I can't understand your problem, sorry. You need to give us detailed information.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Redfox814

  • Single posting newcomer
  • *
  • Posts: 3
Re: Can't #include iostream, vector, string, etc
« Reply #2 on: May 25, 2012, 02:06:45 am »
Say this is my scribt


#include <iostream>

int main(){
std::cout<<"it doesn't work"<<std::endl;
}


It'll generate an error that says:
error: iostream: no such file or directory
« Last Edit: May 25, 2012, 04:45:23 am by Redfox814 »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7608
    • My Best Post
Re: Can't #include iostream, vector, string, etc
« Reply #3 on: May 25, 2012, 03:18:21 am »
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Quote
Remember the file extension matters: *.c is compiled as C file, *.cpp is compiled as C++ file.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Redfox814

  • Single posting newcomer
  • *
  • Posts: 3
Re: Can't #include iostream, vector, string, etc
« Reply #4 on: May 25, 2012, 04:46:22 am »
Thanks! Your awesome  :)