0

Hi,
I use C-Free 4.0 editor for executing C programs.

I have a Treap program that I obtained online which is organized as

testtrp.c
treap.c
treap.h
fatal.h

When I compile the testtrp.c, which references treap.c it compiles correctly. However when I try to run it I get the undefined reference errors to all methods that are found in treap.c

How should I include treap.c to be used while executing testtrp.c?

testtrp.c explicitly includes treap.h, however there is no explicit reference to treap.c. I obtained this code from a textbook's website so the code is correct.
It is just that I am a newbie to C and I dont know how to execute such programs. I have googled extensively on this and most of the help I got said that there could be spelling errors and I checked them to ensure there are no such errors.


Thanks for your time,
Asana

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by Salem
0

You need to compile both files, as in cc -o prog testtrp.c treap.c Of course, exact details for your IDE will vary, but that's the essence of what you need to do.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.