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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:26:12+00:00 2026-05-19T17:26:12+00:00

I recently went from a 32bit laptop to a 64bit desktop (both win7). I

  • 0

I recently went from a 32bit laptop to a 64bit desktop (both win7). I just found out that I get an error now when loading dll’s using dyn.load. I guess this is a simple mistake and I am overlooking something.

For example, I write this simple c function (foo.c):

void foo( int *x) {*x = *x + 1;}

Then compile it in command prompt:

R CMD SHLIB foo.c

Then in 32bit R I can use it in R:

> dyn.load("foo.dll")
> .C("foo",as.integer(1))
[[1]]
[1] 2

but in 64bit R I get:

> dyn.load("foo.dll")
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared object 'C:/Users/Sacha/Documents/R/foo.dll':
  LoadLibrary failure:  %1 is not a valid Win32 application.
nd.

Edit:

For reference, R CMD can be forced in an architecture by using --arch 64x :

R --arch x64 CMD SHLIB foo.c

Quite clear actually, I knew I was making a rooky mistake:)

  • 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-19T17:26:12+00:00Added an answer on May 19, 2026 at 5:26 pm

    My guess is that you are compiling it to a 32 bit target. You need to build it on your 64 bit machine with 64 bit tools. You can’t load a 32 bit DLL into a 64 bit process, and vice versa.

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

Sidebar

Related Questions

I have recently picked up a project from a few months ago. Went to
I recently reinstalled my development machine and went from 32 bit Windows Vista to
For some reason a website that recently went live has now completely screwed in
The small devteam I'm on just recently went cold turkey on Visual SourceSafe and
Safari recently went to version 6 (Lion/Mtn Lion) and they've changed over from the
We recently released an android application that pulls information from an external server. Last
I just recently started looking into WatiN and was following the example from http://www.codeproject.com/KB/aspnet/WatiN.aspx
I recently moved over from 1.3 to 2.0 of CakePHP. The migration went well,
Recently one of our app servers went down, when it was rebooted the Python
i've recently released an app to the App store, i went to have a

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.