Sign in to follow this  
sandy

DirectX 9.0c and VS2005 Express

Recommended Posts

I have been using VS6 and DirectX 9.0b, but I have just upgraded to DirectX 9.0c. I thought I might take this opportunity to try out a newer development environment while I was at it, so I downloaded the VS2005 Express Beta and installed that too. I am running Windows XP with Service Pack 2 installed. I have updated my Platform SDK and have set up all the directories correctly in VS. I then install the EmptyProject from the DirectX 9.0c samples and attempt to compile it, however I receive the following linking error. LINK : fatal error LNK1104: cannot open file 'libcp.lib' I have searched high and low for a solution and found the following thread here, which told me I can safely ignore this library. http://www.gamedev.net/community/forums/topic.asp?topic_id=269777&whichpage=1? However, if I tell the compiler to ignore this library I end up getting over 130 unresolved external symbol linking errors, like the following one as an example. DXUT.obj : error LNK2019: unresolved external symbol __imp__GetWindowRect@8 referenced in function "long __cdecl DXUTCreateWindow(unsigned short const *,struct HINSTANCE__ *,struct HICON__ *,struct HMENU__ *,int,int)" (?DXUTCreateWindow@@YAJPBGPAUHINSTANCE__@@PAUHICON__@@PAUHMENU__@@HH@Z) Does anybody know what I need to do to compile the EmptyProject from DirectX 9.0c with VS2005 Express Beta?

Share this post


Link to post
Share on other sites
I am just loading up the sample EmptyProject that comes with DirectX 9.0c. I assume it already has the libraries set correctly, but I checked it anyway and found these.

dxerr9.lib dxguid.lib d3dx9dt.lib d3d9.lib winmm.lib comctl32.lib

This all lokks fine, and as you can expect, there is no reference to libcp.lib as I assume it is being refrenced somewhere in D3DX. The odd thing about it is that this library does not exist. I have done a fresh install of VS2005 Express along with the latest Platform SDK and this library is nowhere to be found.

It does exist with VC6, but it looks like you cannot use it. I am just stumped as to why I can't just install Visual Studio, install DirectX, update my Platform SDK, open up one of the DirectX sample projects and compile it without error? Perhaps I'm asking too much?

Share this post


Link to post
Share on other sites
I'm getting really frustrated with this. I have taken desperate measures with no results. Here's what I did.

1. Formated my whole hard drive.
2. Installed Windows XP Pro.
3. Installed Windows XP Service Pack 2.
4. Installed Visual Studio 2005 Express.
5. Updated my Platform SDK (installed the whole thing from the MS website).
6. Installed DirectX 9.0c.
7. Opened Visual C++ 2005 and checked all the directories.
8. Loaded the sample EmptyProject that comes with DirectX 9.0c.
9. Clicked on the "Build" button.

...and it still gives me that some error!!!
LINK : fatal error LNK1104: cannot open file 'libcp.lib'

I managed to find libcp.lib in an obscure directory within the Platform SDK, but if I try to link to it VS throws me about 132 unresolved external symbol errors.

Surely somebody has managed to compile one of the DirectX 9.0c samples without error. If so, please list the steps you took to do it. At this rate I'm going to have to go back to 9.0b and VS6 :(

Share this post


Link to post
Share on other sites
I remember seeing something like this on the DirectXDev mailing list. The question over there was whether VS2005 Beta could do shader debugging.

Although the question is different than yours, the response from the DirectX team might help. They said that since the VS2005 Beta shipped after DX9.0c, DX9.0c has no direct support for the VS2005 Beta. Support will be added in a future SDK release.

My guess is that by the time VS2005 is ready, a new SDK release should be close as well. This doesn't mean that you shouldn't be able to compile an empty DX9 project with it; I'm just mentioning this to let you know that you aren't the only one to have problems with DX9.0c and VS2005 Beta.

neneboricua

Share this post


Link to post
Share on other sites
libcp.lib is one of the standard c runtime libraries and is required for all of the standard c routines. ie printf If you have included stdio.h or another such header you will need this.

Make sure you add the directory you found in the platform sdk directories that contains this file to your library path and all should be ok.

Share this post


Link to post
Share on other sites
Quote:
Original post by sandy
I managed to find libcp.lib in an obscure directory within the Platform SDK, but if I try to link to it VS throws me about 132 unresolved external symbol errors.

What this likely means is that now that it has found libcp it's continuing on and is showing you other errors. So you might have been fine by just ignoring that library.

You have to calmly deal with the issues in front of you and not jump to conclusions. For example, you listed that GetWindowRect wasn't found. If you check MSDN it shows that User32.lib is required for GetWindowRect. So add User32.lib to your library list and rebuild. Then handle those errors.

I haven't built the SDK samples but I have compiled my own DX code with VS2005 Express.

Share this post


Link to post
Share on other sites
DrunkenHyena, you are a life saver!!!

I was on the verge of a nervous breakdown because of this. I was going to format my hardrive again just because it feels good to punish the computer. It's the same feeling you get when you throw your monitor :)

Your encouraging words helped me to stop flailing my arms about, calm down, take a deep breath and start working through the unresolved external symbols.

In my efforts I have discovered that in order to compile the sample EmptyProject from DirectX 9.0c with VS2005 you need to tell the compiler to ignore libcp.lib and then add the following libraries:
user32.lib gdi32.lib shell32.lib advapi32.lib

Don't ask me what they do (or anything else technical like that) as I am likely to start flailing my arms again.

After compiling I received the following error.


Merging manifest files...
mt.exe:Manifest Authoring error c1010001:Attribute values in different manifest snippets not equal.
mt.exe exited with error - A device attached to the system is not functioning.
Project : error PRJ0002 : Error result 1 returned from 'C:\Program Files\Microsoft Visual Studio 8\VC\bin\mt.exe'.


I tried running the program and it ran just fine however the above error persist every time I press compile. Does anyone have any idea what this might be, or where I should look to find more information?

Share this post


Link to post
Share on other sites
You beat me to it johnnyBravo, great link!

It basicly covers what I said. I will follow the instructions there though as that way I won't have to add these libraries every time I create a new application.

It doesn't talk about the merging manifest files error though. I will continue my search, but any ideas anyone?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this