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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T11:21:47+00:00 2026-05-30T11:21:47+00:00

I am not sure if this is possible, but I am trying to open

  • 0

I am not sure if this is possible, but I am trying to open a URL in the users default browser in C++. I would just use ‘ShellExecute’, but I am trying to make it cross platform. Anyone know any ways that this is possible, if it is?

By cross platform I mean the 3:

  • Linux
  • Windows
  • Mac

I’ve literally Google search for sooo long, and found nothing. Thanks for any help 🙂

  • 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-30T11:21:49+00:00Added an answer on May 30, 2026 at 11:21 am

    Your best bet is to use a cross platform library like Qt or something like that. Qt has a nice class called QDesktopServices which you can use to do it:

    QDesktopServices::openUrl(QUrl("http://google.com", QUrl::TolerantMode));
    

    According to the documentation:

    Opens the given url in the appropriate Web browser for the user’s
    desktop environment, and returns true if successful; otherwise returns
    false.

    Do note that this will add an dependency on Qt for all your platforms for what might be a very trivial task. It is best that you use custom code for each platform and set compiler directives to see which operating system you are on and run the browser launching code according to that.

    Like, if it is being compiled on windows, you could just compile ShellExecute function, if it is being run on Linux, then depending on the desktop environment you could run the appropriate command.

    But, if you are really making a cross platform application, a dependency like Qt would not be bad as it will help with a lot of cross-platform stuff (like keeping an icon in the system tray, multimedia playback etc.).

    Without a library, there is no standard-C++ way to do it that will run on all platforms.

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

Sidebar

Related Questions

Not sure this is possible, but looking to write a script that would return
Not sure if this is possible, but here is what I am trying to
I am not sure if this is even possible but I am trying to
Not sure if this is even possible but I am trying to save text
I'm not sure this is possible, but I'm trying to pull a YouTube video
I'm not sure if this possible but probably is fairly simple. I've made a
I'm not sure this is even possible but I know if it is, the
I'm not sure if this is possible but I want to see objects created
I'm not sure if this is possible but I'd like to be able to
I'm not sure if this is possible but as I was looking for 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.