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?

Okay everyone... thank you for your help and for your feedback.  Allow me
to attempt to clarify a little bit more...

1) I am new to GCC.  I am new to C.  I had worked until Java until

2) I used the SAME io_functions.o file in both Cygwin and Linux.  This
file was generated by a CS professor at my school using GCC.  When I use

gcc -o main fun.o io_functions.o main.o

command (is it inappropriate to call it a command?), it works fine on
Linux.  It did not work in Cygwin and I wrote the list to see if maybe
someone knew of a discrepancy.

The idea of some libraries being absent from the Cygwin package or my
machine specifically sound likely... the error messages are as follows...

io_functions.o(.text+0x13): In function 'read_array':
: undefined reference to 'fopen'
io_functions.o(.text+0x4f): In function 'read_array':
:undefined reference to 'printf'

there are more about missing printf... so either the file is not finding
this fairly simple operation possible... or I am missing a library or

then... these errors follow:

main.o(.text+0x3f):main.c: undefined reference to '_read_array'
main.o(.text+0x52):main.c: undefined reference to '_print_array'

And it continues missing more methods... then...

collect2: ld returned 1 exit status

That is all...  So yeah, what do you think?

In addition, I would like to acknowledge that I realized I should have
included the error messages sooner, but as my e-mail said, I was not in
the position to run Cywgin and test my stuff again.  I merely wrote back
to the list to send more info on my problem and to respond to the kind
persons who had already e-mailed me.  I did this as a casual thing, not
realizing that I was wasting so much precious time!  I am not writing to
waste your time and I am not writing to get help with C or Linux, etc.  I
merely thought that my problem was due to an inconsistency between the
platforms, and was hoping someone could drop some hints.  Thank you for
your time thus far, and I look forward to a response.

Nick Miller

Unsubscribe info:
Bug reporting:

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