Compiling Older Versions of MQ2 (error C3068)

Need help running MacroQuest2? Ask your questions about how to get things to work on your computer.

Moderator: MacroQuest Developers

d00d
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun Feb 04, 2007 12:42 am

Compiling Older Versions of MQ2 (error C3068)

Post by d00d » Sun Feb 04, 2007 2:12 am

In the secion under "error C3068: : a 'naked' function cannot contain objects that would require unwinding if a C++ exception occurred", on this page, I added the following line:
This is almost always caused by clicking macroquest2.dsw file instead of the MacroQuest2.sln when using Visual C++ 2005 Express Edition as their compiler.
First, I have searched exhaustively everywhere I can think of, and I have not found a fix for this yet. I am able to compile the latest version of MQ2 (MQ2-20070118.zip) perfectly, but for some reason I get an error on versions from around Nov 2005. So far, I have tried MQ2-20051101.zip, MQ2-20051116.zip, MQ2-20051118.zip adn MQ2-20051128.zip, and all of them fail at the same point.

I am following the compile intructions word-for-word on the Wiki and as I said, I can compile the latest version 100% of the way through and I can run it fine. The problem is that I am trying to get MQ2 working for fresh (non-patched) Titanium installs to work with EQEmu. And the recent versions don't work at all with the older client.

I am not 100% sure which version of MQ2 I should use, because the windbg command doesn't work right for me, so I cannot tell the exact version of my eqgame.exe. I am guessing and going to try all of the MQ2 builds from around Nov 2005, because that is what the eqgame.exe and eqnews.txt have set as their modified dates. I am using the old versions of MQ2 from this page, which I think has every build, so one of them is bound to work. The problem is that none around that time period will compile for me.

Here is the error I get:
EQClasses.cpp
.\EQClasses.cpp(129) : error C3068: 'EQClasses::CStmlWnd::AppendSTML' : a 'naked' function cannot contain objects that would require unwinding if a C++ exception occurred
Build log was saved at "file://c:\Unzipped\MQ2\MQ2Main\Intermediate\BuildLog.htm"
MQ2Main - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I know this is a common error and in most cases is caused by clicking macroquest2.dsw file instead of the MacroQuest2.sln when using Visual C++ 2005 Express Edition as their compiler (as I updated in the wiki). I am running Visual C++ 2005 Express Edition and Microsoft Platform SDK to compile and I am clicking the right project file (MacroQuest2.sln). As I already said, the intructions work perfectly for me with the latest MQ2 version, just not with these older versions. And, I am deleting the directory and making a new one each time I try to compile a different version.

I am out of ideas of how to get this working. Are the older MQ2 versions just not compatible with Visual C++ 2005 Express Edition? Or, is there a different set of compile instructions somewhere other than the wiki that has steps for the older MQ2 version? Or, maybe I just need to tweak a setting in Visual C++ 2005 Express Edition to stop it from dying at that part?

Thanks in Advance for any help. It is much appreciated. If I get a good answer that resolves my problem, I will make sure to update the Wiki with the new information.

Teh D00d

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sun Feb 04, 2007 2:18 am


d00d
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun Feb 04, 2007 12:42 am

Post by d00d » Sun Feb 04, 2007 2:26 am

Thanks for the quick response, but I am not compiler savvy enough to know what that link is telling me to do.

I don't understand why it works 100% for the latest MQ2 release, but does not work for the Nov 2005 versions. I am using the exact same settings, which means that the instructions should be different for the older ones. My question is to find exactly what I need to do.

I have seen this link referenced over and over in regards to 3068, but I don't know how it applies. I know in previous references, they were referring to this excerpt from the page:
*Do not create a temporary object in the function.

If a function creates a temporary object on the stack, if the function throws an exception, and if C++ exception handling is enabled, the compiler will clean up the stack if an exception is thrown.
And if that is what you are referring to, how does that apply to my problem? I didn't build the compile, I just followed the intructions word-for-word. Something is different between how the builds are being done in the older and newer versions, but I don't know what that is. Can you spell it out, please? Or PM me if you can't post that kind of stuff?

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sun Feb 04, 2007 2:38 am

You have to turn off the /EHsc flags to the compiler. I don't know how to do it on MSs' GUI because frankly, VS sucks. I bet google knows.

d00d
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sun Feb 04, 2007 12:42 am

