For pset3's findsearch, i saved the this code

#include "helpers.h"

bool search(int value, int values[], int n)
    // removed implementation due to academic honesty rules

in helpers.c and tried to compile it using make find and ./find and STILL says "helpers.c" is not a found library. Help please

  • Did you happen to import helpers library in find.c like this: #include <helpers.c> or #include "helpers.c"? – Wiktor Czajkowski Jul 27 '15 at 17:13
  • I did #include "helpers.c" – Ani Jul 28 '15 at 14:03
  • We have found the mistake then. I'm writing an answer right now. – Wiktor Czajkowski Jul 28 '15 at 20:50

As the error indicates, you are not supposed to include one source file into another.

As I found out though, this isn't prohibited by C language itself. In some cases, it is even considered good practice. After quick research I came to conclusion, that make makes this behaviour prohibited. This can be due to its built-in restrictions or some option enabled by staff.

Long story short, you should use header file (.h) inside #include directive instead of source file (.c) which you are using right now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .