Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1826

Library, generated files use incorrect path for Thrift headers

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.9
    • None
    • None
    • CentOS 6.3 on x86 (32-bit)

    • Patch Available

    Description

      By default Thrift's header files for C+GLib are installed beneath /usr/local/include/thrift/c_glib. However, both files generated by Thrift's compiler and Thrift's own (library) header files seem to assume these are available at /usr/local/include/thrift.

      Consequently, by default generated files fail to compile, e.g.:

      $ make
      gcc -g -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -c -o main.o main.c
      In file included from gen-c_glib/hello_world.h:10,
      from main.c:4:
      gen-c_glib/hello_world_types.h:12:34: error: thrift/thrift_struct.h: No such file or directory
      gen-c_glib/hello_world_types.h:13:45: error: thrift/protocol/thrift_protocol.h: No such file or directory

      These files would actually be found at "thrift/c_glib/thrift_struct.h" and "thrift/c_glib/protocol/thrift_protocol.h".

      The easy workaround is to create a symbolic link, i.e.:

      $ cd /usr/local/include/thrift/c_glib
      $ ln -s . thrift

      and then add "/usr/local/include/thrift/c_glib" to the compiler's search path. But it seems to me a better solution would be to

      1. Change the path of the installed header files, perhaps storing them in "/usr/local/include/thrift/c_glib/thrift", which would at least remove the need for the symbol link;

      2. Update the library and the generator to use the correct path in #include statements; or

      3. Have the installer create a symbolic link automatically.

      If there is consensus on the correct fix (I vote for the second) I can spend the time to implement it.

      Attachments

        Activity

          People

            roger Roger Meier
            simonsouth Simon South
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: