Onega

a lot of VC++ posts, a few C# posts, and some miscellaneous stuff

Monday, September 19, 2005

build cchess(http://sourceforge.net/projects/cchess) with Dev-CPP

I have downloaded SDL library and put SDL.lib,SDL_mixer.lib,
SDLmain.lib on the same directory as SDL_demo.dev
the absolute path of SDL_mixer.lib is also updated in
SDL_demo.dev
Now I have the following error:
Compiler: Default compiler
Building Makefile: "D:\Onega\test\cchess\Makefile.win"
Executing make...
make.exe -f "D:\Onega\test\cchess\Makefile.win" all
gcc.exe main.o token.o button.o chess.o combox.o edit.o
font.o game.o map.o obj_list.o pvsp.o rules.o selimg.o
block.o window.o trace.o audio.o -o "cchess.exe"
-L"d:/apps/Dev-Cpp/lib" -mwindows -lwsock32 -lmingw32
-lSDLmain -lSDL -mwindows
"D:/Onega/test/cchess/SDL_mixer.lib" -lobjc

d:\apps\Dev-Cpp\Bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32bin\ld.exe:
cannot find -lSDLmain
collect2: ld returned 1 exit status

make.exe: *** [cchess.exe] Error 1

steps to compile the source code with Dev-CPP
Download
http://www2.tw.freebsd.org/cygwin/release/gcc-mingw/gcc-mingw-obj
c/gcc-mingw-objc-20050522-1.tar.bz2
and unzip libobjc.a to D:\Apps\Dev-Cpp\lib\libobjc.a
Edit D:\Onega\test\cchess\SDL_demo.dev
remove "-lSDLmain -lSDL" from the following line
Linker=-lwsock32 -lmingw32 -lSDLmain -lSDL -mwindows
"D:\Onega\test\cchess\SDL_mixer.lib"_@@_
Build SDL library with VC++ 6.0, copy sdl.lib and
sdlmain.lib to
D:\Onega\test\cchess\SDL.a
D:\Onega\test\cchess\SDLmain.a
Add sdl.a and sdlmain.a to Dev-CPP project options
->parameters: linker
Modify D:\Onega\test\cchess\main.c
int APIENTRY WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
/*INT main(INT argc,CHAR * argv[])*/
{
GlobalInit();
Game_UIMain();
Game_Exec();
}

The build problem is fixed by phoenix96_2000(eXMe). He also
faced undefined references to '_alloca_probe' problem and
fixed it via adding winmm library -lwinmm

0 Comments:

Post a Comment

<< Home