|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
Compiler doesn't see headers in /usr/local/include
Hi. If I'm trying to compile anything manually and program includes headers from /usr/local/include, compilers (clang and gcc) print that files are not found and I have to manually edit these programs and change #include <file.h> to #include "/full/path/to/file.h". That problem appeared when I made a fresh install of OpenBSD snapshot.
Example compilations: Code:
$ gcc test.c test.c:1:19: error: check.h: No such file or directory $ cat test.c #include <check.h> int main() { return 0; } $ ls /usr/local/include/check* /usr/local/include/check.h /usr/local/include/check_stdint.h $ cmake .. -- The C compiler identification is Clang 4.0.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Configuring done -- Generating done -- Build files have been written to: /tmp/uTox/build $ make Scanning dependencies of target utoxAV [ 1%] Building C object CMakeFiles/utoxAV.dir/src/av/utox_av.c.o In file included from /tmp/uTox/src/av/utox_av.c:2: /tmp/uTox/src/av/utox_av.h:5:10: fatal error: 'tox/toxav.h' file not found #include <tox/toxav.h> ^~~~~~~~~~~~~ 1 error generated. *** Error 1 in . (CMakeFiles/utoxAV.dir/build.make:63 'CMakeFiles/utoxAV.dir/src/av/utox_av.c.o': /usr/bin/cc -I/usr/include/freetype2 -Wa...) *** Error 1 in . (CMakeFiles/Makefile2:68 'CMakeFiles/utoxAV.dir/all') *** Error 1 in /tmp/uTox/build (Makefile:130 'all') $ ls /usr/local/include/tox/ tox.h toxav.h toxdns.h toxencryptsave.h $ uname -a OpenBSD puffy.pc 6.2 GENERIC.MP#98 amd64 $ |
|
|||
You need to add -I/usr/local/include to your build command.
Not sure why CMake isn't picking it up for uTox, though. |
|
|||
That's not how the compiler works. It doesn't know about any include directories you don't explicitly tell it about (it is told about /usr/include you just don't see it).
This is important for keeping base and ports separate. Having -I/usr/local/include in base compiles could be catastrophic. Same for /usr/X11R6, which is also kept separate. If you need to add -I/usr/local/include to a CMake compile, add: Code:
include_directories(${OPENBSD_LOCALBASE}/include) |
Tags |
bug, clang, gcc, include |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
gcc-4.9.3p0 missing some headers? | notooth | OpenBSD Packages and Ports | 4 | 21st November 2015 04:20 PM |
Viewing manpages: Headers and footers get repeated. | Carpetsmoker | Solaris | 3 | 21st February 2010 02:55 AM |
log from rc.conf.local and rc.local | sdesilet | OpenBSD General | 1 | 21st January 2010 02:37 AM |
Is /usr/X11R6/include/ supposed to be in $CPATH | kasse | OpenBSD General | 4 | 3rd December 2008 05:34 PM |
What include and shared library directories are searched by gcc | kasse | FreeBSD General | 3 | 16th July 2008 08:44 PM |