This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Why won't my files link?

Elfyn McBratney wrote:
>> So I am new to Cygwin, but I am enjoying it so far.
> Kewl! :::::::-)
>> I am having a
>> problem, though, please respond if you can... I have three C files
>> (all ending in .c), and I can compile them with GCC by using the -c
>> switch. Then, I want to link all three of the object files that I
>> have created (ending in .o) and make an executable which uses all
>> three.  My file called main.c has two include lines, which says to
>> include "io_functions.h" and "fun.h".  Then I am using this line to
>> link everything and make the executable...
> Right. To all of the files you are tryin to compile (the *.c files
> and the 
> *.h files) reside in the same directory? If so you should be using a
> command similar to
> $ gcc -I.-c fun.c

Missing space between '-I.' and '-c'. Why would you want to use -I. ?

#include "file" searches there anyway.

> You might try compiling each file (into an executable) before,
> in-case there are errors, so you'll have peace of mind that they'll
> actually compile. 

Do you mean (into an object) ?


Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]