Sign in to follow this  
Xtro

Deploying with D3DX

Recommended Posts

Xtro    118
[font=Verdana, Arial, Helvetica, sans-serif][size=2]
I am developing my application using d3dx functions. but when I deploy it to a fresh PC (which has no SDK installation) it doesn't run. And I saw an information in directx SDK that says that :

"The D3DX library included in this release is dependant on the Direct3D runtimes that shipped with this SDK. Applications linking against the version of D3DX in this release must also redistribute the runtime from this SDK."

I don't know how to redistribute the sdk runtime. I am installing redistributable files and it doesn't work. Then I am copying developer runtime dlls to application folder or system32 folder manually but it still doesn't work.
It only works when I install the SDK to the fresh PC. But I can't install the huge SDK to all my clients' computers.

I wonder how you guys are deploying your application which is using d3dx functions.

please help. Thank you.[/size][/font]

Share this post


Link to post
Share on other sites
Adaline    710
Hello

Personnally, I have to run the dx installer and install vcredist at install so that my program runs on other computers

Share this post


Link to post
Share on other sites
mhagain    13430
[quote name='Adaline' timestamp='1312581009' post='4845237']
Hello

Personnally, I have to run the dx installer and install vcredist at install so that my program runs on other computers
[/quote]

This, basically. Always use the proper installers, manually copying and pasting DLLs will only end in tears.

Share this post


Link to post
Share on other sites
Xtro    118
Guys, Thank you for your answers but I am still very confused. Because Neither Redist files from SDK nor web installer installs some of required DLLs like D3D10SDKLayers.DLL or D3DX10d_42.dll. They are named as "Developer" runtime and end-user installers doesn't install them. Right....

But !!! As it is written in the SDK documentation... If you are using D3DX10 or 11, I mean if you are linking against lib files which their name has a "d" letter at the end, you have to install developer runtime from the SDK.

When I compile my application, it asks for d3dx10d.lib file because I am including D3DX10.h header file in the code. I don't know why but even if I build as Release version from Visual Studio, linker asks for developer lib files. So, compiled exe needs developer dlls.

I think I need to find a way to compile my application without developer lib files. I tried to remove developer lib files from my lib source folder, It didn't help because linker is asking for those files. Then I defined the compiler directive D3D10_IGNORE_SDK_LAYERS at the beginning of my application but linker is still asking for developer lib files :( :(

Share this post


Link to post
Share on other sites
Jason Z    6434
In my engine, I use the following library statements:

[code]// Library imports
#pragma comment( lib, "d3d11.lib" )
#pragma comment( lib, "d3dx11.lib" )
#pragma comment( lib, "d3dx10.lib" )
#pragma comment( lib, "DXGI.lib" )
#pragma comment( lib, "d3d9.lib" )[/code]

Is there a reason you need to link only to the debug version of the library in a release build? Perhaps you have a debug flag defined somewhere in your code?

Share this post


Link to post
Share on other sites
ryan20fun    2635
[quote name='Jason Z' timestamp='1312617136' post='4845351']
In my engine, I use the following library statements:

[code]// Library imports
#pragma comment( lib, "d3d11.lib" )
#pragma comment( lib, "d3dx11.lib" )
#pragma comment( lib, "d3dx10.lib" )
#pragma comment( lib, "DXGI.lib" )
#pragma comment( lib, "d3d9.lib" )[/code]

Is there a reason you need to link only to the debug version of the library in a release build? Perhaps you have a debug flag defined somewhere in your code?
[/quote]

but is'nt that the same as adding those :ib's to the linker option in VS ?
but just on the file level.

Share this post


Link to post
Share on other sites
Jason Z    6434
[quote name='ryan20fun' timestamp='1312625946' post='4845374']
[quote name='Jason Z' timestamp='1312617136' post='4845351']
In my engine, I use the following library statements:

[code]// Library imports
#pragma comment( lib, "d3d11.lib" )
#pragma comment( lib, "d3dx11.lib" )
#pragma comment( lib, "d3dx10.lib" )
#pragma comment( lib, "DXGI.lib" )
#pragma comment( lib, "d3d9.lib" )[/code]

Is there a reason you need to link only to the debug version of the library in a release build? Perhaps you have a debug flag defined somewhere in your code?
[/quote]

but is'nt that the same as adding those :ib's to the linker option in VS ?
but just on the file level.
[/quote]
I'm pretty sure it is the same thing - my point in showing them is that I don't use the debug versions of the libraries at all.

I took a quick look through D3DX10.h, but didn't see anything requiring the library to include that the OP specified. Do you know more precisely which portion of the header file requires you to include that library?

Share this post


Link to post
Share on other sites
Xtro    118
I think this runtime problem is not only my problem. I mean I don't think I am doing something wrong.

I compiled Tutorial02 from SDK (both debug and release) then copied the bin folders to a fresh windows 7. it didn't work either. Tutorial02 doesn't use and SDK specific media file. So, I think it should work on fresh windows 7 without SDK installed.

a)Debug version is showing a message box saying D3DX10d_42.dll is missing. and it closes the application instantly after that message.
b)Release version doesn't show the message box and it automatically closes the application window.
c)I copied the DLL into debug bin folder manually. Debug version didn't show the error message again but closed instantly like Release version.

