<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Problems with Code:Blocks</title>
		<link>http://www.allegro.cc/forums/view/617661</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 12 Dec 2018 21:21:52 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi Guys:<br />  It&#39;s been awhile since I have posted anything on this site, but I have<br />a couple of questions:</p><p>1- I have a program I am trying to run from my Desktop. It requires loading<br />   (6) Jpg files. When I make the link and copy it to my Desktop the screen<br />   just blinks. The reason for this happening is the Jpg files and not<br />   included in the executable file generated with Code:Blocks. In other<br />   words, this is not a standalone file. How do I configure Code:Blocks to<br />   make this file so I can run it on my Desktop and on another computer.<br />   I am running Ubuntu 14.04, Code:blocks 13.12.</p><p>2- The other day I took another disc and installed Ubuntu 18.04.1. I installed<br />   Code:Blocks and loaded all my programs and compiled and linked them all.<br />   Everything went well except I noticed there were no executable showing<br />   up in my directory. I assume the reason was Ubuntu 18.04.1 is 64 bit and<br />   my programs are 32 bit. I checked the box to set the flag in Code:Blocks<br />   for 32 bit and another file showed up next to my original file. Have no<br />   idea what was being told to me. I may be getting in over my head on this<br />   one! Anyway, if someone has the time could you give me some help?</p><p>   Thanks and I hope all is well. Merry Christmas to everyone!!!!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Scooter)</author>
		<pubDate>Tue, 11 Dec 2018 21:48:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Those jpeg files have to be in the same directory as your program. Your program is not an exe on linux. It doesn&#39;t have any extension.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Tue, 11 Dec 2018 21:51:53 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi Edgar:<br /> They are in the directory. The program compiles and links fine.<br />It won&#39;t run from in the Desktop directory from the link. I have<br />other programs that are standalone that run fine from the Desktop.<br />Something must not be configured right in Code:Blocks.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Scooter)</author>
		<pubDate>Tue, 11 Dec 2018 22:18:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You have to set the working executable directory, for the shortcut. The start in directory.</p><p><b>EDIT</b><br />Well, if you were on Windows you would.</p><p>Every program has a current working directory. When it is started from a different directory, things aren&#39;t where they are expected to be in terms of relative paths.</p><p>What you need to do is set the working directory of the program at run time.</p><div class="source-code snippet"><div class="inner"><pre>   ALLEGRO_PATH<span class="k3">*</span> p <span class="k3">=</span> <a href="http://www.allegro.cc/manual/al_get_standard_path"><span class="a">al_get_standard_path</span></a><span class="k2">(</span>ALLEGRO_RESOURCES_PATH<span class="k2">)</span><span class="k2">;</span>
   <a href="http://www.allegro.cc/manual/al_change_directory"><span class="a">al_change_directory</span></a><span class="k2">(</span><a href="http://www.allegro.cc/manual/al_path_cstr"><span class="a">al_path_cstr</span></a><span class="k2">(</span>p<span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
   <a href="http://www.allegro.cc/manual/al_destroy_path"><span class="a">al_destroy_path</span></a><span class="k2">(</span>p<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

Edit<br />That won&#39;t work because you have to strip the file name off the folder path first my computer is broken so I can&#39;t help right now. Maybe it will I can&#39;t test right now.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Wed, 12 Dec 2018 03:59:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It sounds to me like you&#39;d like to embed the resource files into the executable, which is something most of us don&#39;t do -- typically, I send a game to somebody with a resource archive, so two files instead of one.</p><p>I switched to Code::Blocks recently, and discovered that if you put the resource files in the same directory as the source files (one level up from bin, where the Debug/Release code is compiled to) the executable finds the resources just fine. In other words, what Edgar was saying about the current working directory was correct: Code::Blocks set the CWD to the project root.</p><p>If you&#39;ve found the Code::Blocks project file, with the extension cbp, you&#39;ve found the right directory!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (princeofspace)</author>
		<pubDate>Wed, 12 Dec 2018 10:54:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks prince for your reply. I have never created a project<br />using Code:Blocks because all the programs I do are single files.<br />I never do programs containing multiple files.<br />After reading your comment, I decided maybe that has been my problem.<br />I tried to create a Console Application and Code:Blocks said it<br />could not create the directory for the project. I will continue<br />trying different things to see if it will comply.<br />Thanks again.</p><p>I finally got a project created. Loaded my program to compile and<br />run. It created an executable file in the project directory. I double<br />clicked the file but it did not run. Oh well, I will keep at it!!!!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Scooter)</author>
		<pubDate>Wed, 12 Dec 2018 21:21:52 +0000</pubDate>
	</item>
</rss>
