Visual Studio 2005 C++ Express

Started by
5 comments, last by zlatko_bre_1985 18 years, 5 months ago
//EDITED (DELETED) TO REMOVE UNNEDDED INFORMATION I have just downloaded VS 2005 E. I have set various inc and lib directories but still i have problem.Read the next post. Thx [Edited by - zlatko_bre_1985 on November 21, 2005 10:56:12 AM]
Serbia,Zrenjanin
Advertisement
I have simplified the problem to the :

#include <Windows.h>
#include <string>
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
{
std::wstring aaa;
aaa = L"agdf";
};

and compiler gives this

Compiling...Main.cppLinking...Main.obj : error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __ehhandler$?_Copy@?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@IAEXII@ZC:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\Retribution\Debug\Z_Engine.exe : fatal error LNK1120: 1 unresolved externals
Serbia,Zrenjanin
Hmm, seems like you forgot to do an extra step. Did you also do this?:

Quote:
::link::
Update the corewin_express.vsprops file.

One more step is needed to make the Win32 template work in Visual C++ Express. You need to edit the corewin_express.vsprops file (found in C:\Program Files\Microsoft Visual Studio 8\VC\VCProjectDefaults) and

Change the string that reads:

AdditionalDependencies="kernel32.lib" to

AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"


Also: This part:
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )


should instead be:
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR szCmdLine, INT iCmdShow )
... no?

xeddiex
one..
While I don't have VC 2005 express installed, I can tell you that this error is a result of you using a function which requires exception handling enabled and the appropriate libraries linked in.

Check the project properties and turn on exception handling if possible, and ensure that you're linking against the msvcrt runtime library somewhere along the way.

Ignore the WinMain thing, the prototype is still correct.

Jans.
I'm sorry but, WinMain has a body. That makes it a function, not a function prototype. Or am I wrong here?
one..
Quote:Original post by xeddiex
I'm sorry but, WinMain has a body. That makes it a function, not a function prototype. Or am I wrong here?


He isn't specifying a prototype. You don't have to provide variable names for parameters if you're not going to use them. Hell, he could have done this:
INT WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, INT){    std::cout << "Witness my 1337 unnamed parameters!";}
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
I am currently off home (obtaining driver license :) ) so i cannot check what have you said xeddiex but ill post is it working. But i think it should work cause i didnt do that step . :)

Thx everyone!!!!
Serbia,Zrenjanin

This topic is closed to new replies.

Advertisement