Similiar strange error in visual c 6 when linking

I’ve also faced a similiar problem.

At first I got :-
msvcrt.lib error please use /NODEFAULTLIB:library

When I added /nodefaultlib at the linker option, I could not use the
string.h library.Whenever there is a string.h library was called it has
error although I the string library in was included.

Could anyone pointed out that which library must be omitted besides
msvcrt.lib in order to avoid the confict ?

Does this is a normal behaviour setup in Visual C++ ?

FYI:
I’ve gone thru a how to setup in the net and follows the all of the steps.

Regards,
Kok Cheong> -----Original Message-----

From: Jeff Means [SMTP:meaje at meanspc.com]
Sent: Monday, November 25, 2002 4:59 AM
To: SDL List
Subject: [SDL] strange error in visual c 6 when linking

Any help in solving the fix to this problem would be greatly appreacated.

Linking…
main.obj : error LNK2001: unresolved external symbol “void __cdecl
DrawPixel(struct SDL_Surface *,int,int,unsigned char,unsigned
char,unsigned
char)” (?DrawPixel@@YAXPAUSDL_Surface@@HHEEE at Z)
Debug/SDL Tests.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

SDL Tests.exe - 2 error(s), 0 warning(s)

Source Code:

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

#include <SDL.h>

// The functions are not shown to save space
void DrawPixel(SDL_Surface *screen, int x, int y,
Uint8 R, Uint8 G, Uint8 B);
void Slock(SDL_Surface *screen);
void Sulock(SDL_Surface *screen);

void Slock(SDL_Surface *screen)
{
if ( SDL_MUSTLOCK(screen) )
{
if ( SDL_LockSurface(screen) < 0 )
{
return;
}
}
}

void Sulock(SDL_Surface *screen)
{
if ( SDL_MUSTLOCK(screen) )
{
SDL_UnlockSurface(screen);
}
}

int main(int argc, char *argv[])
{

if ( SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO) < 0 )
{
printf(“Unable to init SDL: %s\n”, SDL_GetError());
exit(1);
}
atexit(SDL_Quit);

SDL_Surface *screen;
screen=SDL_SetVideoMode(640,480,32,SDL_HWSURFACE|SDL_DOUBLEBUF);
if ( screen == NULL )
{
printf(“Unable to set 640x480 video: %s\n”, SDL_GetError());
exit(1);
}

// DRAWING GOES HERE
Slock(screen);
for(int x=0;x<640;x++)
{
for(int y=0;y<480;y++)
{
DrawPixel(screen, x,y,y/2,y/2,x/3);
}
}
Sulock(screen);
SDL_Flip(screen);

return 0;
}


Jeffrey D. Means
CIO For MeansPC
meaje at meanspc.com


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl