Problem with Visual C++ 2005 Express Edition

I have been programming with VC 6.0 for some time now, and it has worked great.

However, all I hear is that VC 6.0 is a nono now, and I should bump up even to the EE of VC 2005, and well I did.

Now, getting started is horrible, and I hope you guys can help me get it going nicely.

For instance, how do I add libraries to a project Is the only way through the VCProjectDefaults folder

Also, I am learning DirectX better, and I tried transferring code that compiles in VC++ 6.0 (simple code, in fact, the code from the SDK sample for Microsoft) to the new IDE, and it gave me 16 linking errors, so I spent about an hour trying to find out how to do this, and the only way I saw was from the same method to allow the creation of Windows forms, and copied every lib that I had included to the little dependancy, which may or may not have been good.

Now, after that, I have a mere 5 linking errors.

I dont get this at all :( Learning DirectX is a challenge for me already, but when I am basically forced(no more support for VC6.0) to upgrade, and it causes much more problems than it solves, I am in even deeper trouble.

SO, if anyone has any help or anything, please share.

Also, please dont link me to the site that explains how to allow the creation of Windows forms :(

Last thing: Does DirectX code have to be in Windows Form project or Win32 console

If windows form, how do I just make an empty project rather than having to delete the extra stuff I dont want :(

Thanks



Answer this question

Problem with Visual C++ 2005 Express Edition

  • vanilla_gorilla

    Ah, you're completely right.. I should have posted the linker errors:

    1>Main.obj : error LNK2019: unresolved external symbol @_RTC_CheckStackVars@8 referenced in function "long __cdecl InitD3D(struct HWND__ *)" ( InitD3D@@YAJPAUHWND__@@@Z)

    1>Main.obj : error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function "long __cdecl InitD3D(struct HWND__ *)" ( InitD3D@@YAJPAUHWND__@@@Z)

    1>Main.obj : error LNK2001: unresolved external symbol __RTC_Shutdown

    1>Main.obj : error LNK2001: unresolved external symbol __RTC_InitBase

    1>C:\Documents and Settings\Jarrett\My Documents\Visual Studio 2005\Projects\TestClient\Debug\TestClient.exe : fatal error LNK1120: 4 unresolved externals


    And, that is coming from the tutorial code. I am using the CreateDevice sample.

    At first, I copied/pasted the code to a new proiject, got 16 errors, added a few libraries and got 5. Then I tried lookin at the sample project to see what I did wrong, and compiled it, and it got 3 syntax errors.

    The syntax errors were about coverting a string in several things to LPCWSTR, because I guess it wouldnt convert it automatically like it did in VC++ 6.0, so my solution was to paste (LPCWSTR) infront of each string, and then I got these 5 linker errors again.

    I am terribly sorry if that doesnt make sense or I seem rude, its just the most frusterating thing in the world to be wanting to program, but you cant, because the compiler/ide isnt working for yea.. Man I wish this was VC6.0 :(

    Thanks.


  • Alex2200

    First and foremost: It's hard to help without seeing those 5 linker errors !

    Now to answer some questions:

    "For instance, how do I add libraries to a project "

    Go to project properties, configuration properties, linker. In the input field you can add the lib files you need (for example d3d9.lib).

    "Does DirectX code have to be in Windows Form project or Win32 console "

    Depends on what Direct X API you are using. I suppose your are using the C++/COM API so in that case you need a Win32 Project. The EE does not have this type of project but you can use a Win32 Console Application. Go to those Linker options I mentioned above, System page, change SubSystem option to Windows and then delete the _tmain function and add your own code (that should contain a WinMain function).

    Also you should check the samples that ship with Direct X SDK. They work with VC 2005.


  • laserbeam

    Those linker error may appear if you are using "Ignore All Default Libraries" options on the Linker Input page.

    "The syntax errors were about coverting a string in several things to LPCWSTR, because I guess it wouldnt convert it automatically like it did in VC++ 6.0, so my solution was to paste (LPCWSTR) infront of each string, and then I got these 5 linker errors again."

    It won't work if you paste (LPCWSTR) in front of each string. You need just an L or use the _T macro:

    L"Hello World"

    _T("Hello World")

    That L makes an Unicode string thus making it compatible with LPCWSTR. The _T macro adds the L or not depending on your project settings. And the project settings are the source of this problem. VC 6.0 defaulted to ANSI strings while VC 2005 defaults to Unicode strings.

    See this post for some more details about this:

    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=849851&SiteID=1


  • Problem with Visual C++ 2005 Express Edition