Post by d00d » Sun Feb 04, 2007 2:49 am

I finally found this page after searching for a long time. And here is the section of that page that told me where to look for changing the /EHsc (exception handling) option to off:
Set the compiler options so they look like this: /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "PINVOKELIB_EXPORTS" /D "_WINDLL" /D "_MBCS" /FD /EHsc /RTC1 /MTd /Yc"stdafx.h" /Fp".\Debug/PinvokeLib.pch" /Fo".\Debug/" /Fd".\Debug/" /W3 /nologo /c /Gz /TP. To do this, edit the Property Pages for the project. Go through each of the C/C++ subcategories and set the options to get exactly this command line listed in the "Command Line" subcategory. skoolLIB.vcproj has these settings already, if you want to copy from there. This seems to do a whole bunch of things, including generating precompiled headers and a dll.
Here are the exact instructions for the future:

1. Under the Solution Explorer right click MQ2Main and select Properties.
2. Expand Configuration Properties if it isn't already expanded by clicking the + sign to the left of it. Then, expand C/C++ and select Code Generation.
3. Last, look at the line on the right side of that window that says Enable C++ Exceptions and if it is set to Yes (/EHsc), click that dropdown box and select No, and then click OK.

You can now run your compile like normal.

I hope this saves someone hours and hours of work, like it would have for me :P I have added this to the Wiki.

For anyone who wants to know, it turns out that the MQ2-20051101.zip file is the correct build to use with EQEmu 0.7.0 Servers.
Last edited by d00d on Sun Feb 04, 2007 5:12 pm, edited 2 times in total.

User avatar
dont_know_at_all
Developer
Developer
Posts: 5450
Joined: Sun Dec 01, 2002 4:15 am
Location: Florida, USA
Contact:

Post by dont_know_at_all » Sun Feb 04, 2007 12:52 pm

Thanks. I am stickying this.

madborg
decaying skeleton
decaying skeleton
Posts: 7
Joined: Sun Jul 29, 2007 6:55 pm

Post by madborg » Sun Jul 29, 2007 7:08 pm

first of all thanks for this whole topic because i needed this information for my part in what i do with myy own eqemu server. apparently someone on the eqemu project didnt like that i posted the link to the the zip file and the compiler fix for the titanium compatible MQ2. that is unfortunate becuase for the little that i have used MQ2, i have seen a lot of potential for using it for testing.

i admit i did ask in the eqemu developer forum (3rd party tools) if anyone had a titanium compatible MQ2. i didnt want any compiled version - i wanted a compilable zip file like i have for the current live version and like the one i got from the MQ2 archive itself.

for the little that i have used MQ2 with live i feel it is a great project. so thanks again for keeping the older versions around and for providing this information here and the wiki.

rich007
decaying skeleton
decaying skeleton
Posts: 3
Joined: Mon Jan 14, 2008 1:24 pm

Post by rich007 » Tue Jan 22, 2008 4:10 pm

which version of MQ worked for you with unpatched Titanium?
Thanks


edit update I believe MQ2-20051101.zip works at least it loads with unpatched Titanium, and does not seem to conflict with new WinEQ 2.15 Pro, or my little emu server.

Though I am totally new to this have tried no macros just a few commands like /target. So can't really say if it is the right version just it loaded. Going to try some bot macros can not wait. If there is another version that is better for Tit. pls inform.

BertoxBoy
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Mar 20, 2005 12:11 am

Post by BertoxBoy » Tue Mar 04, 2008 10:58 pm

Where might I be able to download past versions of MQ2?
EQ

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Post by ieatacid » Tue Mar 04, 2008 11:46 pm

BertoxBoy wrote:Where might I be able to download past versions of MQ2?
www.macroquest2.com/downloads/zips.php

BertoxBoy
a lesser mummy
a lesser mummy
Posts: 30
Joined: Sun Mar 20, 2005 12:11 am

Post by BertoxBoy » Wed Mar 05, 2008 12:03 am

WOW... thank you oh so very much... I am grinning...
EQ

billpal
decaying skeleton
decaying skeleton
Posts: 1
Joined: Sun Mar 07, 2010 2:48 pm

Re: Compiling Older Versions of MQ2 (error C3068)

Post by billpal » Mon Sep 10, 2012 8:01 pm

Is there a working macroquest for the Mac server?