Talk:Compiling under VS2008

From Valve Developer Community
Jump to: navigation, search

Error - 'IsBIK': identifier not found

Hi, I tried compiling the source, but it failed with the error

    error C3861: 'IsBIK': identifier not found	c:\hl2mod\src\game\client\spritemodel.cpp

any tips? This mod is working off of Half Life 2 Multiplayer.

-cq75 15:30 PM, 11/30/2010 (EST)


My guess would be to add:

  ==  #include "/avi/ibik.h"  ==

At the top of spritemodel.cpp -Jackledead

Problem

Hi. I followed this tutorial but I need help. I do not understand anything. Okay, I used the Game_HL2MP-2005.sln for the Orange Box version, but the things which I should do after it, I don't understand it. I can't find for example the file server/memoverride.cpp. Also I don't know where I can launch my mod with "-allowdebug. I think the tutorial isn't that great and pictures are also missing.

Can someone help me? --Capone93 18:01, 14 February 2010 (UTC)

Fair enough on the paths - they're all subdirectories of \game - but this isn't the place to explain how to launch programs with command-line parameters. If you don't know how to do that you probably shouldn't be programming yet! --TomEdwards 20:43, 14 February 2010 (UTC)


No need for the document to be signed. Conclusion has been removed due to irrelevance. - jsynnott

Compiling in Debug mode

I always thought you shouldn't ever compile in Debug? Did someone fiddle with the text? Unsigned comment added by Fabbecool (talkcontribs). Please use four tildes (~~~~) or {{Message}} template to sign your username.

I extracted your own fiddle (the above) from the article and moved it here. The wiki markup for comments is "<!-- comment -->"; starting a line with "//" doesn't hide it. --Tourorist 07:45, 13 Feb 2008 (PST)

Trade of words?

If you are using the Orange box source code, you will need to copy Game_HL2MP-2005.sln, game\client\server_hl2mp-2005.vcproj and game\server\client_hl2mp-2005.vcproj and change the 2005 to 2008. --Durub 20:23, 16 Feb 2008 (PST)

At 15:57, 19 Feb 2008 (PST) Csteinhoff suggested:
If you are using the Orange box source code, you will need to copy Game_HL2MP-2005.sln,
game\client\client_hl2mp-2005.vcproj and game\server\server_hl2mp-2005.vcproj and change the 2005 to 2008.

--Etset 16:44, 19 Feb 2008 (PST)

Check out this Bug

If you use Visual Studio Express 2008 you will need to check out this bug report......

http://developer.valvesoftware.com/cgi-bin/bugzilla/show_bug.cgi?id=214

I contains a fix that you will need to finish the client compile. --Csteinhoff 19:13, 20 Feb 2008 (PST)

This bug exists for me, but the fix does not work. It generates 2520 errors. To fix the errors, you must remove this from the "Configuration Properties/Linker/Command Line" tab for Client_HL2:
/FORCE:MULTIPLE
/NODEFAULTLIB:LIBCMT

Kflorence 13:43, 26 Feb 2008 (PST)

Compiler Error C2733

I got this error

C:\vs9\vc\include\intrin.h(847) : error C2733: second C linkage of overloaded function '_interlockedbittestandset' not allowed
C:\vs9\vc\include\intrin.h(847) : see declaration of '_interlockedbittestandset'
C:\vs9\vc\include\intrin.h(848) : error C2733: second C linkage of overloaded function '_interlockedbittestandreset' not allowed
C:\vs9\vc\include\intrin.h(848) : see declaration of '_interlockedbittestandreset'
  • I second this. I got it when trying to compile Orange Box code. It's very annoying >:(. Please find a way to fix it. --Kohan 13:51, 15 Mar 2008 (PDT)

fixed.... Just comment lines

__MACHINEI(unsigned char _interlockedbittestandset(long volatile *a, long b))
__MACHINEI(unsigned char _interlockedbittestandreset(long volatile *a, long b))

in C:\vs9\vc\include\intrin.h and remove

/FORCE:MULTIPLE
/NODEFAULTLIB:LIBCMT

It's no longer needed to install platform sdk or windows because they are already in VC, so commenting the lines above is no longer needed but /FORCE:MULTIPLE and /NODEFAULTLIB:LIBCMT needs to be removed

Error in Output Destination for Client (HL2MP)

There seems to be a slight error in the Outputs field (Properties > Custom Build Step > General > Outputs), the ";" is creating trouble when copying to destination.

You can get around this by removing the ";" and putting the second path on a new line (as in Server (HL2MP) )

Also, after running into the error a bin "file" may have been created in the destination folder, that will prevent the bin folder from being created. This bin "file" should be deleted before subsequent attempts.

(Using VEC++2008) --Hsadan 19:16, 25 Mar 2008 (PDT)

Potential issues with instructions as of July 16, 2008

I did not find a server/memoverride.cpp file with which to comment out the void __cdecl _invalid_parameter_noinfo(void) function from. However, there existed a client/memoverride.cpp file, so I commented the function out from there. This allowed me to build without link errors. [I am using VS2008 SP1beta.]

Also, it turns out that I did not have to edit client/c_vguiscreen.cpp (again, using VS2008 SP1beta).

However, I do still get a link warning: 2>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library Unfortunately, I do not know how to resolve this warning. When I went to set Linker | Input | Ignore Specific Library to "libc;libcd;libcmtd;limcmt" (adding libcmt) for Server Debug, I received 8258 errors!

