s.younas
s.younas

Reputation: 11

I am trying to add a header file into another header file

I am trying to add a header file into another header file but it says "Source file not compiled" Is there something wrong with what I am trying to do?

#include "\\Mac\Home\Desktop\BSD 2017\Study\BTP100SCC.05062.2177 Programming Fundamentals Using C\BTP-Project\A1\MS2\contacts.h"

struct Name
 {
    char firstName[31];
    char middleInitial[7];
    char lastName[36];

};

Upvotes: 0

Views: 81

Answers (1)

Jesse
Jesse

Reputation: 293

Short answer for a short question. No #include "file.h" should work fine.

"Source file not compiled" indicates that you may not have compiled your source file. Have you run a command such as % gcc -c file.c?

**edit: listing your full directory each time is bad practice. Use the -I option to specify the directory search path

If you have not done this, then you should read up on how to compile a c program.

Note: If you run windows you may need to use a Unix command-line environment such as Cygwin

Upvotes: 1

Related Questions