<div dir="ltr">Hello everyone,<div><br></div><div>First time posting to this group! I'm a lecturer at a university and I'm interested in using Geany as the IDE for a class we run on an introduction to the C language for freshman electrical and computer engineering students. Is this the appropriate way to ask questions / for help? I didn't seem to find any Geany forums...</div><div><br></div><div>Anyways, I'm trying to figure out how I can use Geany to build a multiple-C-file project on a Windows machine. I have installed MinGW / GCC on my computer and have added the directory as part of the "PATH" variable. I can access GCC directly from the command line no problem. Geany actually works great when compiling and running single-file programs.</div><div><br></div><div>I'm trying to run a Command Prompt expression I wrote which generates the object files for every C-file in the current directory. To do this, I need to use multiple calls to GCC using a for-loop. Afterwards, I can use a single call to GCC to link all the object files together. No problems there...</div><div><br></div><div>The problem I'm having is this: when I try to add the CMD prompt expression to a custom build command, Geany gives me the error "Process failed (They system cannot find the file specified)".</div><div><br></div><div>The command I'm trying to run is below:<br></div><div><font face="monospace, monospace">for %i in (*.c); do gcc -Wall -c -o "%~ni.o" "%i";</font><br></div><div><br></div><div>This works fine when I run it directly from the CMD prompt. Any reason why this would not work through Geany's "Set Build Commands" area?</div><div><br></div><div>The linking command (to merge all the object files together) works fine from Geany:</div><div><font face="monospace, monospace">gcc -Wall -o "%e" *.o</font><br></div><div><br></div><div>Currently, I just have to click the "Compile" button separately on every C file individually first before doing the linking command above.</div><div><br></div><div>Below is the computer information:</div><div><i>Geany 1.29 for Windows</i></div><div><i>Running Windows 7, 64-bit</i></div><div><br></div><div>The two C-files I'm trying to compile together are quite simple... see below:</div><div><br></div><div>Inside main.c:</div><div><div><font face="monospace, monospace">#include "stdio.h"</font></div><div><font face="monospace, monospace">int myfunc(int,int);</font></div><div><font face="monospace, monospace">int main(void)</font></div><div><font face="monospace, monospace">{</font></div><div><font face="monospace, monospace"><span style="white-space:pre">    </span>int a = 5, b = 2;</font></div><div><font face="monospace, monospace"><span style="white-space:pre">    </span>printf("My answer is %d", myfunc(a,b));</font></div><div><font face="monospace, monospace"><span style="white-space:pre">    </span>return 0;</font></div><div><font face="monospace, monospace">}</font></div></div><div><br></div><div>Inside function.c:</div><div><div><font face="monospace, monospace">int myfunc(int x,int y)</font></div><div><font face="monospace, monospace">{</font></div><div><font face="monospace, monospace"><span style="white-space:pre">    </span>return 3*x - y;</font></div><div><font face="monospace, monospace">}</font></div></div><div><br></div><div>Any help is greatly appreciated! Thanks!</div><div><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><b>-Allan-<br></b></div><div></div></div></div></div></div></div></div></div></div></div></div></div>
</div></div>