Getting a compile error on MQ2Main in EQClasses.cpp

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

Moderator: MacroQuest Developers

spat
a lesser mummy
a lesser mummy
Posts: 38
Joined: Wed Feb 15, 2006 1:20 am

Getting a compile error on MQ2Main in EQClasses.cpp

Post by spat » Wed Feb 15, 2006 1:32 am

http://www.macroquest2.com/wiki/index.p ... leshooting


when i try and complile MQ2Mail i get this error

Code: Select all

1>.\EQClasses.cpp(128) : error C3068: 'EQClasses::CStmlWnd::AppendSTML' : a 'naked' function cannot contain objects that would require unwinding if a C++ exception occurred
Im trying to figure out how to either 1) make Visual studio express ignore this or fix this error...

I get this in about 7 different places in EQClasses.cpp

one Example is:

Code: Select all

FUNCTION_AT_ADDRESS(class CXSize& CStmlWnd::AppendSTML(class CXSize*,class CXStr),CStmlWnd__AppendSTML);
Thanks for those who can spend the time and help me with this,

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 » Wed Feb 15, 2006 2:47 am

A/S/L?

spat
a lesser mummy
a lesser mummy
Posts: 38
Joined: Wed Feb 15, 2006 1:20 am

Post by spat » Wed Feb 15, 2006 3:14 pm

lol,

I think its just the visual studio express compiler beeing too strict.

Im 22, I usedto study computer science in college, but now im in the military studying russian, so i preaty much forgot all of my coding =/ Tried to figure out what the hell the compiler was bitching about in that line. Searched the vs help database and it gave a couple of solutions, none of wich i could implement on my own....

I am using the microsoft PSDK-x86 api and the Visual C++ Express edition that was linked to from wiki...

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 » Wed Feb 15, 2006 4:32 pm

That error is caused by you either changing something that should not be changed or making your own project file with incorrect options. You need to turn off exception handling...

spat
a lesser mummy
a lesser mummy
Posts: 38
Joined: Wed Feb 15, 2006 1:20 am

Post by spat » Wed Feb 15, 2006 4:45 pm

This is what i have done thus far:

I unziped the zip file from the site into its on directory, retaining the directory structure etc.

Then I double click the macroquest.dsw and it loads visual c++ express and asks me to convert the project, i click yes and atempt to compile and bam get that error. I have been searching in Visual C++ express where i can turn off exceptions etc and just make it build it regardless of what it thinks is incorrect.

I will atempt to load up the .dsw, when i get off of work, w/o converting it to the Visual c++ express format and see if it lets me compile, and continue to search for where i can turn off exception handeling. The only thing i have found thus far is where i can tell the compiler to ignore warnings, not errors =/

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Wed Feb 15, 2006 4:57 pm

I am fairly sure that the dsw file is for VC6. You should be using the sln for VC2005. Though, that may not make a difference on any of your problems.
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

spat
a lesser mummy
a lesser mummy
Posts: 38
Joined: Wed Feb 15, 2006 1:20 am

Post by spat » Wed Feb 15, 2006 7:08 pm

loading the solution file rather than the workspace fixed that problem. now i am hung up on:

Code: Select all

1>   Creating library ..\Release/MQ2Main.lib and object ..\Release/MQ2Main.exp
1>MQ2Auth.obj : error LNK2019: unresolved external symbol __imp__CallNextHookEx@16 referenced in function "long __stdcall proc(int,unsigned int,long)" (?proc@@YGJHIJ@Z)
1>MQ2Main.obj : error LNK2001: unresolved external symbol __imp__CallNextHookEx@16
1>MQ2Commands.obj : error LNK2019: unresolved external symbol __imp__ShellExecuteA@24 referenced in function _Exec
1>MQ2DetourAPI.obj : error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl CrashDetected_Detour(unsigned long,unsigned long,unsigned long,unsigned long,unsigned long)" (?CrashDetected_Detour@@YAXKKKKK@Z)
1>MQ2Main.obj : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
1>MQ2Utilities.obj : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
1>MQ2Main.obj : error LNK2019: unresolved external symbol __imp__SetWindowsHookExA@16 referenced in function "void __cdecl InjectEnable(void)" (?InjectEnable@@YAXXZ)
1>MQ2Main.obj : error LNK2019: unresolved external symbol __imp__UnhookWindowsHookEx@4 referenced in function "void __cdecl InjectDisable(void)" (?InjectDisable@@YAXXZ)
1>..\Release/MQ2Main.dll : fatal error LNK1120: 5 unresolved externals
http://www.macroquest2.com/wiki/index.p ... leshooting

