Libdvbcsa, missing header files - c

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.

Related

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.

(Kali & Ettercap) Plugin compilation error

Okay I'm having a particular issue during compilation using the command gcc -shared -o attack_test.so -fPIC attack_test.c. Specifically, when I run the command, I get the error fatal error: ec.h: No such file or directory. Any idea how to fix this issue? Thanks.
EDIT: To give a little more issue background, I'm running this command from the desktop, where my C source code is located. Perhaps there's a specific place I need to put the source and run the command?
EDIT 2: So I was able to get past the above error by running the command sudo apt-get install libssl-dev, and then changing the line #include <ec.h> to #include <openssl/ec.h>, which seemed to negate the issue. Adding the <openssl/...> to the other includes did not work the same way. So now, instead of fatal error: ec.h: No such file or directory, it's fatal error: ec_plugins.h: No such file or directory. Any ideas for possible fixes? Thanks so much!
For reference, I'm building upon the the dos_attack.c source code from this link.
TO BE CLEAR: This is for a project and tested upon in a CLOSED ENVIRONMENT. This is COMPLETELY* for EDUCATIONAL use and for the study of Denial-of-Service and Man-In-the-Middle mitigation techniques.
<ec.h> is intended to refer to a file in the Ettercap include directory, not an OpenSSL header. The same goes for the other ec_*.h headers.
Adding -I/path/to/ettercap/include to your compiler flags should fix this.

Cannot access header files in separate folders

I'm pretty new to coding in c, but I have sample code that I imported into the eclipse console. However, when I go to build the project I run into various errors. All of these errors are because a code that I have in one folder is not able to access code in another folder. For example my main function is located in project>src>main.c but is not able to access the project.h file located in project>headers>project.h. I am also no able to access code directly above in the hierarchy either. For example, my project>src>compiler>comp.h is not able to access project>src>calc.h file. Is there a way I can instruct the code to find it? I have tried using #include "../src/calc.h" in my comp.h file but I still get the error message "No such file or directory." Any suggestions would be very helpful.
Header files can be tricky to include, it depends where you are compiling.
Try to compile like this :
gcc -o myBinary <your .c files> -I./your/path/to.h (it will link your .h files at the compilation state)
The best idea would be to create a Makefile and configure it to make your header files works in every files of your project, have a look at How to create a Makefile.

fatal error: bmpfile.h: No such file or directory

I have installed the libbmp library from this link https://code.google.com/p/libbmp/ and I have made all the required steps to complete with the installation.
When I try to use it, by including the bmpfile.h like the example on the download page:
#include <bmpfile.h>
I get this error:
fatal error: bmpfile.h: No such file or directory
Does anyone know what I am doing wrong?
Presumably it was installed to /usr/local/include and your compiler doesn't look in that location. To fix this, you should set your CPATH variable to point there:
CPATH=/usr/local/include
export CPATH
This is typically done in your .bashrc or similar, or in your IDE if you're using one.
For more info check your compiler manual.

How to get opencv include work in kubuntu? (Includes solution to how to include and link in netbeans 6.7.1)

I have installed OpenCV C libraries from package management into my Kubuntu 9.10. I wrote a small image modification program that uses those libraries, but I can't compile it, because every time I try to compile I get the error message that the functions from OpenCV library cannot be found.
Those header files are in folder /usr/include/opencv/ but still the compiler says that functions cannot be found.
I have tried to include them by basic
#include <highgui.h>
#include <cv.h>
commands in netbeans (and I have set netbeans to search header files from that specific directory) and also tried to include them with full path.
#include </usr/include/opencv/highgui.h>
#include </usr/include/opencv/cv.h>
Also I tried to compile my source file in console (with full path includes), but again I got the same error message that the functions from those libraries cannot be found.
Edit:
The error message that I get is
undefined reference to 'function_name'
I get that error for every function that I try to use from that opencv library.
Any idea how to fix that problem?
Edit II:
in case someone else is using netbeans 6.7.1 and has the same problem, here's the solution copy pasted from another website:
Here I presume that you have succesfully installed the opencv library either manually or via package management.
Open Netbeans then do the following:
Select Tools -> Options -> C/C++ -> Code Assistance -> add Include Directories
(For me, /usr/local/include/opencv)
Create new project, then:
Right click on Project Name -> Properties ->Build -> C/C++ Compiler -> Include Directories
Include Directories : /usr/local/include/opencv
Right click on Project Name -> Properties -> Build -> linker ->
Include Directories : /usr/local/include/opencv
Additional Options : -I/usr/local/include/opencv -L/usr/local/lib -lcxcore -lcv -lhighgui -lcvaux -lml
Then writing program and compile!!
"undefined reference to" is a linker error. You forgot to link your application against the OpenCV libraries. Make sure you link against cv and highgui (-lcv -lhighgui) or use the pkg-config call that Tobu provided. I'd also second the request for more detailed error messages.
OpenCV uses pkg-config, the standard way to locate libraries and headers on unix. You can run (untested):
make CFLAGS="$(pkg-config --cflags --libs opencv)" your-program

Resources