[SDL] Visual Studio 6, C++, SDL

Mike Arnold mike at midkaemia.fsnet.co.uk
Sat Aug 25 13:16:01 PDT 2001


Brad LaFountain wrote:

Brad (or indeed anyone who happens to be listening!),

I have exactly the same problem on Linux. If I compile a standard SDL app 
using KDevelop and a "C program" everything works fine. When I move to a 
C++ program I get the same errors as you did (although they display 
different text!).

Could you just clarify exactly which solution fixed it and I will try and 
replicate this on Linux.

To clarify the position,

I have tried 

<iostream.h> and cout <<
<iostream> and using namespace std;
<iostream> and std::cout

None of them have fixed it. If I remove the -lSDL and comment out the SDL 
references everything compiles fine - but that sort of defeats the object!

Thanks in advance for any help, but I have just resigned myself to another 
head banging night for a VERY simple port from C to C++...

Mike

> At 09:29 PM 7/30/2001 +0200, you wrote:
>> > I am trying to compile a sdl program at the same time im trying to use
>> > Visual C's standard c++ libary.
>> >
>> > #include "SDL.h"
>> > #include <iostream.h>
>> >
>> > int main(int argc,char **argv)
>> > {
>> > cout << "hello";
>> > return 0;
>> > }
>> >
>>
>>And you need to use namespace
>>
>>  #include "SDL.h"
>>  #include <iostream>
>>
>>using namespace std;
>>
>>  int main(int argc,char **argv) {
>>    cout << "hello";
>>    return 0;
>>  }
>>
>>// or
>>
>>  #include "SDL.h"
>>  #include <iostream>
>>
>>  int main(int argc,char **argv) {
>>    std::cout << "hello";
>>    return 0;
>>  }
>>
> 
> Just to clearify i do understand the difference between
> <iostream>
> and
> <iostream.h>
> 
> and also I do understand what namespaces are.
> 
> I did have the wrong type of runtime libary.
> I changed this and it worked fine.
> 
> thanks
> 
>>_______________________________________________
>>SDL mailing list
>>SDL at libsdl.org
>>http://www.libsdl.org/mailman/listinfo/sdl
> 
> 
> 




More information about the SDL mailing list