Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6055039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:13:11+00:00 2026-05-23T08:13:11+00:00

Hi I am trying to build an R package using a pre-compiled static library

  • 0

Hi I am trying to build an R package using a pre-compiled static library and a single header file. What is the best way to do so?

Because I didn’t find any information on it (only on creating R packages that compile from src), I settled on writing a thin C++ wrapper class in the extension src directory. I also added the one header file I need for the library to the src directory, and could now theoretically link to the library on my computer (I reckon). However, I’d like to ship that static library with my package, which should also make linking easier (I could just hardcode it to the package directory).

Any ideas?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:13:12+00:00Added an answer on May 23, 2026 at 8:13 am

    First off, any extension package to R containing compiled source code will be dyanmically linked — as R loads it at run-time.

    That said, any external dependencies of your code could be statically linked into the extension package. For that to happen, you could try to just list the static library with its full path in the PKG_LIBS argument — and standard way to enforce static linking.

    Off-hand I cannot think of a CRAN package example using this approach or I’d would suggest it as a stanza.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build a project with the allegro-msvc80-4.2.2 pre-built package. I'm using
I'm trying to build a Python package (pyregion) that contains a *.pyx file and
I'm trying to build a Python extension and package it up using distutils but
I am trying to build a package from source and ./configure tells me I
Im trying to build call to action button on my site using jQuery. I
I am trying to build a sample application using ANT build. But i am
I'm trying to build a simple HTTP Server using Java, using java.net.ServerSocket = new
I'm trying to build a program I've written in C using GNU autotools, but
I'm trying to build a Win32 DLL from an audio-DSP related Linux library (
I am trying to dynamically build a list of admin actions using the get_actions()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.