Eclipse: after build no such file or directory - c

I have done the following:
Added the path to my include folder under Paths and Symbols->includes tab
The header file now appear in my project folder under includes
The #include files no longer give errors as the project can see the .h files that it needs
After build I get the following error:
fatal error: services.h: No such file or directory
make:*[filename]Error 1
My .c source file now complains that it cant see the include file. How do I fix this?

In Eclipse import a new make file project. Then link the appropriate libraries.

Related

VSCode can't find header files when they are in different folders

I have a problem with VSC. I started to use it recently and well I have 1 issue with it. My project has multiple folders, those folder just contain .h and .c files, but sometimes I need that .c file from one folder would read functions from .h file from another folder, and well when I include .h file, compiler can't find it. example bellow:
the only thing that works is by including full path to that file:
#include "C:/Users/Name/Desktop/Project/Project_dir/components/configurations/I2C_master.h"
Is this normal for VSC or I don't know how to use linker?
I think your problem here is that you're writing the file path as if the two were located in the same directory.
If you are referencing a file from another directory you should write the relative path like this:
#include "../configurations/I2C_master.h"

fatal error: linux/mount.h: No such file or directory

I'm running make command to build a source code downloaded from here . while running make it always throws the same error :
In file included from criu/cgroup.c:29:0:
criu/include/linux/mount.h:8:10: fatal error: linux/mount.h: No such file or directory
#include <linux/mount.h>
^~~~~~~~~~~~~~~
compilation terminated.
I've checked multiple times the file does exist in the source code which i'm trying to build. But i do not understand why the compiler could not find it? what is the solution to handle these types of error?
EDIT: this source code contains another mount.h file in criu/include/linux/mount.h directory, inside that file, they have used #include <linux/mount.h>
EDIT2: the mount.h files was not present in /usr/include/linux/ directory so i copied the file from the host's one to VM. Now i've successfully build the package and installed the binary but still one question i would like to ask is why the mount.h was not present on the VM.
i do not understand why the compiler could not find it?
Because it's not supposed to. One should use
#include "linux/mount.h"
rather than
#include <linux/mount.h>
to include files from the project.

Libdvbcsa, missing header files

I have a problem i cannot solve.
Library repository
I am trying to run test .c files in this library, I have installed the files however when I run this on mac:
gcc testbitslice.c
I get this error
fatal error: dvbcsa_pv.h: No such file or directory
#include "dvbcsa_pv.h"
the testbitslice.c file calls the header files as follows
#include <dvbcsa/dvbcsa.h>
#include "dvbcsa_pv.h"
When I checked urs/local/include there are one file under dvbcsa folder which is dvbcsa.h. But there is no file called dvbcsa_pv.h. I don't understand the problem. I don't get error while installing with ./bootstrap or ./configure and make, make install commands.
Then, I manually copy/paste header files from package folder to usr/local/include, this time it gives error as
Undefined symbols for architecture x86_64
Is the problem related to installation or something else? I would appreciate if you could help me
I have found out the problem. I just had to show the library directory i want to use using:
-I/Users/bill/Desktop/libdvbcsa-master/src/dvbcsa
and it works.

added header in C, #include returns error

I added a header in NetBeans 8.0.1 in my project.
But when I include it in a source file I get an error
test.c:12:24: fatal error: tester.h: No such file or directory
my folder where I save my project is c:\david\temp files\netbeansProjects
could it be because i have a folder name with a space "temp files"? If so how can I change
where all my projects are, without ruining everything.
If that is not the reason, does anybody have a suggestion?

CodeLite static library does not find include file

I've created a simple project to learn how to create a static library. I've created a new workspace in CodeLite and a new project and a new static library.
In the static library I've got, inside a "include" folder a .h file called helloworld.h and inside a "src" folder a .c file called helloworld.c. The output files are generated in a folder inside the workspace in a folder called lib (../lib).
Inside the same workspace I have a project with a file .c where the helloworld is called with #include "helloworld.h". Finally, the settings of the project are:
linker menu:
Libraries search path: ../lib
Libraries:
General Menu:
When I compile the project I got the following error:
fatal error: 'helloworld.h' file not found
The only way that the project compiles without problems is to get the relative path to the file within the include parameter:
#include "../HelloWorldLib/include/helloworld.h"
I wonder if there is a way to work without having to add the path to the file. I'm using CodeLite in MAC OS 10.9.5. The same problem occurs in Ubuntu.
My teacher explained that this does not occur in CodeLite Windows, but he doesn't know what could be happening in Mac. Moreover, it should not be necessary to use the path within the include parameter.
If you go to the "Compiler" tab instead of the "Linker" tab, try adding your 'include' directory under the "Include Paths" option.

Resources