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

Linker errors with compiled libraries on OS X #32

Closed
birarda opened this issue Jun 30, 2014 · 13 comments
Closed

Linker errors with compiled libraries on OS X #32

birarda opened this issue Jun 30, 2014 · 13 comments

Comments

@birarda
Copy link

birarda commented Jun 30, 2014

On OS X 10.9.3 I'm having issues linking the compiled rtmidi libraries, static or dynamic.

Both cause me to get a linker error no matter what API function I call from my application.

I've defined MACOSX_CORE.

Undefined symbols for architecture x86_64:
  "RtMidi::getCompiledApi(std::vector<RtMidi::Api, std::allocator<RtMidi::Api> >&)", referenced from:
      Application::Application(int&, char**, QElapsedTimer&) in Application.o
@garyscavone
Copy link
Contributor

Hi Stephen,

Did you figure out your problem? It seems you are using Qt and from my experience, you can get linker errors because the SDK that Qt is pointing to is different from the one it was compiled with.

—gary

On Jun 30, 2014, at 5:40 PM, Stephen Birarda notifications@github.com wrote:

On OS X 10.9.3 I'm having issues linking the compiled rtmidi libraries, static or dynamic.

Both cause me to get a linker error no matter what API function I call from my application.

I've defined MACOSX_CORE.

Undefined symbols for architecture x86_64:
"RtMidi::getCompiledApi(std::vector<RtMidi::Api, std::allocatorRtMidi::Api >&)", referenced from:
Application::Application(int&, char**, QElapsedTimer&) in Application.o


Reply to this email directly or view it on GitHub.

@birarda
Copy link
Author

birarda commented Jul 7, 2014

Does RtMidi require Qt to build?

Edit: It does not, from what I can see. Maybe I'm confused about what you mean.

@garyscavone
Copy link
Contributor

Not at all. I was just pointing out that if you try to use RtMidi together with Qt (which appeared to be the case), then linker errors can result because of the Qt settings.

—gary

On Jul 7, 2014, at 2:29 PM, Stephen Birarda notifications@github.com wrote:

Does RtMidi require Qt to build?


Reply to this email directly or view it on GitHub.

@birarda
Copy link
Author

birarda commented Jul 7, 2014

Ahh - are you talking about the OS X SDK?

@garyscavone
Copy link
Contributor

OK, I was confused by the “Application” reference.

Anyway, is this still a problem?

—gary

On Jul 7, 2014, at 2:42 PM, Stephen Birarda notifications@github.com wrote:

Ahh - are you talking about the OS X SDK?


Reply to this email directly or view it on GitHub.

@birarda
Copy link
Author

birarda commented Jul 7, 2014

Yeah - if I compile RtMidi and then link to the static or dynamic libs I get this. No error if I just include the RtMidi header and cpp file in my project.

@drewish
Copy link
Contributor

drewish commented Jul 8, 2014

I ran into a similar sounding issue on another project. Worth making sure both are linking to the same stdlib.

@birarda
Copy link
Author

birarda commented Jul 8, 2014

Awesome @drewish I think you nailed it.

Clang defaults to compile RtMidi with libc++ and our project is libstdc++ causing linker errors with std::string. Now I just have to figure out why clang cannot find the OS X framework headers if I try to compile with libstdc++.

@drewish
Copy link
Contributor

drewish commented Jul 8, 2014

See if dberesford/exiv2node#26 has any clues.

@MartinDelille
Copy link
Contributor

Can RtMidi be compiled with libstdc++ to avoid this problem?

@birarda
Copy link
Author

birarda commented Jul 25, 2014

To avoid having to fix this with other dependencies in the future anyways we're going to move our project over to libc++. Thanks for helping me figure this out!

@MartinDelille
Copy link
Contributor

👍 For now it's working including the file directly in the project and defining MACOSX_CORE

@drewish
Copy link
Contributor

drewish commented Feb 17, 2015

@garyscavone I think this can be closed.

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