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 3665344
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:45:00+00:00 2026-05-19T01:45:00+00:00

I am writing an R extension that includes C code that relies on a

  • 0

I am writing an R extension that includes C code that relies on a third-party DLL. Compilation is being done on Windows using Rtools with R 2.11.0. My plan is that the DLL will be distributed with the source package and stored in the extension’s src directory. My question then is how I can cause the compiler to look in the the src directory when it tries to link to the third-party DLL.

Currently, I am building the package with the command:

R CMD build --binary MyPackage

I also have a file src/Makevars with the following line:

PKG_LIBS = -ldlxapi32

This ensures that the third-party DLL, dlxapi32.dll, is included in compilation. However, the compiler cannot find the DLL, since my package’s src directory is not part of the standard library search path.

I have tried to remedy this by changing src/Makevars to read:

PKG_LIBS = -L$(CURDIR) -ldlxapi32

But this fails with output like the following:

gcc -shared -s -static-libgcc -o MyPackage.dll tmp.def dlx.o -L/cygdrive/c/DOCUME~1/abiel/LOCALS~1/Temp/Rbuild709236257/MyPackage/src -ldlxapi32 -Lc:/PROGRA~1/R/R-211~1.0/bin -lR
c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot find -ldlxapi32

Here, we can see that $(CURDIR) evaluated to /cygdrive/c.DOCUME~1/… I was hoping that instead it would evaluate to C:/programming/r/MyPackage/src, which is the actual location of the src directory. Is there a way to fix this?

  • 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-19T01:45:01+00:00Added an answer on May 19, 2026 at 1:45 am

    Instead of the overly complicated -L$(CURDIR), why don’t you just use the equivalent -L. ?

    Also, the Rtools suite uses MinGW which is not Cygwin so I’d avoid paths like /cygdrive/c/… as to MinGW this is still c:/….

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

Sidebar

Related Questions

I'm writing an extension for VS2010 that reorders a page of code by rearranging
I'm writing a Firefox extension that needs to know what the username of the
I am writing a piece of code that to work would require an extensive
I'm using a javascript function that receives some html code that was included using
I'm writing a Chrome extension, and want to write one JS file, that provides
I'm writing a Firefox extension and I need to hook the download dialog that
I am writing a Firefox extension. I would like to search the current webpage
I'm currently writing a TYPO3 extension which is configured with a list of tt_content
How can I go about with writing a shell extension to display online files
Writing the code for the user authentication portion of a web site (including account

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.