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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:40:24+00:00 2026-05-27T01:40:24+00:00

I have a kernel project with C files, C libraries and C++ libraries as

  • 0

I have a kernel project with C files, C libraries and C++ libraries as well.

When the project is built such that the main file (.c) has a reference to any function in one of those C++ libraries, the running system is damaged somehow, that is one of the tasks gets the CPU to 100% and never gives it up again.

All tasks are healthy (no HALTED, no SUSPENDED, no EXCEPTION) but that task blocks the overall system by allocating CPU.

That C++ library function is correctly called, can be debugged by breakpoints etc.

It seems that a side effect occurs when it is linked.

The problem is observed even if that C++ library function is just referenced, not even called.

There is no such a problem when using other C++ libraries.

How can you explain this and what points should I focus on?

  • 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-27T01:40:24+00:00Added an answer on May 27, 2026 at 1:40 am

    Are your C++ libraries declaring their functions with the extern "C" construct? See this faq:

    (32.6) How can I create a C++ function f(int,char,float) that is callable by my C code?

    If you want the same C API header file to be usable by both C and C++, you can use the following commonplace trick:

    #ifdef __cplusplus
    extern "C"
    {
    #endif
    
    
    // Function prototypes
    
    
    #ifdef __cplusplus
    } // Closes the extern "C" brace
    #endif
    

    There is no C++ runtime support in the kernel. Things like new, delete, and exceptions will not work. See this blog article for tips on porting C++ code to the kernel.

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

Sidebar

Related Questions

I have a CUDA project. It consists of several .cpp files that contain my
I have a kernel module that provides data to a userland process through read().
I'm building a custom Ubuntu kernel and have modified one of the source files.
The linux kernel (and various other projects including git) have very nice makefiles that
I have set up ninject on my project in the global.asax file... protected void
For a project I'm working on I have to talk to a multi-function chip
How can I store GNU make & configure files elsewhere? I have a project
I have the following makefile that I use to build a program (a kernel,
I have this c++ project in which I call a cuda kernel by means
I have found a line of code that is leaking memory in my project.

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.