Reddit » C++ questions and answers
368 FOLLOWERS
A subreddit for c++ questions and answers.
Reddit » C++ questions and answers
5h ago
I'm working on a Windows computer that doesn't have internet access and I'd like to develop a first c++ application with an interface using gtk and I also need the libssh library but I can't find an "easy way" to install the libraries and all the dependencies without a connection but I can use USB key. Just installing a c++ compiler without internet wasn't that easy because the installer downloaded the compiler during the installation. Do you have any solutions ?
Using a USB key is logic but what do I have to put on it ? It's a really stupid question but install that when you don't have inter ..read more
Reddit » C++ questions and answers
6h ago
I am building a project in which the users can buy or rent houses, if I want to log the transaction date & time in my array, which library should I use and which function in it? My professor said we could use ctime but i don't know which function I should use from it either.
submitted by /u/Crispy_liquid
[visit reddit] [comments ..read more
Reddit » C++ questions and answers
9h ago
Hi Everyone,
Following is my code structure :
file : request.h
struct config{
....
}
class request{
config c;
....
}
file : serializer.h
include "request.h"
class serializer{
void save_config(config& c);
config& load_config();
}
file : serialize.cpp
void serializer::save_config(config &c){
// Implementation
}
config serializer::load_config(){
// Implementation
}
file : request.cpp
#include "serialize.h"
void config::set_a(std::string b){
// Do something
}
void request::serialize(){
serializer s;
s.save_config(c);
}
Now was you can see above, serializer is dependent on requ ..read more
Reddit » C++ questions and answers
11h ago
Like perform function inlining.
submitted by /u/Outside_Dragonfly311
[visit reddit] [comments ..read more
Reddit » C++ questions and answers
16h ago
I'm getting really, really tired of being completely clueless when what seems like a simple vcpkg install goes completely wrong and I get errors from CMake that complain about "by not providing 'FindLIBRARY.cmake' yadda yadda" and other errors with the linker when it claims that it can't find that target.
Where do I go to learn about these errors and how to troubleshoot them?
submitted by /u/spader1
[visit reddit] [comments ..read more
Reddit » C++ questions and answers
20h ago
I am using Windows 11.
So I cloned the Bullet3 GitHub page and looked through the quickstart guide to get started. I made a build folder and using Cmake GUI with root directory as bullet3/ and build directory as bullet3/build/ (I created a build folder) I was able to generate a lib folder (bullet3\build\lib\Debug) that has lib files of the form Bullet3Common_Debug.lib. I also used the .bat file that the GitHub page recommends using to build with on Windows. That built lib files in (bullet3\bin) with lib files of the form Bullet3Collision_vs2010_x64_debug.lib.
The example browser works just fi ..read more
Reddit » C++ questions and answers
20h ago
PS C:\Users\kovuruve\Desktop\WordCountTool\build> cmake --build .
[ 33%] Building CXX object CMakeFiles/runApp.dir/main.cpp.obj
C:\Users\kovuruve\Desktop\WordCountTool\main.cpp:2:22: fatal error: filesystem: No such file or directory
#include <filesystem>
^
compilation terminated.
CMakeFiles\runApp.dir\build.make:75: recipe for target 'CMakeFiles/runApp.dir/main.cpp.obj' failed
mingw32-make.exe[2]: *** [CMakeFiles/runApp.dir/main.cpp.obj] Error 1
CMakeFiles\Makefile2:81: recipe for target 'CMakeFiles/runApp.dir/all' failed
mingw32-make.exe[1]: *** [CMakeFiles/runApp.dir/all] Error 2 ..read more
Reddit » C++ questions and answers
20h ago
Hello!
I am a transfer college student. The first language I ever learned in college was C++, I loved it so much, but I dropped it since I had no clue what to build with or do with it. I want to get back to C++ and actually do something with it, but I have no clue what to do. I have been building web applications, but this is often boring to me. So I would like to take my favorite language and do something with it and hopefully get a job with it too.
What can I do? and given that I am extremely rusty ( forgot like most of the syntax and everything), what can I do with that as well? I do not w ..read more
Reddit » C++ questions and answers
1d ago
Hi! Im beginner in making programs in c++ with OpenGL, and I fail in the very first step: Setting up OpenGL. I have downloaded the source code www.opengl-tutorial.org/download/, I have setted up MinGW and CodeBlocks. Simple programs in CodeBlocks do compile and execute correctly. I installed CMake, pressed [Configure] and here are where the problems begin. If I select default native compilers, it says: "The C complier identification is unknown" and the same is for CXX. And so it fails. If I specify native compilers by their paths, I get an array of missing dlls. Unless I press [Stop] the erro ..read more
Reddit » C++ questions and answers
1d ago
Hi,
I was doing a leetcode problem (26. Remove Duplicates from Sorted Array) and came out with a first solution in which the values was erased from the std::vector. After reading again the description, I found that I didn't have to erase them, what I did. Then I compared both solution in quick bench but I'm surprised about the results: https://quick-bench.com/q/GEivmfH1QmYWo7uIooekx5iBHms
Why the hell doing less job (leaving duplicates values) lead to way less efficiency ?! Did I miss something ?
submitted by /u/Lo1c74
[visit reddit] [comments ..read more