According to Wiki its probably that my windows.h lacks some lines, so i am in the process of re downloading the PSDK (using the direct links to the cabs from wiki) hopefully i can have that all downloaded by tonight, and have another run at the compile. (I tried re-dling the .zip and using winzip to unzip rather than windows, still get the same error. Guessing i have an old version of windows.h or something)

User avatar
fearless
Not a Psychic
Posts: 2684
Joined: Wed Mar 10, 2004 3:52 pm

Post by fearless » Wed Feb 15, 2006 8:21 pm

yes, those are usually tied to the sdk's being installed incorrectly or are too old.
Reading . . . it's not just for me.

[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
[quote="Ccomp5950"]Fearless showed me the light, you too shall learn.[/quote]

bardomatic
a ghoul
a ghoul
Posts: 131
Joined: Thu Apr 29, 2004 12:09 am

Post by bardomatic » Wed Feb 15, 2006 8:24 pm

Follow the instructions here:
http://msdn.microsoft.com/vstudio/expre ... usingpsdk/

Take special note of step 4.

spat
a lesser mummy
a lesser mummy
Posts: 38
Joined: Wed Feb 15, 2006 1:20 am

Post by spat » Wed Feb 15, 2006 9:59 pm

Hot!

Thank you much. =)

bwishardcore
decaying skeleton
decaying skeleton
Posts: 3
Joined: Mon Feb 20, 2006 12:22 pm

Post by bwishardcore » Mon Feb 20, 2006 7:28 pm

I got this error and I did the things that bardomatic did. I also tried loading what I thought was the solution file (ISXEQ.sln) but that was only after trieng macroquest2.sln and macroquest2.dsw.

I'm also continueing to find where to turn off exception handling but any help would be appreciated.


Im using the Visual C++ Express with the SDKs.

Thanks guys

bardomatic
a ghoul
a ghoul
Posts: 131
Joined: Thu Apr 29, 2004 12:09 am

Post by bardomatic » Mon Feb 20, 2006 8:34 pm

if what I suggested doesn't work then all you need to do is delete your macroquest folder. Macroquest compiles fine right from the zip with properly installed software.

bwishardcore
decaying skeleton
decaying skeleton
Posts: 3
Joined: Mon Feb 20, 2006 12:22 pm

Post by bwishardcore » Mon Feb 20, 2006 9:00 pm

Ok one quick question - I downloaded the Visual Studio express 2005 off of microsoft.com. Is that compiler capable of Compiling MQ2?

I am currently working on setting up the free enviroment for compiling as explained on Wiki. I am decently computer literate but this is proving a challenge to me but Im starting from scratch and am determined to figure this out.

However, if the express version will work then I will continue to try and figure it out using that.

f
Last edited by bwishardcore on Mon Feb 20, 2006 9:19 pm, edited 1 time in total.

rapierguy
a ghoul
a ghoul
Posts: 122
Joined: Thu Apr 14, 2005 1:07 am

Post by rapierguy » Mon Feb 20, 2006 9:09 pm

If I remembert correctly there is a link somewhere on the boards about being able to compile with VS2005 Express. I forget where but I do remember seeing it. Don't have time to check for it since I'm late for a guild raid

bwishardcore
decaying skeleton
decaying skeleton
Posts: 3
Joined: Mon Feb 20, 2006 12:22 pm

Post by bwishardcore » Mon Feb 20, 2006 9:10 pm

I figured it out!

Even though it is cake for you guys I feel a sense of accomplishment lol!

Next step learning C++ and writing macros :D