Problems with VC++

Hi there,

I have one problem with VC++ i followed all the instruccions who puts on some
articles i found in some Websites and i write a start code on the VC++
compiler, and here is the problem:

The program compile and build right but when i try to execute a ERROR window
show me on the screen

only one warning show me when i build the program:

MSVCRT.lib(cinitexe.obj) : warning LNK4098: defaultlib “libcmt.lib” conflicts
with use of other libs; use /NODEFAULTLIB:library

Could this warning make the ERROR?

here i atach the source code:

#include <stdio.h>
#include <stdlib.h>
#include <SDL.h>

int main(int argc, char *argv[])
{
SDL_Surface *screen;
SDL_Event event;
int done = 0;

atexit(SDL_Quit);
// Iniciar SDL

if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO) < 0) 
{
	printf("No se pudo iniciar SDL: %s\n",SDL_GetError());
	exit(1);
}
// Activamos modo de video
screen = SDL_SetVideoMode(640,480,24,SDL_HWSURFACE);
if (screen == NULL) 
{
	printf("No se puede inicializar el modo gr?fico\n",SDL_GetError

());
exit(1);
}
// Esperamos la pulsaci?n de una tecla para salir
while(done == 0) {
while ( SDL_PollEvent(&event) ) {
if ( event.type == SDL_KEYDOWN )
done = 1;
}
}
return 0;
}
Thanx a lot

Make sure you are linking to the right run-time library. This is found
under Configuration Properties->C/C+±>Code Generation. I set it
Multithreaded DLL and it works. I am not sure if this will fix the
problem, but from what I recall I had the same problem a while ago.

Generally, if you’re code compiles, something is wrong with the linking.

What’s the error that comes up?

Hope that helps!

TommyOn 27/02/07, javier wrote:

Hi there,

I have one problem with VC++ i followed all the instruccions who puts on some
articles i found in some Websites and i write a start code on the VC++
compiler, and here is the problem:

The program compile and build right but when i try to execute a ERROR window
show me on the screen

only one warning show me when i build the program:

MSVCRT.lib(cinitexe.obj) : warning LNK4098: defaultlib “libcmt.lib” conflicts
with use of other libs; use /NODEFAULTLIB:library

Could this warning make the ERROR?

here i atach the source code:

#include <stdio.h>
#include <stdlib.h>
#include <SDL.h>

int main(int argc, char *argv[])
{
SDL_Surface *screen;
SDL_Event event;
int done = 0;

    atexit(SDL_Quit);
    // Iniciar SDL

    if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO) < 0)
    {
            printf("No se pudo iniciar SDL: %s\n",SDL_GetError());
            exit(1);
    }
    // Activamos modo de video
    screen = SDL_SetVideoMode(640,480,24,SDL_HWSURFACE);
    if (screen == NULL)
    {
            printf("No se puede inicializar el modo gr?fico\n",SDL_GetError

());
exit(1);
}
// Esperamos la pulsaci?n de una tecla para salir
while(done == 0) {
while ( SDL_PollEvent(&event) ) {
if ( event.type == SDL_KEYDOWN )
done = 1;
}
}
return 0;
}
Thanx a lot


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hi Tommy I link the right run-time library but the problem is still there, I
set Multithreaded DLL but the Window error comes up,

It?s the kind of “A problem has been detected and it should be closed”

other idea???

Thanx!

It`s already fixed i follow the instruccions of other website who have a new
version of SDL and It?s works perfec!!

Thanx for your help!

It might be useful to list the good website and summarize the fix that
it suggested.

ChrisOn 2/28/07, javier wrote:

It`s already fixed i follow the instruccions of other website who have a new
version of SDL and It?s works perfec!!


E-Mail: Chris Nystrom <@Chris_Nystrom>
Saving the world from web programming.
http://www.newio.org/ - AIM: nystromchris

Yes, please tell what the exact error and solution were, as people
"googling" will be able to find it in the archives!On 28/02/07, Chris Nystrom wrote:

On 2/28/07, javier wrote:

It`s already fixed i follow the instruccions of other website who have a new
version of SDL and It?s works perfec!!

It might be useful to list the good website and summarize the fix that
it suggested.

Chris


E-Mail: Chris Nystrom
Saving the world from web programming.
http://www.newio.org/ - AIM: nystromchris


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Ok , I followed the steps who describes in this website i atach:

http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/tut1

Well I tried all the last week to fix the problem with the execute with my
hello world in SDL i have the same problem with the allegro?s library and
following the same steps who puts on that web i already can use the two
libraries!!:wink:

I hope i can help you!

and Thanx for the help!!