* FAQ    * Search  * Register * Login 
Active topics
Unanswered topics

All times are UTC-06:00



Post new topic  Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Can someone help me build D2X-XL from source?
PostPosted: Fri Aug 04, 2006 9:39 pm 
Offline
DBB Cadet
DBB Cadet

Joined: Thu Aug 03, 2006 6:20 pm
Posts: 4
I'm trying to build D2X-XL in Visual C++ 7. I have four goals, to build the projects d2x and d2xgl, using both the Debug and Release configs. In each goal, I'm having a problem.

d2xgl, Debug
Everything compiles. But when it links, I get this error:
Code:
MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup

I've also noticed that if I define the entry point as a function that exists in inferno.c, such as MainLoop, it will finish linking, but the *correct* entry point function seems to be
Code:
int _CDECL_ main (int argc, char *argv[])
which is also located in inferno.c. But I have no idea what I need to type in as the entry point to use this.
My linker command line parameters look like this:
Code:
/OUT:\"d:\\games\\descent\\d2\\d2x-xl-dbg.exe\" /INCREMENTAL /NOLOGO /LIBPATH:\"D:\\visualstudionet\\Vc7\\PlatformSDK\\Lib\" /LIBPATH:\"D:\\cppproj\\SDL-1.2.10\\VisualC\\SDL\\Debug\" /LIBPATH:\"D:\\cppproj\\SDL_mixer-1.2.7\\VisualC\\Debug\" /DEBUG /PDB:\".\\Debug/d2x-xl-dbg.pdb\" /SUBSYSTEM:WINDOWS odbc32.lib odbccp32.lib wsock32.lib opengl32.lib glu32.lib winmm.lib sdl.lib sdl_mixer.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \\cppproj\\d2x\\VisualC\\libmve\\Debug\\libmve.lib \"\\cppproj\\SDL-1.2.10\\VisualC\\SDL\\Debug\\SDL.lib\" \"\\cppproj\\SDL_mixer-1.2.7\\VisualC\\Debug\\SDL_mixer.lib\" /MACHINE:I386



d2xgl, Release
Everything compiles, I get these linking errors:
Code:
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _exit already defined in LIBCMT.lib(crt0dat.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _fclose already defined in LIBCMT.lib(fclose.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _fprintf already defined in LIBCMT.lib(fprintf.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _fopen already defined in LIBCMT.lib(fopen.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _sprintf already defined in LIBCMT.lib(sprintf.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _getenv already defined in LIBCMT.lib(getenv.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _strstr already defined in LIBCMT.lib(strstr.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _strncpy already defined in LIBCMT.lib(strncpy.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _atoi already defined in LIBCMT.lib(atox.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _atof already defined in LIBCMT.lib(atof.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _strchr already defined in LIBCMT.lib(strchr.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _strtol already defined in LIBCMT.lib(strtol.obj)
MSVCRT.lib(MSVCR70.dll) : error LNK2005: _vsprintf already defined in LIBCMT.lib(vsprintf.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup

My linker command line parameters look like this:
Code:
/OUT:\"d:\\games\\descent\\d2\\d2x-xl.exe\" /INCREMENTAL:NO /NOLOGO /LIBPATH:\"D:\\visualstudionet\\Vc7\\PlatformSDK\\Lib\" /LIBPATH:\"D:\\cppproj\\SDL_mixer-1.2.7\\VisualC\\Release\" /PDB:\".\\Release/d2x-xl.pdb\" /SUBSYSTEM:WINDOWS odbc32.lib odbccp32.lib wsock32.lib opengl32.lib glu32.lib winmm.lib sdl.lib sdl_mixer.lib  kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib \\cppproj\\d2x\\VisualC\\libmve\\Release\\libmve.lib \"\\cppproj\\SDL-1.2.10\\lib\\SDL.lib\" \"\\cppproj\\SDL_mixer-1.2.7\\VisualC\\Release\\SDL_mixer.lib\" /MACHINE:I386



d2x, Debug
I get a *ton* of compile errors. The first few look like this:
Code:
d:\\cppproj\\d2x\\texmap\\tmapflat.c(98) : error C2065: 'gameStates' : undeclared identifier
d:\\cppproj\\d2x\\texmap\\tmapflat.c(98) : error C2224: left of '.render' must have struct/union type
d:\\cppproj\\d2x\\texmap\\tmapflat.c(101) : error C2224: left of '.render' must have struct/union type
d:\\cppproj\\d2x\\texmap\\tmapflat.c(304) : error C2440: 'function' : cannot convert from 'grs_color' to 'int'
d:\\cppproj\\d2x\\texmap\\tmapflat.c(304) : warning C4024: 'texture_map_flat' : different types for formal and actual parameter 2
scanline.c


My compiler command line parameters look like this:
Code:
/Od /I \"..\\..\\include\" /I \"..\\..\\main\" /I \"..\\..\\arch\\include\" /I \"..\\..\\arch\\win32\\include\" /I \"..\\..\\3d\" /I \"..\\..\\..\\..\\sdl\\SDL-1.2.10\\include\" /D \"_DEBUG\" /D \"WIN32\" /D \"_WINDOWS\" /D \"NO_ASM\" /D \"NMONO\" /D \"PIGGY_USE_PAGING\" /D \"NEWDEMO\" /D \"SDL_INPUT\" /D \"SDL_VIDEO\" /D \"FAST_FILE_IO\" /D \"CONSOLE\" /D \"NETWORK\" /D \"NATIVE_IPX\" /D \"_MBCS\" /FD /EHsc /RTC1 /MDd /Fp\".\\Debug/d2x.pch\" /Fo\".\\Debug/\" /Fd\".\\Debug/\" /W3 /nologo /c /ZI



d2x, Release
I *think* the compile errors I get are the same as the ones I get in the Debug config.
My compiler command line parameters look like this:
Code:
/O2 /Ob1 /I \"..\\..\\include\" /I \"..\\..\\main\" /I \"..\\..\\arch\\include\" /I \"..\\..\\arch\\win32\\include\" /I \"..\\..\\3d\" /I \"..\\..\\..\\..\\sdl\\SDL-1.2.10\\include\" /D \"NDEBUG\" /D \"RELEASE\" /D \"WIN32\" /D \"_WINDOWS\" /D \"NO_ASM\" /D \"NMONO\" /D \"PIGGY_USE_PAGING\" /D \"NEWDEMO\" /D \"SDL_INPUT\" /D \"SDL_VIDEO\" /D \"FAST_FILE_IO\" /D \"CONSOLE\" /D \"NETWORK\" /D \"NATIVE_IPX\" /D \"_MBCS\" /GF /FD /EHsc /MD /Gy /YX\"stdafx.h\" /Fp\".\\Release/d2x.pch\" /Fo\".\\Release/\" /Fd\".\\Release/\" /W3 /nologo /c


Thanks in advance for help in solving any of these problems.


Top
   
 Post subject:
PostPosted: Fri Aug 04, 2006 10:08 pm 
Offline
DBB Alumni
DBB Alumni
User avatar

Joined: Wed Mar 15, 2000 3:01 am
Posts: 8826
Location: Seattle
There's no WinMain in any of the sources?


Top
   
 Post subject:
PostPosted: Fri Aug 04, 2006 10:11 pm 
Offline
DBB Cadet
DBB Cadet

Joined: Thu Aug 03, 2006 6:20 pm
Posts: 4
I've done a findstr /S /I /C:\"winmain\" *.c on the directory, and found nothing.


Top
   
 Post subject:
PostPosted: Fri Aug 04, 2006 10:12 pm 
Offline
DBB Alumni
DBB Alumni
User avatar

Joined: Wed Mar 15, 2000 3:01 am
Posts: 8826
Location: Seattle
Tell you what, I'm gonna move this to the D2X-XL forum, Diedel will more likely see it there.


Top
   
 Post subject:
PostPosted: Sat Aug 05, 2006 2:01 am 
Offline
D2X Master
D2X Master
User avatar

Joined: Thu Nov 05, 1998 12:01 pm
Posts: 5278
Website: http://www.descent2.de
You need to also grab and use the SDL and SDL_mixer source from my Descent site. Their source zips contain other zips which in turn contain working MSVC 6 and .NET 2003 projects (at least I hope they work now).

You cannot compile D2X-XL with the standard SDL source because I have applied _cdecl to a few global function declarations to allow for compiling the rest with register calling convention enabled.

The project files also contain all required global defines.


Top
   
 Post subject:
PostPosted: Sat Aug 05, 2006 9:15 am 
Offline
DBB Cadet
DBB Cadet

Joined: Thu Aug 03, 2006 6:20 pm
Posts: 4
I've done that already. I didn't have any trouble building either of those. My \"Solution\" contains 11 projects:

d2x
d2xgl
libmve
mikmod
native_midi
playmus
playwave
SDL
SDL_mixer
SDLmain
timidity

All but d2x and d2xgl will build.


Top
   
 Post subject:
PostPosted: Sat Aug 05, 2006 11:07 am 
Offline
D2X Master
D2X Master
User avatar

Joined: Thu Nov 05, 1998 12:01 pm
Posts: 5278
Website: http://www.descent2.de
What is MSVC 7? Is that .NET 2003 or 2005? The proper .NET project is D2X-W32.


Top
   
 Post subject:
PostPosted: Sat Aug 05, 2006 12:32 pm 
Offline
DBB Cadet
DBB Cadet

Joined: Thu Aug 03, 2006 6:20 pm
Posts: 4
>>What is MSVC 7? Is that .NET 2003 or 2005?
2003. I *think* that 2005 is VC8.

>>The proper .NET project is D2X-W32
I don't see any project file called that, just an icon file. There's also a folder called d2x-w32, but there aren't any files in it, just a bunch of empty folders. I've redownloaded the source to double-check. I was using d2x.dsw (VC6), which was converted into d2x.sln (VC7).

Update:
As of version 1.6.131, Debug now builds. But trying to build Release gives me this error:
Code:
d:\\cppproj\\d2x\\arch\\sdl\\digi.c(548) : fatal error C1001: INTERNAL COMPILER ERROR  (compiler file 'f:\\vs70builds\\9466\\vc\\Compiler\\Utc\\src\\P2\\main.c', line 146)

I have no idea what this error means or where the directory \"f:\\vs70builds\\9466\\vc\\Compiler\\Utc\\src\\P2\" comes from. I do have a hard drive with the drive letter F, but there is no folder in it called \"vs70builds.\"


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC-06:00


Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Descent'rs have piloted these pages
 
The layout and contents contained within this site are © DescentBB.net 1997-2006.
Descent, Descent II are © Parallax Software Corporation.
Descent III is Outrage Entertainment.
Descent is a Trademark of Interplay Productions.

Miner Wars™ is trademark of Keen Software House s. r. o.
.


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group