I think I need to solve that problem before I fix my own application. Because my project is writing a DX wrapper library for .NET environment like SlimDX or other. And I am implementing SDK tutorials(with C#) in my project to prove that my library can run DK tutorials. But now, I am suspending my project. Because I don't want to deal with .net or other problems.

*** My current problem is to deploy any C++ D3DX application to a fresh windows.

1) How can I run the Tutorial02 on a fresh windows 7 ? Btw, fresh windows has dx end-user web installer installed.
2) Can anyone create a very simple project deployable for me ? I would be happy if you send me the vs2008 project folder and I can build it and I can try it on fresh windows. The Project can be simple as Tutorial02.

thank you.

Share this post


Link to post
Share on other sites
bubu LV    1436
Does Tutorial02 need to load some additional files like texture or hlsl shaders? Maybe it simply can't find them?
Try adding "printf/msgbox debugging" - add few printfs or message boxes between statements to see where program terminates/crashes.

Share this post


Link to post
Share on other sites
MJP    19756
You need to install the Visual C++ end-user runtimes for the version you're using. For a 32-bit app built with VS 2008 without service pack 1, you need to install [url="http://www.microsoft.com/downloads/details.aspx?familyid=9b2da534-3e03-4391-8a4d-074b9f2bc1bf"]this[/url]. With SP1, you need [url="http://www.microsoft.com/download/en/details.aspx?id=5582"]this[/url].

Share this post


Link to post
Share on other sites
Xtro    118
I am sorry but that didn't help. :(

I installed vs2008 sp1 c++ end user but Tutorial02 still is not working. Release version closes, Debug version shows the same error.

Tutorial02 is using an additional file which is fx file. I have this file in the output bin folder but, Not to be confused... I am going to Tutorial01 which has no addition file or something.

Tutorial01 is also automatically closes on a windows 7 which has directx end-user and vc++ end-user installed.
I dont want to install visual studio to that windows. I don't know how I am gonna debug this auto closing problem.

A simple project which is made by you and running on fresh windows would be very helpful. So I can test it and see the differences.

Share this post


Link to post
Share on other sites
Xtro    118
Tutorial01 get a DXGI_ERROR_UNSUPPORTED error on fresh windows 7 while caling

hr = D3D10CreateDeviceAndSwapChain( NULL, g_driverType, NULL, createDeviceFlags, D3D10_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice );

then it closes.

But I have installed dx runtime with web installer. Any idea ?

Share this post


Link to post
Share on other sites
ankhd    2304
Well I think you may have to removed the debug .dll from the project and then link with the release .dlls and then use cv++ end-user runtimes

and the sdk end-user runtimes

Share this post


Link to post
Share on other sites
ryan20fun    2635
[quote name='Xtro' timestamp='1312663682' post='4845535']
Tutorial01 get a [b]DXGI_ERROR_UNSUPPORTED[/b] error on fresh windows 7 while caling

hr = D3D10CreateDeviceAndSwapChain( NULL, g_driverType, NULL, createDeviceFlags, D3D10_SDK_VERSION, &sd, &g_pSwapChain, &g_pd3dDevice );

then it closes.

But I have installed dx runtime with web installer. Any idea ?


[/quote]

looks like you have found the problem, what about changing the device params ?

DX Docs on Devic Creation
[quote]
DXGI_ERROR_UNSUPPORTED is returned whenever the application requests to create a well-known counter, but the current device does not support it.
[/quote]

Share this post


Link to post
Share on other sites
Xtro    118
Ok guys,

After working very hard for 2 or 3 days... I have solved my whole deployment problem. Thank you for your help.

These installations are required to deploy and run an application (which is including D3DX10.h header) on a fresh windows vista or windows 7 :

1) DirectX end-user runtime (can be installed from your directx sdk folder or from web installer. [url="http://www.microsoft.com/download/en/details.aspx?id=35"]http://www.microsoft.com/download/en/details.aspx?id=35[/url] )
2) Microsoft Visual C++ Redistributable Package (version can vary according to your development environment (vs2008 or vs2010) and target platform (x86 or x64)
2008 SP1 x86 : [url="http://www.microsoft.com/download/en/details.aspx?id=5582"]http://www.microsoft.com/download/en/details.aspx?id=5582[/url]
2008 SP1 x64 : [url="http://www.microsoft.com/download/en/details.aspx?id=2092"]http://www.microsoft.com/download/en/details.aspx?id=2092[/url]
2010 SP1 x86 : [url="http://www.microsoft.com/download/en/details.aspx?id=8328"]http://www.microsoft.com/download/en/details.aspx?id=8328[/url]
2010 SP1 x64 : [url="http://www.microsoft.com/download/en/details.aspx?id=13523"]http://www.microsoft.com/download/en/details.aspx?id=13523[/url]
3) if you are gonna switch into REF device, you need to have D3D10Ref.DLL in your application folder or in System32 folder.
4) if you are gonna create debug device, you need to have D3D10SDKLayers.DLL too.

And don't forget to have correct version (x86 and x64) of the DLLs in step 3 and 4. They are in C:\Program Files (x86)\Microsoft DirectX SDK (August 2009)\Developer Runtime folder.

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