default links and libraries

I Think i may have fucked up my default codeblocks links to the standard c++ libraries when following lazyfoo's tutorial. How do i get them back? Same way i linked all the SDL files? If so where do i find the standard c++ files?
What tutorial are you talking about and what compiler are you using?
Also, what is your problem? Does some feature within C::B no longer work, or do your programs not compile correctly anymore?
http://lazyfoo.net/SDL_tutorials/lesson01/windows/codeblocks/index.php

It taught me how to link SDL library into codeblocks and now when i got to the second part of the tutorial i realised that c::B is not recognising #include <string> . and yes any other programs i wrote before i did the linking changing dont recognise cout and other basic standard library code
Um, so what exactly doesn't work anymore? Can you give an example?
anything that uses basic c++ syntax, for example the pure SDL program compiles with no errors. but when i use #include <string> it sais no such file/directory found
So, if you remove the include and lib paths everything works as normal again?
nope.
1
2
3
4
5
6
7
8
#include<iostream>
#include<string>

int main()
{
	cout<<"Hello, World!\n";
	return 0;
}


this was written and compiled before i messed with sdl and now it doesnt compile. The only error i get is cout was not declared in this scope.

I can still code because if i ask C::B to starta new console project it automatically configures things on its own though.


EDIT: errr thats a namespace error scratch that... hmm im more confused now
Last edited on
So, does adding using namespace std; solve the problem? I just looked through the tutorial and it's pretty well the same as setting up SFML (adding the libraries and such) and I haven't had any problems.

Edit:
Why do you have #include <string> , you don't even use it.
Last edited on
yes . its a very good tutorial but basically my problem is that on the second part.
http://lazyfoo.net/SDL_tutorials/lesson02/index.php <-- I the code requires me to add the string. and it seems that i just cant do that for some reason... just try including string in the basic SDL app.
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "SDL/SDL.h"
#include <string>

int main( int argc, char* args[] )
{
    //Start SDL
    SDL_Init( SDL_INIT_EVERYTHING );

    //Quit SDL
    SDL_Quit();

    return 0;
}


this wont compile, but as soon as i remove #include <string> its fine.
1. I'm not sure how you can 'break' the STL, try reset the compiler settings to default, and/or compile a basic hello_world.cpp from command line (mingw-gcc/g++ must be on your path)

2. In the tutorial it was mentioned std::string was used as alternative to (old-style) char* -for getting a file name for one of its functions
I did try reseting the compiler settings, no help... cannot compile anything(other than SDL stuff) on that file which was used. but again if i make a new console project everything is fine..

I will try the same thing on visual 2010 and report back. but i dunno this makes me sad because it just puts a stupid halt on me trying to learn
okay I went on visual studio 2010 and it's working on there... which sucks cause i kinda like C::B more... ah well
hi again, vlad, I've tried running the tutorial @LazyFoo, and no, my STL wasn't broken i.e I can use std::string and include <string> ;)

I suggest you review the steps described here: http://lazyfoo.net/SDL_tutorials/lesson01/windows/codeblocks/index.php again, and see if you'd miss something

p/s this is using C::B 10.05 with MingW 4.5.0 and SDL 1.2.14
Last edited on
hmm yeah i dunno.. ill try doing it from another computer.. but im thinking how could i compile the first two tutorials and not the next one>? But ill deffinetly try it again on another computer. THanks for getting back to me.
Topic archived. No new replies allowed.