Jump to content
• Advertisement

# Some Funky Stuff with SDL!

This topic is 4292 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

Hello, I have two problems, both with SDL and my IDE. Please look below for questions. 1. I just installed SDL with my IDE ( Visual C++ Express Edition ), and I try to compile my little app, but I keep getting this funky warning. The app works fine, all I do with it is load a .bmp image to the screen for 5 seconds and it does exactly that. The only thing i dont like is these warning. They get pretty annoying, especially when im looking for errors. So Please, help me figure out how to get rid of this stuff! Heres the warnings:
1>c:\program files\microsoft visual studio 8\vc\include\xlocnum(590) : warning C4312: 'type cast' : conversion from 'uintptr_t' to 'void *' of greater size

1>        c:\program files\microsoft visual studio 8\vc\include\xlocnum(566) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,void *&) const'

1>        with
1>        [
1>            _Elem=char,
1>            _Traits=std::char_traits<char>,
1>            _InIt=std::istreambuf_iterator<char,std::char_traits<char>>
1>        ]
1>        c:\program files\microsoft visual studio 8\vc\include\xlocnum(1365) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
1>        with
1>        [
1>            _Elem=char,
1>            _InIt=std::istreambuf_iterator<char,std::char_traits<char>>
1>        ]
1>c:\program files\microsoft visual studio 8\vc\include\xlocnum(590) : warning C4312: 'type cast' : conversion from 'uintptr_t' to 'void *' of greater size
1>        c:\program files\microsoft visual studio 8\vc\include\xlocnum(566) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std::ios_base &,std::ios_base::iostate &,void *&) const'
1>        with
1>        [
1>            _Elem=wchar_t,
1>            _Traits=std::char_traits<wchar_t>,
1>            _InIt=std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>
1>        ]
1>        c:\program files\microsoft visual studio 8\vc\include\xlocnum(1371) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
1>        with
1>        [
1>            _Elem=wchar_t,
1>            _InIt=std::istreambuf_iterator<wchar_t,std::char_traits<wchar_t>>
1>        ]


2. Does anyone know anyway to make it so I dont have to type "SDL.lib SDLmain.lib" in the Project->Project Name Properties->Linker->Input - Additional Dependincies text field for every single time I want to create an SDL application? because I always have to go to a website that has what I need to type everytime I want to create an SDL app and it gets tedious. Thanks for any help! Its greatly Appreciated! [smile]

#### Share this post

##### Share on other sites
Advertisement
Are you developing on (or for) 64-bit Windows? The messages are a mystery to me, but the "warning C4312: 'type cast' : conversion from 'uintptr_t' to 'void *' of greater size" part seems to mean that void* is bigger than some user-defined pointer type. I assume the user-defined pointer type is 32 bits, while regular pointers are 64, if you're working in a 64-bit environment.

As far as avoiding typing those libs into the project settings, the only other option I know is to drag the .lib files into the Solution Explorer pane in Visual Studio. That should add them to the project, and automatically set up the project to link to them.

#### Share this post

##### Share on other sites
Quote:
 Original post by NUCLEAR RABBITDoes anyone know anyway to make it so I dont have to type "SDL.lib SDLmain.lib" in the Project->Project Name Properties->Linker->Input - Additional Dependincies text field for every single time I want to create an SDL application? because I always have to go to a website that has what I need to type everytime I want to create an SDL app and it gets tedious.Thanks for any help! Its greatly Appreciated! [smile]

How often do you make a project if it's too much work to type two short words into a text box?? I guess you must be exhausted from typing that long post...

#### Share this post

##### Share on other sites
Quote:
Original post by Anonymous Poster
Quote:
 Original post by NUCLEAR RABBITDoes anyone know anyway to make it so I dont have to type "SDL.lib SDLmain.lib" in the Project->Project Name Properties->Linker->Input - Additional Dependincies text field for every single time I want to create an SDL application? because I always have to go to a website that has what I need to type everytime I want to create an SDL app and it gets tedious.Thanks for any help! Its greatly Appreciated! [smile]

How often do you make a project if it's too much work to type two short words into a text box?? I guess you must be exhausted from typing that long post...

That's a pretty stupid post, Mr. Anonymous Coward. Try to avoid this kind of dumbness in the future. Thanks.

NUCLEAR RABBIT:

you can use a well known #pragma
#pragma comment(lib, "the_library_name.lib")

It has to be included only one in your project, so I suggest you to put it in the stdafx.h header. You'll still have to specify the path of the lib in the project properties though, unless you specify the full path in the library name.

(edit) and to answer your original question, their is a setting in the project settings that can be set to false in order to not detect the 64 bit portability problems. I just don't remember where, but I think it is in the general properties of the project (not sure). You'll have to search it :)

Regards,

[Edited by - Emmanuel Deloget on October 19, 2006 7:53:39 AM]

#### Share this post

##### Share on other sites
Quote:
 Original post by Emmanuel DelogetThat's a pretty stupid post, Mr. Anonymous Coward. Try to avoid this kind of dumbness in the future. Thanks.

What are you talking about? It's a perfectly valid observation. It can't get much easier than typing the names of the libraries into a text box. If he's having trouble with that... good luck with the rest of the project configuration.

#### Share this post

##### Share on other sites
I'm not 100% on this as haven't tried it, but if you look at this guide to installing the PSDK into VSExpress, step 4 shows how to make VS default-link to the PSDK libs via modifying the corewin_express.vsprops file.

My untested theory is that you could add your SDL .lib files to the corewin_express.vsprops file in this way to have VS default link to them as well.

Worth a try, anyway. Best of luck. Despite the AP, I quite agree that it can be annoying having to add .libs you always use to a new project. If you have a common header file you always use in your SDL projects, you'd be better advised to follow Emmanuel's advice and use #pragma comment(lib,"SDL.lib"). That's what I do in my Direct3D wrapper to avoid having to add d3d9.lib to every new project.

#### Share this post

##### Share on other sites
Hey,

Thanks for all the great replies. I'll be sure to test them out after I finish my homework! [smile]

@ AP,

Please, dont waste my time as well as others by giving smartass answers that dont help anyone. As for me being lazy for not wanting to type, its not that at all. Its that I dont want to waste my time creating the project rather than programming it. Why waste time when I can find an easyer way, thats what technology is all about, so get over yourself.

[Edited by - NUCLEAR RABBIT on October 19, 2006 10:06:31 PM]

#### Share this post

##### Share on other sites
To be honest, I think it's a valid observation. Are you just going to be copy and pasting that #pragma command instead now? It pays to get familiar with the IDE you use.

#### Share this post

##### Share on other sites
When just starting to learn somthing, its natural to create a whole slew of small projects to experiment with. If you're "project" only represents a few hours of tinkering, it can be irritating to setup the dependencies and such.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
18
5. 5
• Advertisement

• 14
• 23
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631766
• Total Posts
3002235
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!