Gammon Forum
Entire forum
MUSHclient
Development
Compiling mushclient from source.
Compiling mushclient from source.
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Pages: 1
2 3
4
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #15 on Sun 26 Jul 2009 06:05 AM (UTC) |
Message
|
Quote:
VS2005 can't convert the workspace file to the newer version ...
I wouldn't worry about that too much. Basically you could make a new project and just import into it all the .cpp files (and .c files) you can find. If you want to be a bit more controlled about it, edit the mushclient.dsp file, and look through that. It basically just gives you a list, like this:
SOURCE=.\accelerators.cpp
# End Source File
# Begin Source File
SOURCE=.\ActivityDoc.cpp
# End Source File
# Begin Source File
SOURCE=.\ansi.cpp
Then try to compile. ;)
You will probably get a few errors, you just have to sort those out.
As for why, I have tried to get off the Microsoft treadmill of buying the latest, greatest product, and then in 5 years having to buy a completely new one that I have to learn, and discard most of what I learnt in the previous 5 years (for example, XP and Vista).
This one works, it is cheap to not upgrade, what is the problem?
I think a while ago someone reported minor issues with compiling under .net, so I changed a few spots to make it compile under that, but still also compile for me. I don't mind doing that again, if you have some minor syntax issues, that I can change and be compatible for both me, and future versions.
After all, C++ is a standard, it shouldn't be too hard to keep it compatible.
The issue of the dll is interesting. It is possible that if I upgraded my own compiler, this might make MUSHclient incompatible with people who are using older systems. This is one reason to not change. I can see for myself that the current releases work under 98/2000/XP/Vista, so that is a pretty good compatibility.
The recent issue I raised about Vista problems is more an installer or design issue, not a compiler one.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #16 on Sun 26 Jul 2009 06:21 AM (UTC) |
Message
| Hmm, alright, I will try that. Thanks Nick.
I recently read this article though, which is why I'm not such a fan of VS6: http://www.jasonbadams.net/20090119/why-you-shouldnt-use-vc6/
Also, I looked this up, and it seems like less than 0.5% people still use Windows 95: http://www.w3schools.com/browsers/browsers_os.asp
As for "buying the latest thing", there's Express versions of Visual Studio, which while lacking in-built resource editing and perhaps other things I haven't noticed, are perfectly valid for writing programs with. I completely understand the compiler difference though, barring the OS link I posted above. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #17 on Sun 26 Jul 2009 07:45 AM (UTC) |
Message
|
Quote:
I recently read this article though, which is why I'm not such a fan of VS6 ...
They make very valid points, however that doesn't, in this case, impact on the result. Various things about STL don't work correctly, however I avoid those.
Quote:
there's Express versions of Visual Studio
I downloaded that, however it doesn't come with MFC, so I can't compile MUSHclient under that. It is an example of Microsoft locking you in with a proprietary product. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #18 on Sun 26 Jul 2009 08:54 PM (UTC) |
Message
| Ah, that really stinks. I did some research to see if MFC could be gotten separately, but... nope. =/
I've begun my attempt to compile MUSHclient under VS2005. If nobody minds I'd like to chronicle any obstacles I come across here, or in another thread if Nick doesn't mind.
So far I've got the source downloaded, and I'm working through the heap of warnings/errors. I managed to convert the VS6 project file (I had tried the workspace file unsuccessfully), which gave me a nice start. Unfortunately, I get a lot of errors about files that don't include stdafx.h, so I'm going through and changing the settings for those files (to Do Not Use Precompiled Header).
At first it also complained about not finding the precompiled header, so I had to change it in the project settings to Create it instead of Use it (/Yu to /Yc).
I also had to define LUA51 as a command line option (/D "LUA51") for the correct #include directives to fire.
The zlib headers were missing in the source package, so they had to be downloaded and placed one directory up (in the solution directory rather than the project directory). The DLL is already provided however, so I just needed the includes.
I'll update as I make progress, either here or in another thread as appropriate. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #19 on Sun 26 Jul 2009 09:40 PM (UTC) Amended on Sun 26 Jul 2009 09:42 PM (UTC) by Twisol
|
Message
| I've cleared out all the initial errors, including a problem with ucptable.c. It complained both about the 'cnode' type and 'too many initializers'; to solve the latter, I set it to compile that file as C++ instead of C. It seems like ucptable.c is meant to be more of a header, because another file includes it (and I assume that previous headers in that file define 'cnode'), so I set ucptable.c to simply not be built.
Now I have two main errors that have cropped up. One is an error from MUSHclient.h, saying it can't find <codecs.h>. I assume I either don't have the file, or I do and it's just not in my path.
The other error is about a cast a macro seems to make, and I'm not sure how to go about fixing it:
statlink.cpp(28) : error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CStaticLink::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'
Cast from base to derived requires dynamic_cast or static_cast
EDIT: Oh, and I just read something earlier, and I wanted to respond to you here:
Quote: After all, C++ is a standard, it shouldn't be too hard to keep it compatible
Apparently, VS6 predates the standard. *shrug* |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #20 on Sun 26 Jul 2009 10:44 PM (UTC) Amended on Sun 26 Jul 2009 10:45 PM (UTC) by Nick Gammon
|
Message
| ucptable.c doesn't seem to be in the project.
The files mentioned in the mushclient.dsp file with a /Yu flag will not be using precompiled headers. Generally speaking these will be the .c files. Also generally speaking these will be "external" stuff (eg. PCRE, SQLite, zLib and so on) because they won't be using the precompiled headers (which themselves are in stdafx.h) with MUSHclient-specific stuff in them.
Quote:
The other error is about a cast a macro seems to make, and I'm not sure how to go about fixing it:
That looks similar to something on this page:
http://www.gammon.com.au/forum/?id=7755
Not too sure what to suggest as it compiles for me. Maybe change it to:
LRESULT CStaticLink::CtlColor(CDC* pDC, UINT nCtlColor)
{
ASSERT(nCtlColor == CTLCOLOR_STATIC);
DWORD dwStyle = GetStyle();
HBRUSH hbr = NULL;
if ((dwStyle & 0xFF) <= SS_RIGHT) {
// this is a text control: set up font and colors
if (!(HFONT)m_font) {
// first time init: create font
LOGFONT lf;
GetFont()->GetObject(sizeof(lf), &lf);
lf.lfUnderline = TRUE;
m_font.CreateFontIndirect(&lf);
}
// use underline font and visited/unvisited colors
pDC->SelectObject(&m_font);
pDC->SetTextColor(m_color);
pDC->SetBkMode(TRANSPARENT);
// return hollow brush to preserve parent background color
hbr = (HBRUSH)::GetStockObject(HOLLOW_BRUSH);
}
return (LRESULT) hbr;
}
... and change the function prototype in StatLink.h to:
afx_msg LRESULT CtlColor(CDC* pDC, UINT nCtlColor);
Let me know if that works.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #21 on Sun 26 Jul 2009 10:52 PM (UTC) |
Message
|
Quote:
Apparently, VS6 predates the standard. *shrug*
I should have known better than to mentally link "Microsoft" and "standard". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #22 on Sun 26 Jul 2009 10:56 PM (UTC) Amended on Sun 26 Jul 2009 10:57 PM (UTC) by Nick Gammon
|
Message
|
Quote:
One is an error from MUSHclient.h, saying it can't find <codecs.h>.
I can't find any references to codecs.h in MUSHclient.h.
I have such a file in the \Program Files\Microsoft Visual Studio\VC98\Include directory. Not sure why it is being included. Can you work out which file is requiring it? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #23 on Sun 26 Jul 2009 11:03 PM (UTC) |
Message
| On MS standards: *lol*
On codecs.h: Odd, the #include shows up for me on line 18. If I comment it out, I get the same error for dsound.h. If I comment that out, I get lots of errors about dsound-related nonexistent identifiers. Where can I get that codex.h and dsound.h that you have?
On the cast errors: I fixed it by changing OnNcHitTest (NOT CtlColor) to return LRESULT, and casted its return value for the same. Thanks for the pointer though, it set me on the right track. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #24 on Sun 26 Jul 2009 11:09 PM (UTC) Amended on Sun 26 Jul 2009 11:10 PM (UTC) by Nick Gammon
|
Message
| Looks like I removed #include <codecs.h> from recent versions. Must have been not needed.
As for dsound.h that is also in the \Program Files\Microsoft Visual Studio\VC98\Include directory.
Maybe do some sort of optional install for Direct Sound (or DirectX) headers? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #25 on Sun 26 Jul 2009 11:13 PM (UTC) |
Message
| Hmm, looks like I may need to download the DirectX SDK. I'll grab it and see how that goes. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #26 on Mon 27 Jul 2009 03:53 AM (UTC) Amended on Mon 27 Jul 2009 04:07 AM (UTC) by Twisol
|
Message
| I installed the DirectX SDK (March 2009) and updated Visual Studio's paths, clearing up that particular issue. I've made lots of progress so far clearing up many errors and warnings (and cataloging all of them).
There's three undeclared identifiers I can't seem to clear up though: IDD_GOATS_BLOOD, IDD_SELECT_GLOBAL_CONFIGURATION, and IDC_NEW. By their names I assume they're resource identifiers, but I can't figure out where they're supposed to be included from. Any pointers?
EDIT: I found some *.hm files in the initial download (id.hm, idd.hm, idc.hm, idf.hm), but Visual Studio has no idea what to do with them. I'll try messing with them and see what I can do with them, though, they seem to contain the resource IDs and their numeric codes.
EDIT 2: As my luck would have it, none of those files have the identifiers I'm missing... |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #27 on Mon 27 Jul 2009 04:51 AM (UTC) |
Message
| The .hm files are for the Help Studio thing. That is a separate process to generate a help file, and isn't relevant to getting a MUSHclient.exe.
The Goats Blood is a reference to how to deal with people trying to sell you cleaning products. You ask them: "but, does it get goat's blood out?".
I gather from your second edit that these missing identifiers are not stopping you compile? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|
Posted by
| Twisol
USA (2,257 posts) bio
|
Date
| Reply #28 on Mon 27 Jul 2009 05:41 AM (UTC) |
Message
| No, they are stopping the compile, and my "By their names I assume" comment I meant the IDD_* and IDC_* prefixes, which usually stand for resource identifiers. They're undefined though - something's not being included/compiled, but I've searched through everything with no luck.
My second edit referred to my terrible luck. ;) The goats blood thing is funny though :D |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
Posted by
| Nick Gammon
Australia (22,975 posts) bio
Forum Administrator |
Date
| Reply #29 on Mon 27 Jul 2009 06:29 AM (UTC) Amended on Mon 27 Jul 2009 06:31 AM (UTC) by Nick Gammon
|
Message
|
enum { IDD = IDD_GOATS_BLOOD };
That is in EasterEggDlg.h, which is included from EasterEggDlg.cpp.
However EasterEggDlg.cpp isn't in the project. Just remove it (there is a reference to it which is commented out).
I can't find IDD_SELECT_GLOBAL_CONFIGURATION anywhere in my source directory. Where did you find it? Ditto for IDC_NEW.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | 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.
139,214 views.
This is page 2, subject is 4 pages long:
1
2 3
4
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.