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

[SR-152] Cannot Link Against Cairo 2D Graphics Library #816

Closed
swift-ci opened this issue Dec 9, 2015 · 3 comments
Closed

[SR-152] Cannot Link Against Cairo 2D Graphics Library #816

swift-ci opened this issue Dec 9, 2015 · 3 comments

Comments

@swift-ci
Copy link

swift-ci commented Dec 9, 2015

Previous ID SR-152
Radar None
Original Reporter mgage (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Ubuntu GNOME 15.04 using Swift 2.2, oh and don't forget the BASH as shell.

Additional Detail from JIRA
Votes 0
Component/s llbuild, Package Manager
Labels Bug
Assignee mgage (JIRA)
Priority Medium

md5: 895d2f8f39f10b95da36c791bb9b7ebc

Issue Description:

Hi all,
It was recommended I create a ticket, so here it is.

As a test, I just wanted to import the CCairo system module. That and everything else mentioned here will be in a zip archive below. So I created a directory named Sources, and two folders named example and CCairo. I had put a cairo.so.2xxxx file in the "Link: " section of the module.modulemap file, and when run, I had a main.swift file that only had "import CCairo" inside of it.

When ran, the thing spat this:

Linking Executable: .build/debug/example
/usr/bin/ld: cannot find -l/usr/lib/x86_64-linux-gnu/libcairo.so
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
swift-build: exit(1): ["/home/mgage/Downloads/swift-2.2-SNAPSHOT-2015-12-01-b-ubuntu15.10/usr/bin/swift-build-tool", "-f", "/home/mgage/Sources/example/.build/debug/example.o/llbuild.yaml"]

I went on the mailing list with the above machine-jabber, and was told it looks like the linker itself had a bug. I'm using the latest (2.2) and had added the thing to my path so I could use it from anywhere. Also, I'm on Ubuntu GNOME 15.04, so to take care of that possible question. Also, I'm new to Swift, but I thought it must be a big deal given that Apple hardly ever does anything like this.

@belkadan
Copy link

belkadan commented Dec 9, 2015

Try using just "cairo" for the link directive. If that doesn't work, try using the path to the generic so (something like "libcairo.so"), rather than the specific version with a suffix.

@swift-ci
Copy link
Author

swift-ci commented Dec 9, 2015

Comment by MGage Morgan (JIRA)

I attempted. Also, would anything mess up if I had ran swift build on both CCairo AND example?

I won't be able to do anything until Friday afternoon.

@swift-ci
Copy link
Author

Comment by MGage Morgan (JIRA)

Cairo is soooooooooooooo much more beautiful in Swift...thanks to the folks on the mailing list who helped me out. It just started working all of a sudden.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants