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

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.

Related

(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.

Having issues compiling an exploit using GCC

I was trying to compile a C exploit for a security class I'm in and was struggling to get GCC to perform. The issue is that my /usr/include folder is missing folders that GCC is looking for to handle the includes of the file. The first error below describes a folder that doesn't exist.
asm/page.h: No such file or directory
What I've tried so far:
Symlink it with my /usr/src/linux-headers-4.4.0-kali1-common/include/* folders, but files within that folder start throwing errors that they in turn can't find other files.
Using GCC's -I parameter to manually specify each folder to look in for my includes but this also doesn't work. (Below)
gcc 10613.c -o workdamnit-I/usr/src/linux-headers-4.4.0-kali1-common/include/asm-generic/ -I/usr/src/linux-headers-4.4.0-kali1-common/include/linux/ -I/usr/src/linux-headers-4.4.0-kali1-common/include/uapi/asm-generic/ -I/usr/src/linux-headers-4.4.0-kali1-common/include/uapi/linux/
ERROR: In file included from /usr/include/stdio.h:33:0,
from 10613.c:2:
/usr/src/linux-headers-4.4.0-kali1-common/include/linux/stddef.h:4:31: fatal error: uapi/linux/stddef.h: No such file or directory
compilation terminated.
I updated the import statement to use page.h from my kali linux common headers. When I tried to run this, I received the below error:
'PAGE_SIZE' undeclared (first use in this function).
Lastly, I tried to compile with wine gcc but this particular exploit uses a socket library that I guess can't be compiled on a windows machine.
GCC version: 5.3.1
Link to exploit: https://www.exploit-db.com/exploits/10613/
My knowledge of C and its compilation requirements is very limited. Any assistance would be greatly appreciated.
Please give a usable and compilable example: https://stackoverflow.com/help/mcve
Based on the errors, it looks like -I/usr/src/linux-headers-4.4.0-kali1-common/include/uapi/linux/ should actually probably be -I/usr/src/linux-headers-4.4.0-kali1-common/include.

error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory

I'm making a C program which is connecting a oracle DB. I have correctly installed the Oracle Instant Client and ocilib.
And I did compile the code without any error but when I executing the program I got following error.
./a.out: error while loading shared libraries: libclntsh.so.11.1: cannot open shared object file: No such file or directory
If anyone know how to solve please write it
Thank you.
Yes I solve it by adding a link of the library to the /usr/lib.
using the following command.
sudo ln -s /home/INSTANT_CLIENT/lib/libclntsh.so.11.1 /usr/lib/libclntsh.so.11.1
You need to setup LD_LIBRARY
export LD_LIBRARY_PATH=/path/instantclient:$LD_LIBRARY_PATH
like
export LD_LIBRARY_PATH=/oracle/instantclient_21_4:$LD_LIBRARY_PATH
Make sure the Examples CD is installed.
Make sure environment variable LD_LIBRARY_PATH is set, and the library file is accessible (permission-wise) for the user who you are logged in as.
If you have checked these and still get the error, please post the output of:
strace ./a.out
LIBPATH environment variable should be pointed to the lib32 folder which contains the libclntsh.
then you need to export LIBPATH variable before you run your application.
Copied from my answer here: Eclipse CDT Auto Include Shared Libraries
Run ldconfig as root to update the cache - if that still doesn't
help, you need to add the path to the file ld.so.conf (just type it in
on its own line) or better yet, add the entry to a new file (easier to
delete) in directory ld.so.conf.d.

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.

Statically Linking glib

I'm trying to statically link glib into my C program. I'm not sure what's the best way to do this. I downloaded the code and put it in a subdirectory called glib-2.36.4. I added "-Iglib-2.36.4" when using gcc. The glib.h is in the glib-2.36.4/glib directory and in that file there are references to other header files under the glib directory (such as #include ).
I'm not sure why that is since both glib.h and these other header files are at the same level (in glib subdirectory). I got a compile error due to galloca.h not being found (even though it's there). So I copied glib.h up one level and those errors went away. I then got an error about a missing glibconfig.h. I copied that from my usr directory and that error went away. I compiled my project and now I'm getting an error about undefined reference to g_ptr_array_new. I guess this must be because I haven't actually compiled glib. I had tried to build glib, but when I typed "./configure", but I got this message:
checking if arpa/nameser_compat.h is needed... configure: error: could not compile test program either way
I did install glib using yum, but I really want this code to run even if glib is not installed on a machine.
You need to install both glib and glib-dev via yum, compile using ./configure, (take a look in the ./configure script to see if there are any flags you need to supply or defines you need to produce the static build), without moving any files about, and then you need to compile your code using -i path/to/glib/includes and link with -L path/to/built/static/library

Resources