-
Notifications
You must be signed in to change notification settings - Fork 397
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
Recommended way of adding additional libraries to link against #35
Comments
Simplest way: build the library as a static library in a build script and link to that. If you want to link to a shared library and you are using the If you want to link to a cross compiled shared library provided by ubuntu, e.g. I suggest you base that local image on the ones FROM japaric/i686-unknown-linux-gnu:v0.1.3
# Or build it yourself
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install --no-install-recommends -y libfoo-dev:i386 |
This method, and code from main page, not work.
|
I'd suggest to close this as a dup of #149 as that's basically the same issue and this ticket contains extra information about how to make this work. |
If I understand correctly, this is precisely what was fixed in 3b07a08 |
454: Bump README custom-container cross version to incorporate fixes r=therealprof a=theunkn0wn1 The custom dockerfile example in the README targets cross version 0.1.16, [and is known to not actually work as-is](3b07a08). The fix for this particular issue was released with cross 0.2, thus this PR bumps the cross version. This became an issue in my use case as I wanted to cross-compile to a raspberry Pi, and needed to install some external libraries not included in the base images, and ran into issues such as #149 and #35 while attempting to follow the recommendation in the readme. Bumping the cross version to 0.2.x resolved the above issues for me, and this PR is to help other users that may find themselves running into the same issues when following the readme closely. Co-authored-by: joshua salzedo <[email protected]>
We've documented this now extensively on the wiki, including the following examples: We've also included complete projects using examples both with pre-build hooks and custom Docker images for this purpose. We've also made it a lot simpler, since we've added [build]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH"
] So this code could will actually work for nearly every target (at least those targeting Linux GNU targets with architectures supported by Debian repositories), making this quite a versatile approach. |
@japaric thanks for this awesome project!!
I was just wondering how some one should go about adding additional libraries that need to be linked against. Some projects like https://github.com/plietar/librespot require additional dependencies such as
portaudio19-dev
and maybe some others. I was just wondering what is the appropriate method for adding these into cross so that the project builds correctly.The text was updated successfully, but these errors were encountered: