0
votes

I am writing some C code in eclipse. I have some of my own header files and I put them under project properties -> GCC C Compiler -> Includes -> Include paths(-l). One of the inclded file is socket.h. When I try to compile my project compiler still points to default library (usr/includes/bits/socket.h and /usr/includes/sys/socket.h) But I have my own socket.h file which I have included under include paths(-l).

My question is, How can I restrict my compiler to point my socket.h rather than its own socket.h ? One restriction is that I cant change socket.h file name.

1
Are you using "socket.h" or <socket.h> includes? - Tim Čas
What happens if you just use #include"socket.h" ?! - Shivaraj Bhat
I thought it could solve the problem. I compiled again but got the same error. I am now going to write a bitbake file to build my project. If there comes any other suggestion I will try that. - Shawn

1 Answers

0
votes

An easy and fast way to solve this, is to put your socket.h in a subfolder and make your include look like this:

#include "mysubfolder/socket.h"

Add the subfolders parent folder to your include paths and your done.