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

  • Home
  • SEARCH
  • 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 6193883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:11:55+00:00 2026-05-24T03:11:55+00:00

I am using Boost 1.44.0 to cross-compile C++ code for Python. I’m trying to

  • 0

I am using Boost 1.44.0 to cross-compile C++ code for Python. I’m trying to expose a static constant defined in ExposureSinusoid.h like this:

static const UINT _min_exp = 20;

And in the file extending.cpp, I am trying to expose them like this, according to documentation from the Boost team:

.def_readonly("_min_exp", &ExposureSinusoid::_min_exp)

The library compiles fine but when the program runs I get the following error:

ImportError: ../linux/appfs/master/usr/lib/python2.6/pa/vision/_vision.so: undefined symbol: _ZN16ExposureSinusoid8_min_expE

To rule out the possibility the Boost wasn’t finding the constant, I tried changing its name in extending.cpp and the library failed to compile. So it seems like the constant is being found during compilation but it isn’t being properly exposed.

  • 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-24T03:11:55+00:00Added an answer on May 24, 2026 at 3:11 am

    In addition to being declared, static data members must also be defined.

    // ExposureSinusoid.h
    class ExposureSinusoid
    {
        // ...
    public:
        static const UINT _min_exp = 20;   // declaration
        // ...
    };
    
    // ExposureSinusoid.cpp
    const UINT ExposureSinusoid::_min_exp; // definition
    

    The only scenario where the definition of a static data member may be omitted is when the data member in question is a const fundamental integral type, and it is initialized with a constant expression, and it is never ODR-used (see the C++03 standard, §9.4.2/4); however, taking the address of a variable qualifies as ODR-usage, so in your case a definition must be supplied.

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

Sidebar

Related Questions

I'm using boost::asio, and I have code like this: void CServer::Start(int port) { tcp::acceptor
I'm trying to develop a cross-platform application using C++ with boost. I typically program
I'm using boost::filesystem for cross-platform path manipulation, but this breaks down when calls need
I am using boost shared_ptr with my own memory manager like this (stripped down
Using boost build, if I can link to a boost python library with this
The following code using boost::asio will not compile: #ifndef _SERVER_H_ #define _SERVER_H_ #include Connection.h
Consider the following code. using boost::shared_ptr; struct B; struct A{ ~A() { std::cout <<
I'm trying to work on a cross-platform project that uses boost for the file/directory
I'm writing a cross-platform server program in C++ using Boost.Asio. Following the HTTP Server
I've been using boost::mutex::scoped_lock in this manner: void ClassName::FunctionName() { { boost::mutex::scoped_lock scopedLock(mutex_); //do

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.