You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changing the module map to create a framework also fixes Xcode without the need for the search path hack. But this change breaks macOS and Linux command line which seem to rely on shared libs.
module COpenSSL {
header "openssl.h"
link framework "COpenSSL"
}
The change is just adding `framework` to the `link "COpenSSL"` line.
With `framework` added, here are the build errors for macOS and Linux (Xcode works)
Ubuntu 14.04
Compile Swift Module 'HTTPExample' (2 sources)
Linking ./.build/debug/SMTPExample
/usr/bin/ld.gold: fatal error: -f/--auxiliary may not be used without -shared
clang: error: linker command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: build had 1 command failures
error: exit(1): /home/qutheory/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2016-08-23-a/usr/bin/swift-build-tool -f /home/qutheory/vapor/engine/.build/debug.yaml
qutheory@qutheory-2:~/vapor/engine$
macOS El Cap
Linking ./.build/debug/HTTPExample
ld: framework not found COpenSSL for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
ld: framework not found COpenSSL for architecture x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: build had 2 command failures
error: exit(1): /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-08-23-a.xctoolchain/usr/bin/swift-build-tool -f /Users/tanner/Developer/vapor/engine/.build/debug.yaml
Gertrude:engine tanner$
TL;DR
`link ...` only works for command lines.
`link framework ...` only works for Xcode.
The text was updated successfully, but these errors were encountered:
The problem is that we generate framework targets in Xcode project so the user provided modulemap fails to link that library because there isn't one.
After some discussion a possible solution right now is generating Xcode projects with a shell script build phase that create symlinks to binaries inside frameworks named lib<library_name>.dylib and add the path to symlink directly in library search path so linker can find and link it.
Additional Detail from JIRA
md5: 0df614a075251ed651eb1426b3eb8b78
is duplicated by:
Issue Description:
Xcode 8 beta 6 with 08-23
COpenSSL from Perfect (https://github.com/PerfectlySoft/Perfect-COpenSSL) has the following module map:
This builds great on macOS and Linux command lines.
But when an Xcode project is generated, I get this error:
This fixes Xcode:
Changing the module map to create a framework also fixes Xcode without the need for the search path hack. But this change breaks macOS and Linux command line which seem to rely on shared libs.
The change is just adding `framework` to the `link "COpenSSL"` line.
With `framework` added, here are the build errors for macOS and Linux (Xcode works)
Ubuntu 14.04
macOS El Cap
TL;DR
`link ...` only works for command lines.
`link framework ...` only works for Xcode.
The text was updated successfully, but these errors were encountered: