.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Programming (http://forums.bots-united.com/forumdisplay.php?f=25)
-   -   command line compile (http://forums.bots-united.com/showthread.php?t=1285)

dead bwoy 07-04-2004 19:24

command line compile
 
help please:
http://forums.bots-united.com/showpo...1&postcount=60

Cpl. Shrike 07-04-2004 21:01

Re: command line compile
 
You need to make a MAKE file.
And pass that to the command line compile.

MCVS can export its make file.
If you don';t have that then you'll need to make your own make file.
Im don't know how to do that yet. im using the msvc visual version so i get the make file which msvc makes it self .
I only know how to do my linux make file.
And i asume that's not compatible with msvc.

Pierre-Marie Baty 07-04-2004 22:27

Re: command line compile
 
You're not forced to make a Makefile... you can compile from the command line if you know what you are doing.

For example, a command-line compile and linking can look like this:

Quote:

MKDIR Release

CD Release

CALL "C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"

CL.EXE /nologo /MT /W3 /GX /O2 /I "..\..\metamod" /I "..\..\..\devtools\sdk\Single-Player Source\dlls" /I "..\..\..\devtools\sdk\Single-Player Source\common" /I "..\..\..\devtools\sdk\Single-Player Source\engine" /I "C:\Some\Other\Include\Path" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "yourproject_EXPORTS" /YX /FD /c ..\yourproject_file1.cpp

REM add other CL.EXE lines for each .cpp file to compile

LINK.EXE kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /def:"..\yourproject.def" yourproject_file1.obj yourproject_file2.obj yourproject_fileN.obj

ECHO.build complete

CD ..


dead bwoy 07-04-2004 22:39

Re: command line compile
 
so what do i do with this makefile?
ive setenv /2000 /RETAIL
from dos prompt in:
c:\program files\microsoft sdk>
makefile is here:
c:\program files\microsoft sdk\metamod-1.17>
sorry im a total n00b!!!
where can i find the commands to use? do i use them from c:\program files\microsoft sdk> or does the dir matter?

EDIT:
ok wow! quick one pmb!
this should help a bit. Is there a good online resource for command line compiler (.net framework)? msdn is very difficult to find compiler help. It says that the command line compiler is well documented, it probably is but i cannot find the dox!?!

dead bwoy 10-04-2004 23:28

Re: command line compile
 
so i just got msvc 6 se (off a friend of a friend who took a class in college). I get this error:
engine_api.cpp(386) : error C2440: '=' : cannot convert from 'void (__cdecl *)(void *,char *,...)' to 'void (__cdecl *)(struct _iobuf *,char *,...)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast

what didnt i do right, im still getting used to this program.

Pierre-Marie Baty 11-04-2004 03:55

Re: command line compile
 
well for starters it would help if you posted what was contained on line 386 of engine_api.cpp...

dead bwoy 11-04-2004 04:23

Re: command line compile
 
i suppose you're right

META_ENGINE_HANDLE_void_varargs(FN_ENGINEFPRINTF, pfnEngineFprintf, pfile, szFmt);

from

void mm_EngineFprintf(FILE *pfile, char *szFmt, ...) {
META_ENGINE_HANDLE_void_varargs(FN_ENGINEFPRINTF, pfnEngineFprintf, pfile, szFmt);
RETURN_API_void()
}

botman 11-04-2004 15:22

Re: command line compile
 
Change...
Code:

void mm_EngineFprintf(FILE *pfile, char *szFmt, ...)
...to this...
Code:

void mm_EngineFprintf((struct _iobuf *)pfile, char *szFmt, ...)
The question is, WHY is 'FILE' being interpreted as 'void' when it should be a 'struct _iobuf' type? I think you are missing some include files that would resolve 'FILE' to the proper type.

botman

Pierre-Marie Baty 11-04-2004 20:48

Re: command line compile
 
That's what I think too. Metamod must be detecting what type of compiler it's being compiled on, and yours must not be caught in the list. You'd perhaps better have a look at where it's done.

dead bwoy 11-04-2004 21:11

Re: command line compile
 
/* Define __cdecl for non-Microsoft compilers */

could this be it? (from: stdio.h) I am using a microsoft compiler though: msvc 6 se

botman 12-04-2004 14:53

Re: command line compile
 
No, that's saying if you are *NOT* using a Microsoft compiler you need to define __cdecl.

__cdecl should already be defined in MSVC.

If you've modified ANY of the metamod source code, you should probably change it back to what it originally was (or just delete what you have now and re-install the metamod source). Compile the unmodified metamod source and post any errors you get here.

botman

dead bwoy 12-04-2004 19:25

Re: command line compile
 
do i need a service pack for msvc?

heres the new error with the default (metamod 1.17 from metamod.org) .dsw

D:\Program Files\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
conf_meta.cpp

Lazy 12-04-2004 19:37

Re: command line compile
 
It's been a long time but you must move all of the half-life include directories in your listing to either the top or the bottom of the list and keep them together.

I cannot remember which since I do not use VS 6 anymore.

dead bwoy 12-04-2004 20:09

Re: command line compile
 
under project options i have:
/nologo /MT /W3 /GX /O2 /I "d:\program files\microsoft visual studio\vc98\include\sdk\multiplayer\common" /I "d:\program files\microsoft visual studio\vc98\include\sdk\multiplayer\engine" /I "d:\program files\microsoft visual studio\vc98\include\sdk\multiplayer\dlls" /I "d:\program files\microsoft visual studio\vc98\include\sdk\multiplayer\pm_shared" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "METAMOD_EXPORTS" /Fp"release/metamod.pch" /YX /Fo"release/" /Fd"release/" /FD /c

does the "/I" mean include?
what is the difference between [project/settings/c++ tab/Project Options] and [tools/options/directories]?

botman 13-04-2004 02:00

Re: command line compile
 
Yes, "/I" means "use this directory when searching for include files".

The Half-Life SDK includes a .h file called "util.h". There is also a "util.h" in the MSVC standard includes. What's probably happening is that the MSVC version of util.h is being included instead of the Half-Life SDK one.

Why did you install the Half-Life SDK in "program files\microsoft visual studio\vc98\include" anyway?

I would recommend you remove it from there and install it someplace separate (perhaps in "D:\Half-Life SDK"), then change your /I include list to look something like this...
Code:

/I "D:\Half-Life SDK\sdk\multiplayer\common"
/I "D:\Half-Life SDK\sdk\multiplayer\engine"
/I "D:\Half-Life SDK\sdk\multiplayer\dlls"
/I "D:\Half-Life SDK\sdk\multiplayer\pm_shared"
/I "D:\program files\microsoft visual studio\vc98\include"
/D "WIN32" /D "NDEBUG" /D "_WINDOWS"...

botman

dead bwoy 13-04-2004 08:01

Re: command line compile
 
Code:

void *mm_PvAllocEntPrivateData(edict_t *pEdict, int cb) {
META_ENGINE_HANDLE(void *, NULL, FN_PVALLOCENTPRIVATEDATA, pfnPvAllocEntPrivateData, (pEdict, cb));
RETURN_API()
}


line of error:
Code:

META_ENGINE_HANDLE(void *, NULL, FN_PVALLOCENTPRIVATEDATA, pfnPvAllocEntPrivateData, (pEdict, cb));
D:\Projects\metamod-1.17\metamod\engine_api.cpp(391) : error C2440: '=' : cannot convert from 'void *(__cdecl *)(struct edict_s *,__int32)' to 'void *(__cdecl *)(struct edict_s *,int)'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast

after downloading the sdk and metamod source from the new filebase.

botman 13-04-2004 15:18

Re: command line compile
 
It appears that the metamod .h files have __int32 defined as the 'int' type. Perhaps this was for Linux compatibility. Try searching the metamod .h files for '__int32' and replacing it with 'int'.

botman

dead bwoy 14-04-2004 00:51

Re: command line compile
 
i have searched the .h files and have not found __int32 yet. i have found plenty of "int"s. do you know which files i should check? I'll check again...

botman 14-04-2004 14:53

Re: command line compile
 
I saw this over on hlpd about error C2440...

http://dynamic5.gamespy.com/~hlpd/index.pl/Eiface.H

(scroll to the bottom of that page)

Value used 'long' in places where 'uint32' should have been used. The metamod code may have the same problems. See the changes that SavannahLion recommended as an example.

botman

Pierre-Marie Baty 14-04-2004 15:54

Re: command line compile
 
Else if you want to get yourself started with a SDK + metamod + bot kit that compiles straight out of the box, go to the filebase and download the "POD-bot SDK". I've packaged the Bots United SDK with the updated metamod source code that we use, and there's the pod-bot source code as well. ALL of them compile fine, straight out of the box, directly in Windows (MSVC 6) and Linux (GCC 2.95.3). You don't even need to adapt the include paths if you keep the directory structure.

dead bwoy 14-04-2004 19:43

Re: command line compile
 
will it work if i just use the sdk and metamod parts, excluding the bot source?

MusicMan 14-04-2004 19:51

Re: command line compile
 
if I want to learn the sdk. I mean only what is needed to learn about it for making a bot, is the podbot sdk fine for me?

MusicMan

Pierre-Marie Baty 14-04-2004 22:46

Re: command line compile
 
Of course...

You've got the full metamod source code and the full multiplayer SDK (although you haven't the single player one).

This is enough to develop any metamod plugin you want, or even to develop a new multiplayer MOD if you want. :)

MusicMan 15-04-2004 14:37

Re: command line compile
 
ok, thanks alot PMB;)

MusicMan

Onno Kreuzinger 15-04-2004 15:51

Re: command line compile
 
*g* PMB you know that we now have two starter kit's in the filebase:
http://filebase.bots-united.com/pafi...ion=file&id=13
and
http://filebase.bots-united.com/pafi...ion=file&id=40

who will get the most downloads *g*

sparky99 14-10-2012 06:09

Re: command line compile
 
Had this same issue, it was a mismatch between code using SDK 1990 and the newer base SDK p-3. In my case the supplied code containing an old Cbase.cpp was causing the problem.


All times are GMT +2. The time now is 04:44.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.