C how to install Imilib2-devel

I need to have imlib2 headers so I can figure out how to get my program to work in FreeBSD. where and how would I install the devel side ?
Code:
$ make
c++  -O2 -pipe -std=c++14 -c files.cpp -o files.o
files.cpp:38:10: fatal error: '/usr/include/Imlib2.h' file not found
#include </usr/include/Imlib2.h> //Imlib_Load_Error

This did not work
Code:
Installed packages to be REMOVED:
    imlib2-1.5.1,2

Number of packages to be removed: 1

The operation will free 1 MiB.
[1/1] Deinstalling imlib2-1.5.1,2...
[1/1] Deleting files for imlib2-1.5.1,2: 100%

===>  Installing for imlib2-1.5.1,2
===>  Checking if imlib2 is already installed
===>   Registering installation for imlib2-1.5.1,2 as automatic
Installing imlib2-1.5.1,2...

===>>> Re-installation of imlib2-1.5.1,2 complete
 
If you have gcc9 package installed, then /usr/local/bin/gcc9 is the C compiler, and /usr/local/bin/g++9 is the C++ compiler.

And if you just need any C/C++ compilers, you can use what comes with FreeBSD (i.e. clang), /usr/bin/cc and /usr/bin/c++.
 
FreeBSD default compiler is clang, to run gcc installed from ports you need to run gcc or g++.
no I got errors when trying gcc or g++
Code:
userx@FreeBSD64.net:/usr/home/userx/Downloads/mh5000-1.3.5
$ gcc
bash: gcc: command not found
userx@FreeBSD64.net:/usr/home/userx/Downloads/mh5000-1.3.5
$ g++
bash: g++: command not found
userx@FreeBSD64.net:/usr/home/userx/Downloads/mh5000-1.3.5
$ cc -version
cc: error: unknown argument: '-version'
cc: error: no input files
userx@FreeBSD64.net:/usr/home/userx/Downloads/mh5000-1.3.5
$ cc --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin


userx@FreeBSD64.net:/usr/home/userx/Downloads/mh5000-1.3.5
$ c++ --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin


userx@FreeBSD64.net:/usr/home/userx/Downloads/mh5000-1.3.5
$ clang++ --version
FreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin

I know I just iinstalled gcc 9x the other day, because it was me that did it. meanwhile I try clang++ in my makefile.

well:

Clang did not work either
Ok this is what I got


Code:
userx@FreeBSD64.net:/usr/home/userx/Downloads/mh5000-1.3.5
$ make
clang++  -O2 -pipe -std=c++14 -c files.cpp -o files.o
files.cpp:38:10: fatal error: '/usr/include/Imlib2.h' file not found
#include </usr/include/Imlib2.h> //Imlib_Load_Error
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make: stopped in /usr/home/userx/Downloads/mh5000-1.3.5
 
well UPDATE:

It looks like I Might be having to rework my program if I want it to work in here.


it seems User Contributed Perl Documentation , but what is this to do with plan ole c++ would it still apply by using its namespace per this document, or is this just for perl programming?

use Image::Imlib2; ???
 
If you have gcc9 package installed, then /usr/local/bin/gcc9 is the C compiler, and /usr/local/bin/g++9 is the C++ compiler.

And if you just need any C/C++ compilers, you can use what comes with FreeBSD (i.e. clang), /usr/bin/cc and /usr/bin/c++.
( I just noticed your post)
ok so I just need to add the g++9 in lue of g++ .. interesting. thanks, but I still need the imlib2 development header(s) to use imlib2 in my program.

Code:
$ make
g++9  -O2 -pipe -std=c++14 -c files.cpp -o files.o
files.cpp:38:10: fatal error: /usr/include/Imlib2.h: No such file or directory
   38 | #include </usr/include/Imlib2.h> //Imlib_Load_Error
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
*** Error code 1

Stop.
make: stopped in /usr/home/userx/Downloads/mh5000-1.3.5

I had a brain storm.

Code:
$ sudo find / -type f -iname Imlib2.h
/usr/local/include/Imlib2.h
let me sed my files.
still in learning the system mode.
 
Check -I and -L options in gcc9 man page. Or, if you want a quick answer, do NOT modify the source files, and rather let your compiler know the paths to search for include files and shared libraries (of course, former goes to preprocessor, latter to linker, still they are passed to compiler binary) using -I/usr/local/include and -L/usr/local/lib, respectively.
 
Now I just need to learn how to port it over from Linux to get it to work in FreeBSD
Code:
$ ./mh5000 -over-drive -O /usr/home/userx/Pictures/wallpapers

Segmentation fault (core dumped)
 
Use "-I/usr/local/include" to get the compiler to find the installed header files.
Use "-L/usr/local/lib" to get the linker to find the associated libraries.

Those two solve half the battle of porting anything to FreeBSD.
 
Use "-I/usr/local/include" to get the compiler to find the installed header files.
Use "-L/usr/local/lib" to get the linker to find the associated libraries.

Those two solve half the battle of porting anything to FreeBSD.
what about the usage of Xlib ?
Code:
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
 
what about the usage of Xlib ?
What about Xlib? The include path above covers compiling. You may need an extra path for freetype2. You'll need to name the libraries you want pulled in - as xlib isn't just one library. You've not given an error message or sample code so I can't really answer this question.
 
What about Xlib? The include path above covers compiling. You may need an extra path for freetype2. You'll need to name the libraries you want pulled in - as xlib isn't just one library. You've not given an error message or sample code so I can't really answer this question.
it now compiles w/o error, then core dumps when i try to use it. Look at post #8
I've just not had time to pick it a part yet, and put much if any real thought to this issue yet. Right now, I am still setting up wmaker and getting things situated in there.
 
Back
Top