Skip to content

error when build build staticlib #3688

@patrickkh7788

Description

@patrickkh7788

I try build a static lib file libwebrender.a to be used with cpp project with RUSTFLAGS="--crate-type=staticlib" cargo build --release --lib

   Compiling unicode-xid v0.1.0
   Compiling nodrop v0.1.12
   Compiling cfg-if v0.1.3
   Compiling memoffset v0.2.1
   Compiling lazy_static v1.0.0
   Compiling scopeguard v0.3.3
   Compiling byte-tools v0.3.0
   Compiling khronos_api v3.1.0
error: `#[panic_handler]` function required, but not found

error: `#[panic_handler]` function required, but not found

error: `#[panic_handler]` function required, but not found

error: aborting due to previous error

error: aborting due to previous error

error: `#[panic_handler]` function required, but not found
error: `#[panic_handler]` function required, but not found


error: language item required, but not found: `eh_personality`

error: Could not compile `cfg-if`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `memoffset`.
warning: build failed, waiting for other jobs to finish...
error: aborting due to previous error

error: Could not compile `nodrop`.
warning: build failed, waiting for other jobs to finish...
error: `#[panic_handler]` function required, but not found

error: language item required, but not found: `eh_personality`

error: aborting due to 2 previous errors

error: Could not compile `byte-tools`.
warning: build failed, waiting for other jobs to finish...
error: aborting due to previous error

error: aborting due to 2 previous errors

error: Could not compile `scopeguard`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `unicode-xid`.
warning: build failed, waiting for other jobs to finish...
error: build failed

Is this the correct way to build static lib ?

is there a c/cpp header file for the rust api to be used for cpp project?

Activity

kvark

kvark commented on Jun 28, 2019

@kvark
Member

You'd want to look at webrender_bindings, which is the Gecko wrapper around WR that exposes a C API. Gecko build system then runs cbindgen on it in order to obtain the C header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kvark@patrickkh7788

        Issue actions

          error when build build staticlib · Issue #3688 · servo/webrender