How to create systemless C++ code?

I want to write C++ that compiles for any system. No windows specific libraries.

The question is: where can I find a guide or a list of things that can be used for any system and are not windows specific?

Other urls found in this thread:

en.cppreference.com/w/cpp/links/libs
github.com/fffaraz/awesome-cpp
twitter.com/SFWRedditImages

Have a compiler that compiles for every system, or make a VM for every system like Java

what kind of program do you want to make? what libraries do you need?

if you stick to standard C++ it will compile with any C++ compiler without the need for platform specific libraries. that is the whole point of the standard.

if you want to do GUI stuff then you are gonna have a bad time.

it really depends on what you want your program to do.

just console io? then you're fine.
anything much beyond this will require more work if you just mean "any system" = windows/linux/mac and will be impossible if you really mean *truly any*.

just use D / Rust / Go

>No windows specific libraries

This isn't difficult. There's plenty of open source libraries for various tasks that are multiplatform. That said, as soon as you go outside of the Windows/Mac OS X/Linux trio, your options start to decrease fast.

In any case, if you're looking for a decent sized list of popular libraries sorted by category, here's a start:

en.cppreference.com/w/cpp/links/libs
github.com/fffaraz/awesome-cpp

die in a fire with your hipster languages

is there even system-agnostic sleep(); in C++? last time I checked you had to fuck with some weird functions in linux

If sleep() is defined in the c++ spec then any libc++ must support it, meaning some other faggot wrote it for you for that OS's special snowflake requirements

std::this_thread::sleep_for(5s)

what about C?

sleep() or nanosleep() ?

Go for Java.
Seriously.

this.

maybe you should try qt?

but it's slow and uses too much memory :(

Why don't you use Boost :^) ?
>Literally the standard answer under every StackOverflow question about C++

>it's slow
not been an issue for me in terms of general use applications for maybe 10 years.

>and uses too much memory :(
again not an issue for about 10 years as memory is so cheep

sure i wouldnt want to write a game like Titanfall 2 or an H265 codec in Java but for a desktop program it is more than good enough.

>D
>hipsters
lol

have fun with your segfaults

if the header file includes "win32" then don't include it... not that hard

Write your software in Object Pascal instead.

This tbqh. I've been doing platform-independent C++ development since I learned the language. If a library isn't platform independent I won't even look at it, but most are.

Use boost and the standard library.
If the standard library or boost can't do it, quietly weep.

I don't really know, but the term your looking for is "platform agnostic"

Try googling under that term and see what you can find.

*you're

Fuck, I never screw that up. I should probably go to sleep. It's 3:30 and I have to get up at 8:30

Unless het wants to do graphics or audio that's not a big issue.
And even then there are some portable options.

Use FreePascal.

The Compiler will tell you that sleep() I'd deprecated. On windows I use system("timeout s") but that's windows specific. Actually windows 7 or 8 + specific...

Use Boost, the standard library and if you need a GUI, Qt. That should be portable to the vast majority of your user base's platforms.

>again not an issue for about 10 years as memory is so cheep

It was never about memory, it was about cache.

>the compiler is the reason
wow
stop posting

He can just use Qt if he wants to use a gui.

Qt is actually just stuffing all the different plattforms GUIs code in your code
>portability in current year of our lord and saviour 2017

1. no
2. true, but far less so than electron

also and
congratulations, you just found out how porting stuff works