How does C++ programming work on Linux? I'm quite well versed in C++ programming on Windows but it looks like I'm going to have to get used to writing it on Linux too. I've been using VS on the Windows side, what are some good tools I need on the Linux side? Should I just go balls in with terminal based tools or is there some good VS-like IDE for it? How hard is it to make cross platform builds that will seamlessly build on either system?
I think I played this game when I was like 13 in 1994.
Juan Sanders
>good VS-like IDE Clion, I'd argue it's even better than vs, but that's just personal opinion Or you could just spend a couple of days configuring emacs and have a similarly capable setup but also be leet (what I did)
Luis Martin
>Clion It's pretty damn expensive though, and subscription based. Any alternatives that provide similar level of quality?
Brody Carter
Bitch on top right could get it
Elijah Sanders
>what are some good tools I need on the Linux side? Qt creator >How hard is it to make cross platform builds that will seamlessly build on either system? easy
Adrian Reyes
Vscode and learn how to use g++
Jaxon Ortiz
This, don't waste time on anything else
Wyatt Peterson
g++ -o output main.cpp -llinker
Carson Nelson
Then ./output To run. Anything more complex than this and you'll probably want a make file
Jace Ward
Good for hello world. Useless for any actual program
Brody Carter
The difficulty of writing platform-independent code really depends on which libraries you're using, how much you're relying on OS-specific system calls and how you're building your project; if you use CMake for your build scripts then it's able to generate a VS solution on Windows, the XCode equivalent on macOS or a standard Makefile on Linux all from the same script
There are a few books that document the POSIX API (the standard system API shared by all standard-compliant Unix-likes such as macOS and the BSD's) along with a lot of the extra Linux-specific system calls, Robert Love's "Linux System Programming" is one and Michael Kerrisk's "The Linux Programming Interface" is another; if you want to be cross-platform though then you should be programming against a toolkit like Qt or Boost instead of writing system calls directly
VS Code has been available on Linux for a while now, failing that you could use KDevelop, Qt Creator or Code::Blocks
Andrew Wright
Learn to write a Makefile faggot.
Isaiah Sullivan
KDevelop looks pretty decent
Caleb Peterson
Learn how to use g++ and how to write makefiles to use with it. It's a much cleaner environment than Visual Studio. I use VS too, but mainly for C#. Vscode is a good text editor. Emacs is great too. It has great buffer flexibility with is wonderful to work with multiple files. The only thing I think vscode is better than Emacs at is the easiness of installing plugins, and it has good intellisense. But the flexibility of buffers with Emacs gives me great nostalgia.
But I'm babbling now. Just learn how to makefiles and use g++. It's a much more comprehensible process than using Visual Studio's linker.
Evan Cruz
Visual studio's build configuration is the most fucking awful thing to use, and I love the rest of the IDE
it's not that bad, personally the best IDE i've ever used on Linux was KDevelop. CLion is also pretty nice but the UI sucks ass, like it's filled with minor inconsistencies that trigger my auts. CLI editors also work, people will argue all day about the whole IDE vs. CLI tools argument but honestly it's like picking a main in smash bros or picking a guitar, everybody has their own preference and what matters is that you find something you enjoy. the only one i have an irrational hatred for is VSCode but it has more to do with the pretentiousness nature of it and less the actual editor itself, like it screams zoomer but that's just my 2c
Vscode is slow trash that can easily take more than 1gb of memory. Use Vim, g++, Makefile. Stop being a lil IDEbaby and become a man.
Camden Evans
Wow a whole gigabyte of memory
Jayden Gray
Use the terminal as an IDE. Use vim + YCM for editing and autocompletion and other IDE-like features.
Lincoln Williams
If only we could have over 2 gigabytes of ram in our personal computers nowadays... Perhaps this is a feature of when cars fly, and man harvests asteroids for metals and minerals.
>stop using tools designed around improving your workflow
vim is a text editor and that's where it shines, it was never meant to be stuffed with so many plugins it ends up resembling an IDE
Joshua Robinson
>Let's Lazy Developers get away with shitty code because hardware is cheap. Welcome to Jow Forums
Nolan Mitchell
Hardware is cheap. Your argument would have worked in 1998. Now, not so much. And if you're a developer and you buy a potato PC, it's your own fault.
I'm not even defending the fact that it's based on Electron, I think that's pretty stupid. But at this point who the fuck cares. It's a productivity tool not a feet massager
Landon Adams
>t. never learned vim beyond opening and closing it YCM just adds syntax and file completion. You're not stuffing it with anything, and it ends up being superior to bloated garbage like VSCode. Just open up a terminal and use system utils if you want a full IDE, it's not hard.
Joshua Lopez
Just because an IDE uses 1GB of memory doesn't mean it's poorly written you absolute retard. It likely keeps a lot of itself in memory to provide quick response times for on demand features, which is actually a sign of the developers understanding that it isn't 1998 anymore and that they can utilize more system resources to prove a better experience for their end users.
Landon Sullivan
>He hasn't use Visual studio with a top end PC and still have lags. >Muh productivity Meanwhile I just use vim and get no lag and have all the productivity I need while using some lightweight utils like YCM to help me in my work.
Your thinking is the reason softwares are getting more and more slow and bloated. And the user experience is degrading.
James Phillips
Came here to post this. GNU make is based, microsoft cannot into functioning build systems.
Since it's C++ the compiler will be eating all ram like a greedy fucker.
Or I could use an application which provides all of those features and utilities within an environment and interface designed specifically around enhancing my workflow instead of being an absolute retard and using a terminal and and text editor.
I've been using vim for nearly 20 years, I know a hell of a lot more about its caveats than you do. Now stop parroting the opinion of every inexperienced developer and open your fucking eyes, using a text editor and terminal to code in this day and age is archaic and inefficient as hell.
Cooper Jenkins
>GNU make is based Is it really? I keep hearing about how horrible it is. I never actually wrote a make script tho
Angel Morales
Only because people are clueless and don't know how to use it so they end up copy pasting a lot and writing 10000 line makefiles. The basic idea of it is quite simple and powerful.
Colton Miller
>wanting to tie yourself to a given ecosystem instead of having a myriad of interchangeable tools are your disposable to use however you see fit >if it's not a gui, it's archaic Name one "enhancement" you get from using VSCode that a terminal doesn't provide.
Interchangable? You are literally limiting yourself to the plugins available to vim you retard, you are doing the exact same thing any time you decide to to use a specific editor or IDE to code. You're also committing yourself to an ecosystem where the developer of any plugin may just up and one day abandon it because there's no real incentive for them to persistently do so, unlike the people who develop IDEs
I don't have to spend time writing commands in a terminal to perform basic tasks. Nor do I have the time to sit here debating with some idiotic shit that has never worked on a major project before about the benefits of using an IDE . If you had ever actually used VS beyond the basic function of being a syntax highlighter and completer you'd already know about the features it offers.
> autistically obsessing about irrelevant stuff welcome to the real world, dumbass
Ethan Carter
This means nothing, might as well just be personal preference. Anything is easy to use if you learn it, even notoriously bad stuff like CLI git. All the plugins I use are open source. Yes, projects die, but so what, move on, find something else. This is a none argument, and has never happened to me. And I wasn't just referencing vim, or any other editor, I mean the unix ecosystem as a whole. >to perform basic tasks Ok, name some. You have yet to describe your workflow, yet are claiming it's inseparable from a specific GUI editor. >the features it offers I reiterate, name some. IDE-like features aren't limited to, well, a single-application IDE.
Lucas Davis
I thought I smelled Monster Energy.
Sebastian Barnes
I did not refer specifically to VSCode in my initial reply and purposely refrained from doing so in my second reply, at the end I was merely indicating that if you had ever used VSCode beyond its core functionality you would already know about what it offers, I personally don't use it. Now stop twisting my words to suit your argument.
I myself program on Linux, not Windows. The point is the same, regardless of your environment—Windows or Linux (it's not Unix)—a dedicated IDE will have a streamlined interface designed around providing you optimal workflow for (usually) a specific language. From macros and tools that mitigate the need to write terminal commands (itself a time consuming process) to using visual solutions to design and develop programs to built-in collaboration tools that make it easy to manage and work on projects that live outside the open-source community, an IDE is simply going to provide you with better workflow in a professional environment, something you have clearly never encountered.
Eli Jackson
Qt Creator is alright, especially if you're using the Qt framework.
Parker Butler
Is there any particular reason to choose one or the other when it comes to Qt creator vs KDevelop? I never really got why we have both of them in existence when the KDE project and Qt are practically joined at the hip
Connor White
I use vim with the YouCompleteMe and rtags plugins for code completion and diagnostics, plus ctags (exuberant-ctags really) for textual indexing. For building, use cmake. For debugging I just use GDB on the console. Learn to write startup scripts for it, it's the only way to keep sane. It's not as comfy as Visual Studio, but it works and is functional. Make sure to never ever hit a breakpoint or otherwise interrupt a GUI program while it has a menu open or you'll lock up your graphics and need to log in via SSH to kill it.
Wyatt Russell
I honestly don't know. I'm kind of stuck with Qt Creator because of my job and I'm happy enough with it so I haven't really looked into KDevelop.
Jordan Jenkins
QtCreator costs money unless you license your code as GPL (or some other OSS license, I forget which apply). To develop proprietary software, it costs a lot of money. VisualStudio-level money. KDevelop is also older than QtCreator IIRC.
James Price
To add to what everyone else has said, there are also the CDT plugin for Eclipse, which was functional the last time I tried it, but ate memory and lagged a lot, but that was about 12 years ago, so it's probably ok today. I mean people use javascript-based shit with no issue. Also NetBeans supports C++ development, but I've never tried it. There is also some Gnome shit, but it's shit.
Adrian Anderson
Pretty sure the IDE is free and you can use it without actually using Qt. Still, I don't like the IDE at all. Seems very weird to me.
Ryder Wilson
My company e-mailed the Qt team directly asking if us developing proprietary software with QtCreator (if we don't use Qt libs) would require us to buy a license and they said yes. They could have just wanted to sell more licenses, but we decided not to risk it, so we're not using QtCreator.
Joshua Howard
One more reason to avoid Qt and its maze of legal bullshit I guess
Joseph Sanchez
>The difficulty of writing platform-independent code really depends on which libraries you're using, how much you're relying on OS-specific system calls and how you're building your project; If your goal is a platform independent GUI application then use Xojo. It's commercial, but it dramatically simplifies the entire process, and builds native binaries which use native UI elements. It blows Java out of the water and is just easier to learn/use than Qt.
It also has a nice IDE.
Andrew Edwards
Oh yeah: Xojo doesn't have any of the legal bullshit of Qt, and is far cheaper to develop proprietary software.
Joshua Phillips
Not exactly cheap but at least it's not subscription based I guess
Juan Jones
I'm curious now, how could they prove that you were using Qt Creator for your project as long as you don't have project files in your source control?
Jaxon White
>Qt creator This. You don't have to use it for qt, it also functions as a good generic cepples ide
Carter Scott
any text editor u want + language server (clangd/cquery/ccls). learning CMake is a bonus, works on all 3 platforms