X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Wed, 26 Jan 2005 12:20:34 -0200 From: Jonatan Liljedahl To: djgpp AT delorie DOT com Subject: Re: Compile problem Message-Id: <20050126122034.01459342.lijon@kymatica.com> In-Reply-To: References: Organization: Kymatica X-Mailer: Sylpheed version 0.9.10 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 26 Jan 2005 08:22:52 GMT "Mike C" wrote: > I have a small compile issue: Running in a DOS window under W2000, if > I > compile using RHIDE, the resulting program runs fine on my PC, but, > it seems, not on anybody else's. If I compile using > > gcc -Wall -O2 -o myprog.exe myprog.c > > then the program runs fine on other people's PC's. strange. > My program was originally all in one file, but it getting a bit > unwieldy, so have split it into three files and made a project. The > problem is that my"compile" line doesn't work any more - the linker > can't find the extern references. I think it should be possible to just do: gcc -o myprog.exe *.c The usual way is to first compile all the separate .c files like this: gcc -c file1.c gcc -c file2.c gcc -c file3.c then link the resulting objectfiles together like this: gcc -o myprog.exe file1.o file2.o file3.o becouse this means you don't need to recompile all files each time, only the files you've changed. (create a Makefile and use make) /Jonatan -=( http://kymatica.com )=-