Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ ROM ➜ Compiling the server ➜ Need help porting an old mud to visual studio

Need help porting an old mud to visual studio

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Jparker   (6 posts)  Bio
Date Wed 01 Feb 2006 12:39 AM (UTC)
Message
It's the darndest thing... I have this code for a mud some friends of mine have worked on for some 10+ years. It's a rom derivative. I have a working copy of your rom code that works fine. I've gone down through the differnces list, and it all looks fine.

The one compile error that has me absolutly stumped...

src\merc.h(72): error C2632: 'char' followed by 'bool' is illegal

Under the "#if defined(_AIX)". See, it really bugs me because I have the exact same line of code in the regular rom code, and it compiles without so much as a warning.

I hope you can offer some insight, I haven't been able to figure out why it works for one but not the other. I suspect it may have something to do with the color code loaded into the old mud.

Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Wed 01 Feb 2006 01:01 AM (UTC)
Message
Are both being compiled under Visual Studio? Are both being compiled using the same MSVC compiler mode (i.e. C and C++).

What is probably the case is that one is being compiled using C mode, and the one with the error is being compiled using C++ mode. In C++ it is illegal to have bool after char, because both are built-in, reserved type keywords.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Jparker   (6 posts)  Bio
Date Reply #2 on Wed 01 Feb 2006 01:20 AM (UTC)
Message
The settings should be identical. I took the sln file from the win32 server files provided here, which compile perfectly, and updated it with the differnt .c and .h files.

In theory, they're being compiled identically unless there is a setting I am missing somewhere.
Top

Posted by Jparker   (6 posts)  Bio
Date Reply #3 on Wed 01 Feb 2006 01:51 AM (UTC)
Message
Im begining to think you are right, but I don't suppose that there is a list of VS settings used for the win32 server files to go along with the differences list?
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #4 on Wed 01 Feb 2006 02:47 AM (UTC)
Message
There'd be a number of places to look. For one, in the project settings, you should be able to set the language rules being used. Also, the file extensions are very important, but I suspect that you're using .c and not .cpp, .cx, or .cc.

Another place to look is the individual file compile settings.



Finally, I suggest you try the following. Try putting an "int class" somewhere - for instance, in mud.h right before the problem line, and see if it compiles. If you are using C++, it will fail because class is also a reserved word. If you're using C, it will not fail.

And if none of this works, please post the part from mud.h that's causing the trouble.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Jparker   (6 posts)  Bio
Date Reply #5 on Wed 01 Feb 2006 05:00 AM (UTC)
Message
Ok... I've managed to get further, I believe, with your insights. One more error...

Rom error LNK2019: unresolved external symbol __imp__pthread_create referenced in function _init_descriptor

I believe its the last thing left. I have pthread.h in my include folder, so I'm not sure where to look for this now.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #6 on Wed 01 Feb 2006 05:08 AM (UTC)
Message
You need to have a pthread library linked into your executable. Link errors occur after compilation, so the include files are no longer relevant.

Is pthread support something your friends added?

In any case you'll probably need to get a copy of the pthread library. See: http://sourceware.org/pthreads-win32/

If you don't know how to link stuff in and all that, just let me know and we'll work through it.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Jparker   (6 posts)  Bio
Date Reply #7 on Wed 01 Feb 2006 08:23 PM (UTC)

Amended on Wed 01 Feb 2006 09:03 PM (UTC) by Jparker

Message
/*Well, I got it to get all the way through compiling, but running the program doesn't seem to output anything in the console. Could this be due to the included pthread file, or should i look somewhere else? I checked the windif file several times, so I'm reasonably sure i didnt miss any of that, just looking for leads now. */



Fixed that problem, it actually starts up now! Sorta... Get some bad vnum errors, but Im sure I can weed those out given enough time.

Thanks for the insights.
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #8 on Wed 01 Feb 2006 09:29 PM (UTC)
Message
Glad to hear you've got it all set up and running. Things do sometimes behave oddly on Windows, what with different underlying console models and all that.

Bad vnum errors are also sometimes normal; I know that my MUD barfs a whole bunch out at boot because some areas are loaded before others, but they have cross-references.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Jparker   (6 posts)  Bio
Date Reply #9 on Thu 02 Feb 2006 03:01 AM (UTC)
Message
All right! I got it!

Thank you very much, and thank Gammon for providing me with a site that I've used for quite a while, mucking with rom code.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


26,225 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.