One must ensure that a [MY MOD]/bin directory exists. If it does not, then the copying of the client.dll, client.pdb, server.dll, and server.pdb files fails because each copy creates the filename "bin" within the mod directory.

To compile xwad and possibly other projects cleanly with VS2008, it's necessary to specify _CRT_SECURE_NO_WARNINGS and _CRT_NONSTDC_NO_WARNINGS as compilation options. This can be done under Configuration Properties | C/C++ | Preprocessor | Preprocessor Definitions.


2>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library

I think your getting this warning because the libraries under lib/public are compiled against libcmtd and you're trying to compile client/server.dll against libcmt. It should be safe to ignore this warning I haven't seen any side effects yet. --Nomad 18:13, 19 Sep 2008 (PDT)

If you want to fix this just build the solution in release mode, worked for me!! --MLSTRM 12:37, 09 Nov 2008

Fix debug compilation

wouldn't this code be better to use instead of just commenting it out?--Neico 01:42, 16 Aug 2008 (PDT)


#if defined( _DEBUG ) && _MSC_VER < 1500

// wrapper which passes no debug info; not available in debug
void __cdecl _invalid_parameter_noinfo(void)
{
   Assert(0);
}

#endif /* defined( _DEBUG ) */

client\c_vguiscreen.cpp Alternate Fix

Here is my alternative fix for this bug (Ln348client\c_vguiscreen.cpp).

Replace

dist = c_x / tan( M_PI * scaled_fov / 360.0 );

with

dist = c_x / tanf( M_PI * scaled_fov / 360.0f );

Notice the tanf and 360.0f instead of tan and 360.0

Compiles under VS2008 Express with 0 Errors

Can this be moved to the main page when somebody else confirms it doesn't break anything? Jenkins08 11:19, 29 Nov 2008 (PST)

Fix file copying (From the main page)

The step on the main page about Fixing File copying is no longer needed.

Valve have updated the orangebox .sln files so they build to the correct folders. (bin sub directory is successfully created when it doesn't exist etc)

That certain step is now defunct and can somebody verify this please?

Possibly remove that step from the main page so many people don't follow it when there is absolutely no need anymore. --Jenkins08 02:58, 29 Nov 2008 (PST)

Looking at the project files in a text editor, it does seem that most of the problems have been eliminated. But the default setup only copies PDB files in release mode, not debug! The fix is still needed for that. --TomEdwards 04:20, 29 Nov 2008 (PST)
Thanks for that, I don't often use debug build as i have no real heavy modifications to the source code, therefor no real need for the debug build..--Jenkins08 19:30, 10 Dec 2008 (PST)

Error already defined in memoverride.obj

When I began the rebuild I came across 116 errors. 115 of them where all involving Already Defined varribles in memoverride.obj and 1 was

Error 128 fatal error LNK1169: one or more multiply defined symbols found c:\MyMod\src\game\server\Debug_hl2mp\Server.dll Server HL2MP

I also came across 12 warnings

Warning 1 Command line warning D9030 : '/Gm' is incompatible with multiprocessing; ignoring /MP switch cl Server HL2MP Warning 2 Command line warning D9030 : '/Gm' is incompatible with multiprocessing; ignoring /MP switch cl Client HL2MP Warning 3 warning C4627: '#include <windows.h>': skipped when looking for precompiled header use c:\mymod\src\game\client\in_joystick.cpp 10 Client HL2MP Warning 4 warning C4627: '#include "hudelement.h"': skipped when looking for precompiled header use c:\mymod\src\game\client\hl2\hud_credits.cpp 7 Client HL2MP Warning 5 warning C4627: '#include "hud_numericdisplay.h"': skipped when looking for precompiled header use c:\mymod\src\game\client\hl2\hud_credits.cpp 8 Client HL2MP Warning 6 warning C4627: '#include <vgui_controls/Panel.h>': skipped when looking for precompiled header use c:\mymod\src\game\client\hl2\hud_credits.cpp 9 Client HL2MP Warning 7 warning C4627: '#include "hudelement.h"': skipped when looking for precompiled header use c:\mymod\src\game\client\hl2\hud_flashlight.cpp 7 Client HL2MP Warning 8 warning C4627: '#include "hud_numericdisplay.h"': skipped when looking for precompiled header use c:\mymod\src\game\client\hl2\hud_flashlight.cpp 8 Client HL2MP Warning 9 warning C4627: '#include <vgui_controls/Panel.h>': skipped when looking for precompiled header use c:\mymod\src\game\client\hl2\hud_flashlight.cpp 9 Client HL2MP Warning 10 Command line warning D9030 : '/Gm' is incompatible with multiprocessing; ignoring /MP switch cl Client HL2MP Warning 69 warning C4627: '#include "weapon_hl2mpbasehlmpcombatweapon.h"': skipped when looking for precompiled header use c:\mymod\src\game\server\hl2mp\hl2mp_player.cpp 7 Server HL2MP Warning 70 Command line warning D9030 : '/Gm' is incompatible with multiprocessing; ignoring /MP switch cl Server HL2MP

And yes I did follow this tutorial and yes I did get this source code from source sdk, orangebox version (the newest version)

Panacea

Compiler under release, (for me) those errors happen only under debug. SiPlus 11:06, 16 May 2011 (UTC)

Bin files not copying Source 2007

Whenever i compile my code, it never creates the bin files. How can i fix this?