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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:10:10+00:00 2026-05-29T08:10:10+00:00

I am attempting to pass an Eigen::Vector4d into an function like this: Matrix3d quat2DCM(Vector4d

  • 0

I am attempting to pass an Eigen::Vector4d into an function like this:

  Matrix3d quat2DCM(Vector4d quat)
  {
    quat = quat;
    return Matrix3d::Identity();
    //nevemind the guts of this function, that'l come after this works
  }

the VC++2005 compiler is giving me the following error:

error C2719: ‘quat’: formal parameter with __declspec(align(’16’)) won’t be aligned

Which does not happen for Eigen::Vector3d objects as arguments. I have noticed that in some online discussion that the Vector4d class is particularly picky about it’s alignment, moreso than the other canned typedefs. When using the Vector4d in a class, I found it necessary to use the macro EIGEN_MAKE_ALIGNED_OPERATOR_NEW which overrides the new Is there a similar workaround for passing them s arguments?

  • 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-29T08:10:10+00:00Added an answer on May 29, 2026 at 8:10 am

    According to Eigen’s doccumentation, passing fixed sized eigen objects can “be illegal or make your program crash.” This is because the alignment modifiers Eigen uses are not respected when the objects are passed by value. You should change your function so that it takes a const reference instead.

    Matrix3d quat2DCM(const Vector4d& quat)
    {
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to pass back a Node type from this function, but I
i have been attempting to pass an object into a function that belongs to
I'm attempting to pass an std::function via a method like so: class dispatch {
I'm attempting to pass a pointer to a function that is defined in one
I am attempting to pass a text box value into a SQL query, something
I'm attempting to pass perl variables into a system command and then capture the
I'm attempting to pass the contents of a file into a Webview. Using the
In this example, I'm attempting to pass by value, but the reference is passed
Summary: When attempting to use marshalling to pass string data into a C++ DLL
Language: C++, MFC Problem: I am attempting to pass a function some pointers to

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.