I'm trying to compile my pet C project under NetBSD (using 9.1 in i386 flavour).
Specifically, I need libpng and libconfig. Both are installed using pkg_add, both seem to have .so and includes under /usr/pkg path.
Then, when I try to compile my code simply as gcc -c filename.c filename.o, it fails at #include <png.h>.
Further examination of gcc with `gcc -xc -E -v -` shows it doesn't have default include path that point into /usr/pkg/include
I managed to add them via -I or via CPATH env var, then I've managed to do the same for linking via -L or LIBRARY_PATH, then I even got the executable. Which again was unable to find .so under the /ust/pkg/lib , unless I also use LD_LIBRARY_PATH for running it.
I have experience with different linux distros, including ubuntu and gentoo where everything seems to work off-the-box (provided I `apt install` or `emerge` appropriate packages), but here I fail and probably I do smth terribly wrong.
Any suggestions?