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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:48:32+00:00 2026-06-14T06:48:32+00:00

I’m using a cross platform GUI library (FLTK) to make some GUI with, I’m

  • 0

I’m using a cross platform GUI library (FLTK) to make some GUI with, I’m not using the Win32 API. I want this program to run on a Windows, Linux and Mac OS.

I don’t really get how cross platform mumbo jumbo works (look at my account name),
but I think understand what it means to be cross platform. But that’s not my question.

My problem is that my entry function right now is simply int main(),
but when I use this entry function, the console pops up. I don’t want any consoles,
so I know that I could make my entry function like this:

int wWinMain(HINSTANCE hInst, HINSTANCE hPreInst, LPWSTR nCmdLine, int nCmdShow)

and there would be no console.

My fear is that since I have to use the Win32 API to have this wWinMain entry function (because of the HINSTANCEs and the LPWSTR), the program would no longer be compatible with other OS’s.

So my question is, will my program work on a Mac and Linux OS if I use the wWinMain function? If not, is there a function that I can use that creates no console and will work on all OS’s?

Finally, perhaps I’m completely delusional about being able to have the same .exe
program work on any OS, and that is in fact not possible. Is this so?

  • 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-14T06:48:33+00:00Added an answer on June 14, 2026 at 6:48 am

    *NIX systems shouldn’t spawn terminal windows by default, so you’ll probably only have to do something special on Windows.

    If you can wrap the WinMain function, that is, put #define guards around it and call another function that acts as the “real” main inside of it, and then call that function from main on other platforms there should be no major issues.

    However, I’d strongly suggest avoiding wide characters (wchar_t) whereever possible because they differ from platform to platform and handling platform-specific API calls that need them by internally storing all strings as, for instance, UTF-8, converting them (For example via MultiByteToWideChar) only to make the API call.

    Basically, non-Windows platforms will need you to use a standard main function, Windows will need you to use WinMain. Make them both call a third function that handles what your main function should and return.

    Also, any Windows PE binary (.exe file) will only work on Windows. You’ll have to compile your program for each platform separately regardless of what you do.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm making a simple page using Google Maps API 3. My first. One marker
I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but

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.