Skip to content

Configuration header leaked into public interface in v. 1.17.0 #291

@ziotom78

Description

@ziotom78

Hi, I am trying to compile the following program using libfswatch 1.17:

#include <libfswatch/c/libfswatch.h>
#include <stdio.h>

void my_callback(fsw_cevent const *const events, const unsigned int event_num, void * data) {
    puts("Called!");
}

int main() {
    // Initialize the library
    fsw_init_library();

    // Use the default monitor.
    const FSW_HANDLE handle = fsw_init_session(system_default_monitor_type);
    fsw_add_path(handle, "my/path");
    fsw_set_callback(handle, my_callback, NULL);
    fsw_start_monitor(handle);
}

I downloaded and installed the tarball for version 1.17 using the instructions found in the INSTALL file:

$ ./configure --prefix=$HOME/fswatch1.17 && make && make install

but the compiler complains about a missing libfswatch/libfswatch_config.h:

$ gcc -o test $(pkg-config --with-path $HOME/fswatch1.17/lib/pkgconfig --cflags --libs libfswatch) test.c
/home/tomasi/fswatch1.17/include/libfswatch/c/libfswatch_types.h:31:10: fatal error: libfswatch/libfswatch_config.h: No such file or directory
   31 | #include "libfswatch/libfswatch_config.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
$

However, the very same program compiles correctly if I install the tarball for version 1.16 and use it instead of 1.17:

$ gcc -o test $(pkg-config --with-path $HOME/fswatch1.16/lib/pkgconfig --cflags --libs libfswatch) test.c
$

It seems that the file libfswatch_types.h needs to include libfswatch_config.h because of this commit, but the file does not get installed by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions