85748

Symbol not found: _libintl_gettext

I am trying to create a NodeJS module using C++ and node-gyp. The package depends on GNU's Gettext library. I am currently using Mac OS X Mountain Lion. I have tried installing the package myself via manual efforts, via Homebrew, and even via Fink.

The program works via Terminal.app and the package compiles. I can use the .node module just fine, except until I use a method in the library that uses gettext. I get the following errors in REPL and then REPL exits.

dyld: lazy symbol binding failed: Symbol not found: _libintl_gettext Referenced from: /Users/KevinMartin/Dropbox/www/node-locale/build/Release/locale.node Expected in: dynamic lookup dyld: Symbol not found: _libintl_gettext Referenced from: /Users/KevinMartin/Dropbox/www/node-locale/build/Release/locale.node Expected in: dynamic lookup Trace/BPT trap: 5

Thanks in advance.

Answer1:

This is probably happening because you are not listing libintl as a library to be dynamically linked. You need to add something like:

{ "targets": [ { "target_name": "...", "sources": ["..."], "libraries": ["/path/to/gettext/lib/libintl.a"] } }

to your binding.gyp file. libintl isn't being linked in your app, statically or dynamically, that is why you get the symbol error.

Edit:

You can probably also do something like:

{ "targets": [{ "target_name": "...", "sources": [ "..." ], "link_settings": { "libraries": ["libintl.8.dylib"] } }] }

Recommend

  • Output from fortran application not showing up in Matlab
  • jsTree show/hide nodes
  • Aspell won't build on OS X 10.9 (Mavericks)
  • Issue with archive which is not the architecture being linked (x86_64) in C
  • TypeScript 2.0 throws errors from excluded files?
  • UWP Template 10 create a dynamic hamburgermenu
  • Question mark icons showing up for quotation marks when there's a UTF-8 character encoding
  • Maven cannot compile Spring Security demo project
  • applying background to first, and every third row in a dynamically generated table
  • Excel rendered from SSRS loses currency symbold when viewed on iPhone in UK
  • How can I pass complex expression to parametrized active pattern?
  • Installing ocropus-0.4.4
  • cast stl::vector containing pointers to stl::vector containing constant pointers
  • what is side-cast or cross-cast in Dynamic_cast in C++
  • C++ accessing vector
  • Send data from edittext to listview
  • How to merge keras sequential models with same input?
  • How to getText() from the input field of an angularjs Application
  • Function calls are not supported. Consider replacing the function or lambda with a reference to an e
  • Memory error in python- how to use more memory
  • Differences in dis-assembled C code of GCC and Borland?
  • How to revert to previous XCode version?
  • Is playing sound in Javascript performance heavy?
  • Setting up SourceTree to merge unity3d scenes with UnityYAMLMerge
  • Algorithm for a smudge tool?
  • req.body is undefined - nodejs
  • Sony Xperia Z Tablet not found by adb
  • How to recover from a Spring Social ExpiredAuthorizationException
  • Trying to switch camera back to front but getting exception
  • Symfony2: How to get request parameter
  • Large data - storage and query
  • How can I estimate amount of memory left with calling System.gc()?
  • Akka Routing: Reply's send to router ends up as dead letters
  • WOWZA + RTMP + HTML5 Playback?
  • Is there a mandatory requirement to switch app.yaml?
  • Free memory of cv::Mat loaded using FileStorage API
  • Hits per day in Google Big Query
  • Angular 2 constructor injection vs direct access
  • Checking variable from a different class in C#
  • Programmatically clearing map cache