dermesser / libsocket

The ultimate socket library for C and C++, supporting TCP, UDP and Unix sockets (DGRAM and STREAM) on Linux, FreeBSD, Solaris. See also my uvco library for a refreshed version!
https://borgac.net/~lbo/doc/libsocket/
Other
805 stars 196 forks source link

Clarification for header file references #11

Closed elfring closed 10 years ago

elfring commented 11 years ago

I am trying to achieve something with a few CMake scripts. Unfortunately, I stumble on a message like the following.

...
[ 67%] Building C object examples/CMakeFiles/get_address_family_c.dir/get_address_family.c.o
...
/home/elfring/Projekte/libsocket/lokal/examples/get_address_family.c:3:38: fatal error: libsocket/libinetsocket.h: No such file or directory
compilation terminated.
...

Other demonstration source files refer to a different header directory. How do you think about to change these references in the way that they can be resolved without the specification of a subdirectory there? (The build system can provide appropriate include parameters if the file names are consistent, can't it?)

dermesser commented 11 years ago

The examples want the header files to be located in the libsocket/ directory somewhere in your include path; make install installs them e.g. to /usr/include/libsocket. Or you just use -I.

elfring commented 11 years ago

I try to build your software without installing the API before. I would find it better when header files do not refer to a specific subdirectory.

dermesser commented 11 years ago

The examples don't need to be built and should not be built by a build system as they are only code examples. And because they should be complete examples of later applications, the include paths should remain like this so developers using the library know how to include header files.

elfring commented 11 years ago

I disagree to this opinion. I find that these header files will be easier to reuse if they do not refer to a prefix explicitly. I guess that the API should not be installed to a directory like "/usr/local/include/libsocket/headers", should it?

The example source files have got also the usual software dependencies for which the build system should take care of.