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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:57:18+00:00 2026-06-13T00:57:18+00:00

If I want to write my C++ application for multiple platforms, e.g. Windows and

  • 0

If I want to write my C++ application for multiple platforms, e.g. Windows and Linux, what is the recommended way of writing the platform code? What pattern, class hierarchy etc. exists to accomplish this task? How should I organize my code, header and source files?

  • 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-06-13T00:57:19+00:00Added an answer on June 13, 2026 at 12:57 am

    I don’t get your question completely, but generally you should separate your platform dependent code from platform independent one. for example you may have a folder platform and inside it a folder for each platform that supported by you, then you may have win32/mutex.hpp, linux/mutex.hpp, mac/mutex.hpp and in each of them you may add implementation of mutex for that platform. Then all you need is a single selector header that based on platform select correct file and include it. For example platform/mutex.hpp that include any of specified files in correct platform.

    But beside that, take a look at boost it implement many platform dependent code in a platform independent manner, you can learn from it and you may see implementation of your platform dependent code there!!

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

Sidebar

Related Questions

_Hey, I have a question. I want to write application which will have multiple
I want to write an application which should be able to connect to multiple
I am creating Windows Application in C# in which I want to write in
i am creating windows application in C# in which i want to write in
In my application I want to post multiple images using HttpWebRequest. Write now I
Let's say that you want to write an application that processes multiple text files,
i want to write application who send email using outlook and i found this
I want to write an application that takes an XML-schema as input and has
I want to write an application that will automatically detect and fill the text
I want to write an application for Android devices that interacts with the surface

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.