[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

How to create systemless C++ code?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 35
Thread images: 1

File: 1051.png (4KB, 340x340px) Image search: [Google]
1051.png
4KB, 340x340px
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?
>>
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?
>>
>>58668230
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.
>>
>>58668230
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:

http://en.cppreference.com/w/cpp/links/libs
https://github.com/fffaraz/awesome-cpp
>>
>>58668852
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
>>
>>58669084
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
>>
>>58669084

std::this_thread::sleep_for(5s)
>>
>>58669286
what about C?
>>
>>58669344
sleep() or nanosleep() ?
>>
>>58668230
Go for Java.
Seriously.
>>
>>58669602
this.
>>
>>58668230
maybe you should try qt?
>>
>>58669602
>>58669802
but it's slow and uses too much memory :(
>>
>>58668230
Why don't you use Boost :^) ?
>Literally the standard answer under every StackOverflow question about C++
>>
>>58669927
>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.
>>
>>58669007
>D
>hipsters
lol

have fun with your segfaults
>>
>>58668230
if the header file includes "win32" then don't include it... not that hard
>>
Write your software in Object Pascal instead.
>>
>>58670933
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.
>>
>>58668230
Use boost and the standard library.
If the standard library or boost can't do it, quietly weep.
>>
>>58668230
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.
>>
>>58674315
*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
>>
>>58673017
Unless het wants to do graphics or audio that's not a big issue.
And even then there are some portable options.
>>
Use FreePascal.
>>
>>58669580
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...
>>
>>58668230
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.
>>
>>58669982
>again not an issue for about 10 years as memory is so cheep

It was never about memory, it was about cache.
>>
>>58668696
>the compiler is the reason
wow
stop posting
>>
>>58668735
He can just use Qt if he wants to use a gui.
>>
>>58675146
Qt is actually just stuffing all the different plattforms GUIs code in your code
>portability in current year of our lord and saviour 2017
>>
>>58669927
1. no
2. true, but far less so than electron

also >>58669908 and
>>58669969 >>58674421 >>58674397

>>58675193 congratulations, you just found out how porting stuff works
Thread posts: 35
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.