Advertisement

VC++ problem (sorta)...

Started by August 13, 2002 04:07 AM
2 comments, last by jmszczap82 22 years, 4 months ago
Hi, Why is it that if I run my app. from within VC++, it can''t find the music file that it''s supposed to play? It works fine outside of VC++. - JS
Please sign my petition! Visit the following URL: http://www.petitiononline.com/tftctvoh/petition.html
The working directory is different from within VC++. If you don''t give a complete path to load the file (ie. something like C:\music\mystuff.wav), it''ll most likely be looking in the wrong directory. Try copying it into your project directory as well, see if that helps.
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
Advertisement
In VC++ (and some other compilers) it creates a "Debug" folder which your application, along with any object files, is created in. If you put the music in the debug folder it will work standalone but not fro the compiler and if you put it in the same directory as the source (/../ from /debug/) then it will run in the compiler but NOT standalone. It''s best to use the latter option and then copy ALL your media into the Debug folder when the game is released.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Ilthigore-
<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>Ilthigore<<<<<<<<<<<<<<<<<
My preffered method is to create a separate "dist" folder, copy the executable there in the Custom Build or Post Build event (so that I can run it standalone later) and to also set the "working folder" (or whatever it''s called) in the debug options page to point to that folder. That keeps my source and media files nice and separate, and I don''t have to worry later on about copying the right files and so on into my distribution media.

If I had my way, I''d have all of you shot! codeka.com - Just click it.

This topic is closed to new replies.

Advertisement