Code::Blocks

User forums => Using Code::Blocks => Topic started by: Panama on December 12, 2019, 07:37:21 pm

Title: header files not found
Post by: Panama on December 12, 2019, 07:37:21 pm
System: Linux Mint 19
Code::Blocks 17.12 -flatpak-
Problem: after a missing libusb I've installed the libusb-1.0_dev. The necessary library is here:

/usr/include/libusb-1.0/libusb.h

I've added the path for the compiler: /usr/include/libusb-1.0
Compiling fails!
Buildlog:
gcc -Wall -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/libdrm -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -pg -g -rdynamic -I/usr/include/gtk-3.0 -I/usr/include/gtk-3.0 -I/usr/include/libusb-1.0 -c /home/axel/Projects/Aqualampe_cb/callbacks.c -o obj/Debug/callbacks.o
In file included from /home/axel/Projects/Aqualampe_cb/callbacks.c:30:0:
/home/axel/Projects/Aqualampe_cb/callbacks.h:26:20: fatal error: libusb.h: No such file or directory
 #include <libusb.h>

By typing  #include "  in the editor I got a hugh list of known *.h files. But libusb.h wasn't in there. Where Code::Blocks got these list or build it? Maybe this is the problem?

Cheers, Panama
Title: Re: header files not found
Post by: oBFusCATed on December 12, 2019, 09:30:52 pm
Code::Blocks doesn't work well/at all if packaged as a flatpak.
Please report this to the person which provided you the flatpak.
We cannot help you at the moment, because supporting flatpaks correctly requires a major redesign of our compiler plugin (at least) and we don't have the resources to do it at the moment.
Title: Re: header files not found
Post by: Panama on December 12, 2019, 09:53:58 pm
Thank you obfuscated!

I'll try to install the distro package (it will be the 16.xx version).
I found another issue: the linker call has "-lusb" instead of "-llibusb". So the linking will fail.
Where got CodeBlocks these calls? I couldn't find any makefile for my project. Could you please explain or is it part of the flatpak?

Cheers, Panama
Title: Re: header files not found
Post by: oBFusCATed on December 13, 2019, 12:10:01 am
I found another issue: the linker call has "-lusb" instead of "-llibusb". So the linking will fail.
-lusb is correct. The linker would automatically prepend the lib when searching for the file.
Title: <SOLVED>Re: header files not found
Post by: Panama on December 13, 2019, 01:28:04 pm
Obfuscated: you are totaly right; with CB16.01 -distro package- it is working fine. And the libusb is obviously found.
-Thanks a million-