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

Getting Linker errors in Xcode project. #17

Open
barnaclau opened this issue May 8, 2014 · 3 comments
Open

Getting Linker errors in Xcode project. #17

barnaclau opened this issue May 8, 2014 · 3 comments

Comments

@barnaclau
Copy link

When I try to compile the Xcode project I get three linker errors:

clang: error: no such file or directory: '/opt/local/lib/libX11.dylib'
clang: error: no such file or directory: '/opt/local/lib/libXext.dylib'
clang: error: no such file or directory: '/opt/local/lib/libXrandr.dylib'

I couldn't find any documentation indicating any additional installs required to run the project.

I'm trying to compile the included Xcode project under the 1.0.0 release over here: https://github.com/google/liquidfun/releases

I'm running Mac OS X Version 10.9.2, Xcode Version 5.0.2. Additionally, I do have the latest XQuartz (X11) installed.

As a note, running the Xcode generated through Cmake does work.

@jsanmiya
Copy link
Contributor

Hi,

I have those files in /usr/X11/lib. Perhaps you can check that they are there, and that that directory is on your search path?

screen shot 2014-07-21 at 8 53 21 am

@m4b
Copy link

m4b commented Dec 15, 2014

I received the same linking errors in the premade xcode project. In short, resolved the issue by changing the bad /opt/local/lib references in each place in the xcode project to /opt/X11/lib. Perhaps earlier versions of Xquartz installed to /opt/local/lib? I don't know. I installed the latest version, 2.7.7: http://xquartz.macosforge.org/landing/

If you ls -al /usr/X11 you should see that it symlinks to /opt/X11:

lrwxr-xr-x  1 root  wheel  8 Nov  4 16:55 /usr/X11 -> /opt/X11

As a result, I had to change the linking flags for freeglut, et. al, from /opt/local/lib to /opt/X11/lib.

(/opt/local/lib actually makes no sense, lib should be prefixed with a library directory, i.e., X11, or whatever the library is, and not local, in the first place). I've attached a photo of the linking flags that need to change. I'm not sure how you're generating your xcode project, otherwise I would have made a pull request with the changes.

screen shot 2014-12-14 at 8 02 55 pm

@mlaico
Copy link

mlaico commented Jan 24, 2015

I got it to build very easily by generating the Xcode project

cd liquidfun/Box2D
cmake -G "Xcode"

But, I had to add

find_package (Threads)

to CMakeLists.txt, after the line

project(Box2D)

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