.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Programming (http://forums.bots-united.com/forumdisplay.php?f=25)
-   -   visual C++ 6.0 metamod compile question (http://forums.bots-united.com/showthread.php?t=934)

cruft 28-02-2004 09:31

visual C++ 6.0 metamod compile question
 
Does anyone have step-by-step instructions on how to setup visual c++ 6.0 to compile a metamod dll? I've been playing with it for while without any luck. The problem isn't compiling. I'm able to compile the dll without any errors. The problem is that metamod doesn't load the resulting dll.

I should also mention that I've been compiling the same source with the free borland c++ compiler without any metamod loading issues. For the borland compile, I have to use a .def file for it to work correctly. I also tried a .def file with visual c++ and didn't have any luck there either.

Pierre-Marie Baty 28-02-2004 16:20

Re: visual C++ 6.0 metamod compile question
 
Strange...
Is it really your compiler's configuration ?
I assume you're talking about compiling metamod plugins, not metamod itself.
Have you tried recompiling a metamod plugin of which you have the source code ?

Austin 29-02-2004 10:24

Re: visual C++ 6.0 metamod compile question
 
You for sure need a def file or Metamod will not load the dll since the dll will not have any exports.

Here is an example Metamod def file of mine "hostageFix.def"

LIBRARY hostageFix_mm
EXPORTS
GiveFnptrsToDll @1
SECTIONS
.data READ WRITE

For Vc 6.0 you will also need a /def:"hostageFix.def"
in the link options in the project settings.

I had this exact same problem the first time I tried to make a mm dll.

If you still can't get it working download this small mm project to see how everything is set up. You will obviously have to change the include paths in this project. All it does is keep hostages from taking damage to fix the pod bot 2.5 crash.

http://austinbots.com/hostagefixsource.zip

It has project files for both VC60 and VC.NET
It also shows a nice organized way is setting up a Metamod project separating your functions from the Metamod required stuff and correctly using a common include file. This MIGHT be a little over kill for a tiny project but it really help on larger projects.

This project also shows you how to add a VERSION RESOURCE to your dll so you can right click it, do a properties, go to version and see what version it is!

HELLO!
Any BOT authors listening?
VERSION STAMP YOUR DLLS!
WHAT A NOVEL IDEA!

cruft 29-02-2004 20:53

Re: visual C++ 6.0 metamod compile question
 
Thanks for the tips. There were 2 problems that prevented me from getting a metamod loadable .dll 1) my .def file was incorrect - I was using the .def file from my borland c++ compile and it's different for visual c++, and 2) I needed to add the /def option you mentioned for the .def file to take effect. End result is now metmod loads the .dll. w00t!!

Pierre-Marie Baty 01-03-2004 00:26

Re: visual C++ 6.0 metamod compile question
 
Quote:

Originally Posted by Austin
HELLO!
Any BOT authors listening?
VERSION STAMP YOUR DLLS!
WHAT A NOVEL IDEA!

I hear you Austin, I hear you :)
However this win32-specific version stuff does not suit the version convention scheme I'd like to use. I version stamp most of my files under the form YYYYMMDD[-b] for year, month, day and (optionally) build, such as "version 20040229-2", which tells me the file was the second release built on february 29, 2004. Windows, on the other hand, wants me to version stamp my files like "1.0.0.1" or so. It doesn't represent anything for me... :(

If you tell me I can keep my version convention scheme with the Windows version stamp resource, I'll add this version stamp resource right away to all of my projects, I swear !

Austin 01-03-2004 06:04

Re: visual C++ 6.0 metamod compile question
 
Quote:

Originally Posted by Pierre-Marie Baty
I hear you Austin, I hear you :)
However this win32-specific version stuff does not suit the version convention scheme I'd like to use. I version stamp most of my files under the form YYYYMMDD[-b] for year, month, day and (optionally) build, such as "version 20040229-2", which tells me the file was the second release built on february 29, 2004. Windows, on the other hand, wants me to version stamp my files like "1.0.0.1" or so. It doesn't represent anything for me... :(

If you tell me I can keep my version convention scheme with the Windows version stamp resource, I'll add this version stamp resource right away to all of my projects, I swear !

PM, I woudl say this fits in almost exactly with what you described.
http://austinbots.com/version.jpg


The only downside is you can't have leading 0's,
otherwise it is exactly what you wanted but with "."

AND you COULD use the file and product version anyway you want to since it is free text.

I agree the version resource, like SOOO MANNY things was totally duffed by
the V-O-L-E. (the inq.'s (http://www.theinquirer.net) pet name for MS. Look up vole at dictionary.com! ahaha! )

Yes, tell me why few if any ms executables follow this 1.1.1.1 ridiculous scheme, but their development tools seem to force this on us.


BUT, I believe ANY version stamping is better than NONE even 1.1.1.1.

I believe totally in the simple major.minor version scheme.
This is easy for the end users to deal with, the whole point.
The version isn't for developers. We should have build numbers internally that we use.


For a professional product you SHOULDN'T have a bunch of releases!
(Steam for example. What a mess... sorry to say…)

Pierre-Marie Baty 01-03-2004 09:56

Re: visual C++ 6.0 metamod compile question
 
Thanks a lot for the info !

Do you know if it is possible to have these resource strings reference variables ?
So far I use a function which generates the file version number at startup from the __DATE__ preprocessor macro and puts it in a string. I'd like this string to be tied at run-time to the FileVersion resource string if this is possible. Do you have an idea ?

Austin 01-03-2004 10:45

Re: visual C++ 6.0 metamod compile question
 
You can hack the .rc file directly.
VC doesn't load it until you open it in the resource editor.
So you could write a script that opens it, writes out the new version when your project is opened.

I saw an example on how to implement an auto build version incrementor at either
http://www.devguru.com
or
http://www.codeguru.com
a long time ago..

Pierre-Marie Baty 02-03-2004 01:12

Re: visual C++ 6.0 metamod compile question
 
missed!
it's http://www.codeproject.com
:D

http://www.codeproject.com/macro/autobuild.asp
thanks anyway :)

Austin 02-03-2004 02:24

Re: visual C++ 6.0 metamod compile question
 
I forgot about codeproject.
I have been looking at that site. Nice site.
Nice method for auto build numbers.
I think I will start using it, thanks!


All times are GMT +2. The time now is 06:16.

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