Hello all.
After asking for brief advice via PM to two mods, I was encouraged to better post here, even if there's "no specific sub-forum" for this stuff.
I'm trying to get started in C/C++ coding, and already on the way.
I'm trying to do it on my own (at school we are not seeing these topics).
Coding in general actually always caught my attention, but it was not until I recently got tired of just blindly following building from source instructions when I decided to comprehend what was going on, and beyond if possible.
Last time I tried building from source, for example, latest version of GZDoom and Raze (being Linux user).
But also read several times the wiki page for building on Linux.
I'm slowly going through the basics, including already objects in C++.
But the online docs I'm currently following seem to cover precisely only the general basics. When remembering the past experiences of building from source, there are always the other concepts of, say, headers (not just libraries) and usage of CMake and pkg-config; which I still don't know much about.
Also, the concept of "libraries" (and possibly also headers)...
It's still being kind of hellish because they are compiled, *entire* programs to be used by programming languages; and as any program should do, they have their entire documentation just for usage!
But, if I need to be a bit more specific, the -broad- doubts I have right now are:
--When checking conditions of variables, is it true that it's better practice to write "if(1234 == x)" instead of "if(x == 1234)"?
--What are Make, CMake and pkg-config used for? (I understand compilation and building can be done solely with gcc/g++)
--If using Make, with the -j option for number of cores, should this be number of physical cores or total threads?
--The flag "-DCMAKE_BUILD_TYPE=", how is this an "optimization" flag? And, can the flag be written *more clearly* as "-D CMAKE_BUILD_TYPE=", with the additional white space?
--In C++, did cout really replace printf usage? If so, why? At least most examples around internet now use cout instead of printf when on C++... And personally I was already feeling good enough with printf...
--Did pkg-config replace libtool, or are both still used?
--Finally, from the Sumatra PDF author's blog:
https://blog.kowalczyk.info/article/96a4...-code.html
could I take that as good practice indeed, in your experience?
Ok, I just tried to enumerate the big doubts until now.
I'd like to ask if someone could help with some of those, or suggest existing online documentation which could help.
I'm thinking the global topic here would be more like "C/C++ programming in UNIX-like environments"
Oh, by the way, I noticed that Dolphin-emu building on Linux now has WAY less dependencies than, say, one decade ago. Before, it was even necessary to install some ATI/NVIDIA dev packages regardless of what GPU we had!
Did Dolphin-emu code changed/improved that much?
In contrast, projects like GZDoom/Raze are, as far as I understand, suffering of dependencies hell due to each distribution's implementation being different, and resorted to usage of MS's vcpkg as a solution, which I personally didn't like too much...
Well, I think this is finally it.
Thanks beforehand for your attention.
After asking for brief advice via PM to two mods, I was encouraged to better post here, even if there's "no specific sub-forum" for this stuff.
I'm trying to get started in C/C++ coding, and already on the way.
I'm trying to do it on my own (at school we are not seeing these topics).
Coding in general actually always caught my attention, but it was not until I recently got tired of just blindly following building from source instructions when I decided to comprehend what was going on, and beyond if possible.
Last time I tried building from source, for example, latest version of GZDoom and Raze (being Linux user).
But also read several times the wiki page for building on Linux.
I'm slowly going through the basics, including already objects in C++.
But the online docs I'm currently following seem to cover precisely only the general basics. When remembering the past experiences of building from source, there are always the other concepts of, say, headers (not just libraries) and usage of CMake and pkg-config; which I still don't know much about.
Also, the concept of "libraries" (and possibly also headers)...
It's still being kind of hellish because they are compiled, *entire* programs to be used by programming languages; and as any program should do, they have their entire documentation just for usage!
But, if I need to be a bit more specific, the -broad- doubts I have right now are:
--When checking conditions of variables, is it true that it's better practice to write "if(1234 == x)" instead of "if(x == 1234)"?
--What are Make, CMake and pkg-config used for? (I understand compilation and building can be done solely with gcc/g++)
--If using Make, with the -j option for number of cores, should this be number of physical cores or total threads?
--The flag "-DCMAKE_BUILD_TYPE=", how is this an "optimization" flag? And, can the flag be written *more clearly* as "-D CMAKE_BUILD_TYPE=", with the additional white space?
--In C++, did cout really replace printf usage? If so, why? At least most examples around internet now use cout instead of printf when on C++... And personally I was already feeling good enough with printf...
--Did pkg-config replace libtool, or are both still used?
--Finally, from the Sumatra PDF author's blog:
https://blog.kowalczyk.info/article/96a4...-code.html
could I take that as good practice indeed, in your experience?
Ok, I just tried to enumerate the big doubts until now.
I'd like to ask if someone could help with some of those, or suggest existing online documentation which could help.
I'm thinking the global topic here would be more like "C/C++ programming in UNIX-like environments"
Oh, by the way, I noticed that Dolphin-emu building on Linux now has WAY less dependencies than, say, one decade ago. Before, it was even necessary to install some ATI/NVIDIA dev packages regardless of what GPU we had!
Did Dolphin-emu code changed/improved that much?
In contrast, projects like GZDoom/Raze are, as far as I understand, suffering of dependencies hell due to each distribution's implementation being different, and resorted to usage of MS's vcpkg as a solution, which I personally didn't like too much...
Well, I think this is finally it.
Thanks beforehand for your attention.