4 Replies - 1044 Views - Last Post: 03 May 2011 - 01:52 PM Rate Topic: -----

#1 bonyjoe  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 175
  • View blog
  • Posts: 548
  • Joined: 08-September 10

DirectX .exe problem

Posted 03 May 2011 - 08:20 AM

I have written a direct3d program that loads in models and heightmaps and displays them using shaders. The program works as expected. However it only works as expected when I use visual studio to run it (by pressing ctrl+f5) if I go to where the .exe is located in the folder it will crash when it tries to get a handle to the first effect technique. I assumed this was just because it couldn't find the effect files, so I added all the assets to the same folder as the exe and tried to run it and the same problem occurred.

Obviously this is not a good thing to happen and prevents anyone from being able to run it, so I need to figure out how to correctly build the .exe so it works, or how to correctly package the assets with it so it will work. So can anyone tell me how?

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: DirectX .exe problem

#2 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: DirectX .exe problem

Posted 03 May 2011 - 10:33 AM

Are you building in release mode? This is very important to run the .exe outside Visual Studio.
Was This Post Helpful? 0
  • +
  • -

#3 bonyjoe  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 175
  • View blog
  • Posts: 548
  • Joined: 08-September 10

Re: DirectX .exe problem

Posted 03 May 2011 - 01:27 PM

Thanks.

Trying to build to release version but I get a lot of direct3d related external symbol errors

Error	1	error LNK2001: unresolved external symbol _Direct3DCreate9@4	d3dApp.obj

Error	2	error LNK2001: unresolved external symbol _D3DXVec3TransformCoord@12	d3dUtils.obj

Error	6	error LNK2001: unresolved external symbol _GUID_SysKeyboard	Input.obj

Error	10	error LNK2001: unresolved external symbol _D3DXCreateFontIndirectA@12	StatTracker.obj



Do I need to add some files to make it work?

This post has been edited by bonyjoe: 03 May 2011 - 01:31 PM

Was This Post Helpful? 0
  • +
  • -

#4 bonyjoe  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 175
  • View blog
  • Posts: 548
  • Joined: 08-September 10

Re: DirectX .exe problem

Posted 03 May 2011 - 01:49 PM

Ah ok, never realised that the release has different additional dependencies to the debug, so fixed that.

But now the only things that the program shows are a grey screen and the text I have drawn to the screen. All the other stuff that is on the screen in the debug version seems to have disappeared completely :/

Are there any other things different between the debug builds and release builds that could cause a problem like this?
Was This Post Helpful? 0
  • +
  • -

#5 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: DirectX .exe problem

Posted 03 May 2011 - 01:52 PM

I'll just edit this post. Yes, debug mode is different to release mode for several reasons, including variables being initialized even when you haven't explicitly done so, and your development environment having 'hooks' into your executable in order to allow debugging and rudimentary exception handling. When in release mode you do not have this backup. :)

This post has been edited by ButchDean: 03 May 2011 - 02:01 PM

Was This Post Helpful? 2
  • +
  • -

Page 1 of 1