Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron libportaudio image not found - binding.gyp enhancement #31

Open
DevChanQ opened this issue May 20, 2019 · 3 comments
Open

Electron libportaudio image not found - binding.gyp enhancement #31

DevChanQ opened this issue May 20, 2019 · 3 comments

Comments

@DevChanQ
Copy link

I got hit with the Image not found error for libportaudio when I packaged up my electron application and ran it on a different machine, application ran fine on the development machine though. After digging through some documents about node-gyp, I was suggested to look for the linker section of the naudiodon.node binary and found out that the LC_PATH was set to an absolute path of the build/Release path on my development machine. What I did to make it work was to change the OTHER_LDFLAGS of OS=="mac" to "-Wl,-rpath,@loader_path/" which tells the linker to look for libraries relative to the binary file location.

@scriptorian
Copy link

Hi, thanks for the feedback, I'm sorry you hit a problem.
I don't have access to a Mac at the moment but if you would like to test this change and raise a PR I'm happy to update.

@toontoet
Copy link

toontoet commented Jan 6, 2021

I can confirm this indeed fixes the Image not found problem

@eupston
Copy link

eupston commented May 2, 2021

Can confirm the above works as well. I.E changing to snippet below in binding.gyp:

  "conditions" : [
    [
      'OS=="mac"', {
        'xcode_settings': {
          'GCC_ENABLE_CPP_RTTI': 'YES',
          'MACOSX_DEPLOYMENT_TARGET': '10.7',
          'OTHER_CPLUSPLUSFLAGS': [
            '-std=c++11',
            '-stdlib=libc++',
            '-fexceptions'
          ],
          'OTHER_LDFLAGS': [
            "-Wl,-rpath,@loader_path"
          ]
        },

Please update this if possible. Looks like someone has already put in a PR for this:
#51

Just needs to be approved.

Many thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants