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

Error building with Xcode 5.1 #352

Closed
raheelahmad opened this issue Apr 5, 2014 · 26 comments · Fixed by #356
Closed

Error building with Xcode 5.1 #352

raheelahmad opened this issue Apr 5, 2014 · 26 comments · Fixed by #356

Comments

@raheelahmad
Copy link

I followed the README, and at the end I get a few symbols-not-found error upon building the framework. This is on Mavericks with Xcode 5.1.

Undefined symbols for architecture x86_64:
  "_EVP_aes_128_ctr", referenced from:
      _libssh2_crypt_method_aes128_ctr in libssh2.a(crypt.o)
     (maybe you meant: __libssh2_EVP_aes_128_ctr)
  "_EVP_aes_192_ctr", referenced from:
      _libssh2_crypt_method_aes192_ctr in libssh2.a(crypt.o)
     (maybe you meant: __libssh2_EVP_aes_192_ctr)
  "_EVP_aes_256_ctr", referenced from:
      _libssh2_crypt_method_aes256_ctr in libssh2.a(crypt.o)
     (maybe you meant: __libssh2_EVP_aes_256_ctr)
@jlalvarez18
Copy link

+1 I'm getting the same errors in the same environment.

@alanjrogers
Copy link
Contributor

Are you building for iOS or Mac OS ?

@raheelahmad
Copy link
Author

For OS X. Tried it on multiple machines. Maybe all fresh installs are suffering from this?

@alanjrogers
Copy link
Contributor

@raheelahmad Are you getting this error trying to build your application? or is it when you try to build the Framework directly via the xcworkspace.

@raheelahmad
Copy link
Author

This is for building the ObjectiveGit framework from the project's .xcworkspace.

@jspahrsummers
Copy link
Contributor

/cc @robrix?

@raheelahmad
Copy link
Author

FWIW, tried a fresh install on another machine, with the same issue.

I could be carrying around bad luck with me though.

@alanjrogers
Copy link
Contributor

I can't reproduce the error at all.

@jlalvarez18
Copy link

I receive the same errors. Fresh install. Using the workspace. On master branch.

  • Juan

On Apr 11, 2014, at 1:01 AM, Alan Rogers [email protected] wrote:

I can't reproduce the error at all.


Reply to this email directly or view it on GitHub.

@mdiep
Copy link
Contributor

mdiep commented Apr 11, 2014

Have you run script/bootstrap successfully?

@jlalvarez18
Copy link

Yes. All is installed. The issue has to do with libssh. Any thoughts?

On Apr 11, 2014, at 9:00 AM, Matt Diephouse [email protected] wrote:

Have you run script/bootstrap successfully?


Reply to this email directly or view it on GitHub.

@robrix
Copy link
Contributor

robrix commented Apr 11, 2014

Will investigate today if at all possible.

@jlalvarez18
Copy link

Just in case this is the full error:

Ld /Users/juanalvarez/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eorvvmvtuzyowsbfkuyunplaaezs/Build/Products/Debug/ObjectiveGit.framework/Versions/A/ObjectiveGit normal x86_64
    cd /Users/juanalvarez/dev/personal/objective-git
    export MACOSX_DEPLOYMENT_TARGET=10.7
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -L/Users/juanalvarez/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eorvvmvtuzyowsbfkuyunplaaezs/Build/Products/Debug -L. -LExternal -F/Users/juanalvarez/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eorvvmvtuzyowsbfkuyunplaaezs/Build/Products/Debug -filelist /Users/juanalvarez/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eorvvmvtuzyowsbfkuyunplaaezs/Build/Intermediates/ObjectiveGitFramework.build/Debug/ObjectiveGit.build/Objects-normal/x86_64/ObjectiveGit.LinkFileList -install_name @rpath/ObjectiveGit.framework/ObjectiveGit -mmacosx-version-min=10.7 -lgit2 -force_load External/libgit2.a /usr/local/lib/libssh2.a -fobjc-arc -fobjc-link-runtime -liconv -lssl -lcrypto -framework Cocoa -lz -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/juanalvarez/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eorvvmvtuzyowsbfkuyunplaaezs/Build/Intermediates/ObjectiveGitFramework.build/Debug/ObjectiveGit.build/Objects-normal/x86_64/ObjectiveGit_dependency_info.dat -o /Users/juanalvarez/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eorvvmvtuzyowsbfkuyunplaaezs/Build/Products/Debug/ObjectiveGit.framework/Versions/A/ObjectiveGit

Undefined symbols for architecture x86_64:
  "_EVP_aes_128_ctr", referenced from:
      _libssh2_crypt_method_aes128_ctr in libssh2.a(crypt.o)
     (maybe you meant: __libssh2_EVP_aes_128_ctr)
  "_EVP_aes_192_ctr", referenced from:
      _libssh2_crypt_method_aes192_ctr in libssh2.a(crypt.o)
     (maybe you meant: __libssh2_EVP_aes_192_ctr)
  "_EVP_aes_256_ctr", referenced from:
      _libssh2_crypt_method_aes256_ctr in libssh2.a(crypt.o)
     (maybe you meant: __libssh2_EVP_aes_256_ctr)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Hope this helps :)

@raheelahmad
Copy link
Author

My best guess is that this is because of a newer version of libssh2 which seems to be incompatible.

I have 1.4.3 according to brew list libssh2.

@robrix
Copy link
Contributor

robrix commented Apr 14, 2014

Curious. I have 1.4.3 as well. Sorry for the delay in looking into this, Friday spun away from me. Top of my list today tho.

@robrix
Copy link
Contributor

robrix commented Apr 14, 2014

I can’t reproduce this either:

Ld /Users/rob/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eiomkpixcxwgokhbirorltcumiwg/Build/Products/Debug/ObjectiveGit.framework/Versions/A/ObjectiveGit normal x86_64
    cd /Users/rob/Developer/GitHub/libgit2/objective-git
    export MACOSX_DEPLOYMENT_TARGET=10.7
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -L/Users/rob/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eiomkpixcxwgokhbirorltcumiwg/Build/Products/Debug -L. -LExternal -F/Users/rob/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eiomkpixcxwgokhbirorltcumiwg/Build/Products/Debug -filelist /Users/rob/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eiomkpixcxwgokhbirorltcumiwg/Build/Intermediates/ObjectiveGitFramework.build/Debug/ObjectiveGit.build/Objects-normal/x86_64/ObjectiveGit.LinkFileList -install_name @rpath/ObjectiveGit.framework/ObjectiveGit -mmacosx-version-min=10.7 -lgit2 -force_load External/libgit2.a /usr/local/lib/libssh2.a -fobjc-arc -fobjc-link-runtime -liconv -lssl -lcrypto -framework Cocoa -lz -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/rob/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eiomkpixcxwgokhbirorltcumiwg/Build/Intermediates/ObjectiveGitFramework.build/Debug/ObjectiveGit.build/Objects-normal/x86_64/ObjectiveGit_dependency_info.dat -o /Users/rob/Library/Developer/Xcode/DerivedData/ObjectiveGitFramework-eiomkpixcxwgokhbirorltcumiwg/Build/Products/Debug/ObjectiveGit.framework/Versions/A/ObjectiveGit

@robrix
Copy link
Contributor

robrix commented Apr 14, 2014

@raheelahmad you called it—brew upgrade libssh2 and now I can’t build either, with the same errors.

@robrix
Copy link
Contributor

robrix commented Apr 14, 2014

Okay, so it looks like what’s happened is:

  • brew’s formula for libssh2 now depends on brew’s keg-only openssl, and therefore cannot be linked against system ssl (-lssl)
  • unfortunately since ssl is keg-only, we can’t just add /usr/local/lib to the library search paths since brew avoids putting libssl.a and libcrypto.a there
  • I was able to link correctly against the updated libssh2 by removing libssl from the target’s link build phase, and instead adding /usr/local/Cellar/openssl/1.0.1g/lib/libssl.a and /usr/local/Cellar/openssl/1.0.1g/lib/libcrypto.a to its Other Linker Flags setting
  • since that would necessarily break the build for everyone who hasn’t updated yet, I’m going to see if we can make this link by adding /usr/local/Cellar/openssl/1.0.1g/lib/ to the library search paths

Further bulletins as events warrant.

@alanjrogers
Copy link
Contributor

I did a brew upgrade today, and now I'm running into this when trying to build from eed65a7.

brew list libssh says I have 1.4.3_1

@alanjrogers
Copy link
Contributor

I've noticed that the symlinks for libcrypto.a and libssl.a point to /usr/local/opt/openssl/lib/ Which doesn't exist for me. Probably because I'm using boxen.

@alanjrogers
Copy link
Contributor

FWIW I've fixed this in the meantime with a symlink for the opt directory.

ln -s /opt/boxen/homebrew/opt /usr/local/opt

@robrix
Copy link
Contributor

robrix commented Apr 29, 2014

This was fixed for the default homebrew dir, yes.

@alanjrogers
Copy link
Contributor

@robrix It was my understanding that it would fallback to use the system libssl if the symlinks went nowhere?

@robrix
Copy link
Contributor

robrix commented Apr 30, 2014

It will, yes, but the problem is (IIRC) that you’ve got a libssh that can’t be linked with system libssl because system libssl lacks some of the symbols.

Interestingly, OpenSSH can now be built without dependencies on OpenSSL. I doubt that has made its way into homebrew yet, but it might make for a path out of this hell.

@robrix
Copy link
Contributor

robrix commented Oct 8, 2014

This just bit @haacked, and that symlink didn’t help because opt/openssl is itself a symlink to ../Cellar/openssl/1.0.1i

This got him going:

ln -s /opt/boxen/homebrew/Cellar /usr/local/Cellar

@joshaber
Copy link
Member

Pretty old and we've recently cleaned up the libgit2 building process: #483

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

Successfully merging a pull request may close this issue.

7 participants