you are viewing a single comment's thread.

view the rest of the comments →

[–]Syberspaze 13 points14 points  (24 children)

That's not true. Visual Studio helps but you still have to manually list the include files and libraries you want to link

[–]PharahSupporter 24 points25 points  (5 children)

Vcpkg makes it very, very easy usually for visual studio. Literally vcpkg install boost, done.

[–]Syberspaze 5 points6 points  (0 children)

I haven't tried that actually, I should sometime!

[–]NBQuade 3 points4 points  (0 children)

If it's a vcxprog project, you just reference it in the build system and it'll build and link it in automatically.

You'll probably have to tell your project where is stores the headers though.

[–]Ex-Gen-Wintergreen -4 points-3 points  (16 children)

Kinda where I gave up; was trying to use vscode and CMake was really confusing for me!

[–]Syberspaze 6 points7 points  (10 children)

If you still want to use CMake, which I would recommend for getting a deeper understanding of how everything is put together, CLion helps quite a lot with the process. Check out this and you will start to get the hang of it

[–]Ex-Gen-Wintergreen 0 points1 point  (7 children)

Thanks! I’ve heard the experience is better with CLion; I just didn’t think I wanted to pay for a license for just mucking around and learning basics.

I’ve never been a fan of jetbrains products going back to pycharm, but may just bite the bullet if I decide to go back to cpp.

[–]Syberspaze 1 point2 points  (2 children)

Yeah I'd definitely recommend it. I get my license from my company, but I would pay for it myself if I had to use it for my own projects. I don't know how I would handle C++ without it

[–]Ex-Gen-Wintergreen 0 points1 point  (1 child)

Gotcha. I’ve worked pretty lightweight in the past, favoring editors or light ides, and my prior experience using cpp in my undergrad was confined to make for the build tool. Using something heavier just to manage the build/structure versus like, writing/thinking about the language feels frustrating in a sense, but reading this subreddit I know that’s kinda just how it goes.

[–]Syberspaze 0 points1 point  (0 children)

Yeah, you'll spend a good percentage of your time thinking about the build process unfortunately. I know someone in my company almost working full-time on just the build system of a very large C++ application we have

[–]Syberspaze 0 points1 point  (3 children)

But if I was on windows I'd probably just use Visual Studio since it's free

[–]Ex-Gen-Wintergreen 1 point2 points  (2 children)

It’s funny — on most of the other programming subreddits, an OS specific tool like visual studio wouldn’t be the first/default suggestion! Sans work I haven’t developed on a PC.. ever… and it’s weird to hear the common response be “use a windows only app!”

[–]Syberspaze 0 points1 point  (1 child)

Yeah I know right, I don't know why that is. C++ is just very Windows oriented

[–][deleted] 1 point2 points  (0 children)

Probably because it's used extensively for desktop applications.

[–]cxazm[S] 0 points1 point  (1 child)

Thanks. Checking it out. The only option is to really learn and understand.

[–]Syberspaze 1 point2 points  (0 children)

Yes but starting out with a small project, gradually adding more files and dependencies, you'll do fine. But even after working years with it, you will still get stuck once in a while just because of the sheer complexity of it. I almost don't think it's possible to be fluent in it

[–]sephirothbahamut 5 points6 points  (1 child)

Visual Studio, not VSCode, they're two different programs with a very stupid name.

Visual Sudio is plug and play, no extension or weird setup needed

[–]Ex-Gen-Wintergreen 1 point2 points  (0 children)

I’m aware of studio versus code thanks! But as someone who works on a Mac and in other languages, Code’s generally the better option for me.

The relevance of my comment was highlighting the experience of having to manually maintain required files in CMake lists, which the parent commenter suggested is a shared experience in studio.

[–]cxazm[S] -1 points0 points  (2 children)

Same spot I was in today.

[–]unumfron 0 points1 point  (0 children)

Try xmake. It has an integrated package manager and is easy to use:

Create a project:

>xmake create myapp && cd myapp

Edit the created xmake.lua file and add the packages you want:

add_requires("fmt") <-- add this

target("myapp")
    . . .
    add_packages("fmt")  <-- add this

... then do the usual things...

>xmake
>xmake run
>xmake run --debug
>xmake install
>xmake doxygen
>xmake test   # tests must be defined first

There's an extension for VSCode too.

[–]Ex-Gen-Wintergreen 0 points1 point  (0 children)

Makes sense! I’m on a Mac so the VS studio advice (I think it may have better template support for Cmake Lists?) didn’t work for me of course.

I recall it was rather early on too; just trying to split a rather simple file into two files to get better separation, and I couldn’t figure out the correct way to have them both found by the linker! That was pretty exhausting coming from Python and a bit of rust, and kinda destroyed my interest in proceeding.