1

I am trying to fallow Vertica instructions to compile their sample file, but getting the below error:

./include/Vertica.h:62:10: fatal error: 'libintl.h' file not found

I am running this script:

g++ -D HAVE_LONG_INT_64 -I ./include -I -Wall -shared -Wno-unused-value -fPIC -o MyUDF.so StringTokenizer.cpp ./include/Vertica.cpp

I have also been trying to install getText using homebrew and made the following exports:

  export LDFLAGS="-L/usr/local/opt/gettext/lib"
  export CPPFLAGS="-I/usr/local/opt/gettext/include"

Any idea how to resolve my error?

Edit

When manually providing -L/usr/local/opt/gettext/lib -I/usr/local/opt/gettext/include getting new error:

Undefined symbols for architecture x86_64:
  "_libintl_gettext", referenced from:
      gettext(char const*) in Vertica-9f5253.o

Edit 2: Solved

This is the solution that worked out for me:

g++ -D HAVE_LONG_INT_64 -L /usr/local/opt/gettext/lib -I/usr/local/opt/gettext/include -I ./include -lintl -Wall -shared -Wno-unused-value -fPIC -o MyUDF.so StringTokenizer.cpp ./include/Vertica.cpp

What helped was the addition of -lintl

Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
  • Did you find `libintl.h` when searching your machine? If not you probably need to install another dependency. – πάντα ῥεῖ Oct 04 '18 at 17:48
  • have you tried **g++ -D HAVE_LONG_INT_64 -I ./include -I/usr/local/opt/gettext/include -I -Wall -shared -Wno-unused-value -fPIC -o MyUDF.so StringTokenizer.cpp ./include/Vertica.cpp -L/usr/local/opt/gettext/lib** – 138 Oct 04 '18 at 17:49
  • @138 yeah, now I have a new problem. Updated the question – Ilya Gazman Oct 04 '18 at 17:50
  • How about now? **g++ -D HAVE_LONG_INT_64 -I./include -I/usr/local/opt/gettext/include -Wall -shared -Wno-unused-value -fPIC StringTokenizer.cpp ./include/Vertica.cpp -L/usr/local/opt/gettext/lib -o MyUDF.so** you might have to check/rearrange the order of the args. – 138 Oct 04 '18 at 17:52
  • @138 Same, I also been trying to play with the order a bit more – Ilya Gazman Oct 04 '18 at 17:54
  • 2
    @IlyaGazman Yeah, the order matters. Sorry I can't help much from here, beyond me. I would also make sure that gettext has all the correct binaries and/or headers... Good luck – 138 Oct 04 '18 at 17:56
  • @IlyaGazman You can use the `-Wl,--start-group` and `-Wl,--end-group` linker flags to avoid the need for getting the order right, see [here](https://stackoverflow.com/questions/5651869/what-are-the-start-group-and-end-group-command-line-options) also. – πάντα ῥεῖ Oct 04 '18 at 18:03
  • @πάνταῥεῖ Getting: `unknown option: --start-group` when running: `g++ -D HAVE_LONG_INT_64 -Wl,--start-group -L/usr/local/opt/gettext/lib -I/usr/local/opt/gettext/include -I ./include -Wl,--end-group -Wall -shared -Wno-unused-value -fPIC -o MyUDF.so StringTokenizer.cpp ./include/Vertica.cpp` – Ilya Gazman Oct 04 '18 at 18:10

0 Answers0