Forum

Compiling Quake Using Visual C++ Express Edition

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Postby revelator » Fri Apr 17, 2009 11:48 am

can btw skip the ignore libc.lib if you change projects settings to use the c++ library (shared if your project uses any dll's) (static if not) important! at best the compiler will refuse to link if you dont do it this way at worst it compiles but get errors when running the exe.

also the warnings about deprecated libraries can be turned of by adding _CRT_SECURE_NO_WARNINGS to the preprocessor defines.
not so important unless you look for error messages cause it quickly becomes a mess to read if this aint turned off.

few things i discovered hope it ads ;)
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby Stroggos » Sat Apr 18, 2009 2:51 am

Thanks i can compile now!!!! SKYBOXES!!!!!
Stroggos
 
Posts: 50
Joined: Tue Apr 14, 2009 11:40 am
Location: Australia

Postby Stroggos » Wed Apr 22, 2009 2:54 am

THis is really easy also i found out you can apply the same method to QuakeWorld and WinQuake
Stroggos
 
Posts: 50
Joined: Tue Apr 14, 2009 11:40 am
Location: Australia

Postby revelator » Wed Apr 22, 2009 9:35 pm

can basically be used for all quake engines aye :) except maybe Q3
not sure on this one cause it uses lcc for some of the process.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby ceriux » Wed Dec 02, 2009 2:59 am

ok guys iv attempted to compile the vanilla quake engine again with no luck. this is what i have...


Code: Select all
1>Generating Code...
1>c:\cquake\gl_draw.c(148) : warning C4715: 'Scrap_AllocBlock' : not all control paths return a value
1>Compiling resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>gl_refrag.obj : error LNK2019: unresolved external symbol _BoxOnPlaneSide referenced in function _R_SplitEntityOnNode
1>gl_rmain.obj : error LNK2001: unresolved external symbol _BoxOnPlaneSide
1>world.obj : error LNK2001: unresolved external symbol _BoxOnPlaneSide
1>snd_mix.obj : error LNK2019: unresolved external symbol _Snd_WriteLinearBlastStereo16 referenced in function _S_TransferStereo16
1>snd_mix.obj : error LNK2019: unresolved external symbol _SND_PaintChannelFrom8 referenced in function _S_PaintChannels
1>sys_win.obj : error LNK2019: unresolved external symbol _Sys_SetFPCW referenced in function _Sys_Init
1>sys_win.obj : error LNK2019: unresolved external symbol _MaskExceptions referenced in function _Sys_Init
1>sys_win.obj : error LNK2019: unresolved external symbol _Sys_PopFPCW referenced in function _Sys_FloatTime
1>sys_win.obj : error LNK2019: unresolved external symbol _Sys_PushFPCW_SetHigh referenced in function _Sys_FloatTime
1>world.obj : error LNK2019: unresolved external symbol _SV_HullPointContents referenced in function _SV_PointContents
1>.\release_gl\glquake.exe : fatal error LNK1120: 8 unresolved externals
1>Creating browse information file...
1>Microsoft Browse Information Maintenance Utility Version 9.00.30729
1>Copyright (C) Microsoft Corporation. All rights reserved.
1>Build log was saved at "file://c:\cquake\release_gl\BuildLog.htm"
1>winquake - 11 error(s), 3 warning(s)
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========



edit: got it to work by right clicking the sln file after i opened it as a project/solution and clicked rebuild instead of build?
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby metlslime » Wed Dec 02, 2009 6:03 am

those missing symbols all appear to be functions that are implemented in ASM in the original quake source...
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby ceriux » Wed Dec 02, 2009 6:50 am

i got that working, but i posted on a another thread after i tried to add something if you wouldnt mind would you look at that one?
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby r00k » Tue Dec 08, 2009 8:27 am

I've converted my project to MSVC 2008 Express, though
in doing so I've noticed a new quirks and wondered if there's a setting or switch that's causing a problem.

for example:
this code works in MSVC v6.0
Code: Select all
void Cmd_PrintLoc_f (void)
{
   char loc[16], ang[16];

   sprintf (loc, "'%5.1f %5.1f %5.1f'", cl_entities[cl.viewentity].origin[0], cl_entities[cl.viewentity].origin[1], cl_entities[cl.viewentity].origin[2]);   
   Con_Printf ("origin:%s\n",loc);
   sprintf (ang, "'%5.1f %5.1f %5.1f'", cl_entities[cl.viewentity].angles[0], cl_entities[cl.viewentity].angles[1], cl_entities[cl.viewentity].angles[2]);      
   Con_Printf ("angle :%s\n",ang);
}


yet compiled under 2008 it locks up the program.
Any ideas?
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby metlslime » Tue Dec 08, 2009 8:52 am

not sure this is the cause of your problem, but those buffers don't look big enough.
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby r00k » Tue Dec 08, 2009 9:03 am

Eeek! You're right! I must have modified the strings and not the variable defines! :oops: I guess v6.0 is more lax about things like this!
BTW I removed all the asm files and so far seems to work :P
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Baker » Tue Dec 08, 2009 11:54 am

r00k wrote:Eeek! You're right! I must have modified the strings and not the variable defines! :oops: I guess v6.0 is more lax about things like this!
BTW I removed all the asm files and so far seems to work :P


snprintf! Not sprintf!

I globally replaced all of the sprintfs using POSIX to replace all of them.

viewtopic.php?t=1301

I noticed a lot of string buffer overflow protection in ezQuake added in 2008 and, of course, the DarkPlaces source code for years. There are a few other changes like strcat becomes strlcat.

POSIX search and replace can save hours of time doing things like the above in a split second, although writing a POSIX search and replace is a bit of work (but hey, 5 minutes to save 5 hours and guarantee no human error in 276 changes!)
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby r00k » Wed Dec 09, 2009 3:37 am

Idea: writing alias commands to the config.cfg using cvar cfg_savealias.
Now its pretty straight forward but is it practical? I would think that having aliases ready when you connect means the server wont spam you again with the alias binds, means faster connecting to play..
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby Spike » Wed Dec 09, 2009 3:46 am

r00k wrote:Idea: writing alias commands to the config.cfg using cvar cfg_savealias.
Now its pretty straight forward but is it practical? I would think that having aliases ready when you connect means the server wont spam you again with the alias binds, means faster connecting to play..


Because the server won't know if you already have aliases set up.
Because you can set aliases in the mod's default.cfg file anyway, with no need to save them.
Because stuffcmd(player, "alias quit "say omg I'm lame"\ncfg_savealias\n") is evil.

Actually, most QW clients wipe the aliases stuffed by servers when they disconnect. It helps with gamedir changes.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby r00k » Wed Dec 09, 2009 3:51 am

ya thats what i was forgettin ;)
r00k
 
Posts: 1110
Joined: Sat Nov 13, 2004 10:39 pm

Postby MeTcHsteekle » Wed Dec 09, 2009 4:12 am

spike dont forget making w bind to "kill" command

MUWAHHAHAHAHAHAHAHAHAHA
bah
MeTcHsteekle
 
Posts: 399
Joined: Thu May 15, 2008 10:46 pm
Location: its a secret

PreviousNext

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest