How do I reset Codeblocks to factory default - c++

Gray Header File
enter image description here
I was going to make a class in codeblocks, when I realised all of the text was in gray, this has never happened before only now, I'm not sure if it's due to the perspective or not. I have redownloaded codeblocks multiple times and have come to no avail. I am running Windows 11

Codeblocks looks at the file extensions to determine the syntax highlighting conventions. If you do not have an extension for your file then the text is black.

Related

C++ Setup in Visual Studio Code fails to run

I just downloaded VSC in order to start learning C++. Previously I had just used Notepad++ for web design and Python IDE for Python, but I decided to move onto Visual Studio Code for a more sophisticated code editor.
However, when trying to run a basic program, I don't have the option to run in the first place. This picture is what's supposed to come up when you right-click on the text area (from multiple YouTube tutorials):
However, this is what comes up on my screen.
Additionally, there is no "run" button on the top-right of the screen like the tutorials show.
My folders regarding VSC in File Explorer are quite simple. I have a folder for my .cpp code, and MinGW as a compiler. My build is Windows 10.
Obviously, this depends from person to person, but is there any key way this situation can be resolved? Thank you in advance.

How can I get this mouse to joystick program to work?

I've recently bought Tie-Fighter Special Edition on Steam but have found that it requires a joystick to play. I have been looking for a solution to this, and have found this code which supposedly converts mouse input to joystick input. However, I've been having trouble getting it to work.
I do not have any experience with C++ or Qt Creator, meaning that I really do not know what I need to do to get this to work. I suspect that it may have been written using an older version of Qt.
When I try to compile the code in Visual Studio, I get several errors saying that it cannot open any of the source files.
cannot open source file "QApplication"
cannot open source file "QMainWindow"
cannot open source file "QDateTime"
and so on...
If I try to open and build the code in Qt Creator, I get the error File MakeFile doesn't exist
I would really appreciate any help with this, as I'm stumped for what I need to change to get the code to work. Thank you.
This has a version already compiled here
https://github.com/raptorswing/MouseToJoystick/releases

After using QFileDialog program crashes after few seconds

I am making app to increase productivity in our company. It reads the whole .csv file and puts its contents to a table in .pdf format. I am using QT as GUI library and PoDoFo as .pdf library.
The thing is, after I let user select .csv file to get data from and path to save generated .pdf, the program crashes in two minutes or so. It varies from case to case. I was able to "track" the issue down to the QFileDialog.
It doesn't matter if I created it on the stack, or dynamically still the same thing happens. From the moment you press "Choose" in the GUI, which opens up file dialog, program will crash in something around a two minutes giving this in Visual Studio Community 2017
I was able to create minimalistic code, to reproduce the error. I am using Windows 7 Pro, Microsoft Visual Studio Community 2017, compiling 32-bit debug
.h,.cpp,.ui files: https://www.dropbox.com/sh/cf057p4lnumesol/AAD39zDJnrxGChXAuE7y27Kra?dl=0
Any help would be appreciated, I've spent 5 days of my free time trying to figure this out. Thanks
EDIT: I understand that the "Frame not in module" means that visual studio doesn't have debugging symbols for the part of code where crash occurred, since I did not built qt myself, that makes sense.
EDIT2: I am using QT Visual Studio Tools addon version 2.3.2
Qt version is 5.12.2
EDIT3: Crashes only occurs when compiling for 32-bit arch.
EDIT4: Crash is happening only if using native file dialog. If option QFileDialog::DontUseNativeDialog is set, then no crash occurrs.
Not sure if this is related, but I had an issue where if I gave a path to the FileDialog it would grind away for a few seconds because it was somehow interpreting it as a network path. To fix this I gave it a path that had a prefix of "file://". To accomplish this I did this:
QUrl().fromLocalFile(cell_info->progDir()).toString()
The original path came from cell_info->progDir(). Somehow that path was a regular windows specific path. Once I wrapped it in the from LocalFile call it produced what I needed for all platforms I was using it with.
Again, I have no idea if this is related to your issue, but it sounds fishy like it is grinding away in the background on something. If this is not related feel free to ignore.

visual studio code showing wrong autocomplete suggestions in c++

I am trying to learn SDL in C++ So auto-complete is very essential for me.VS code was working fine with SFML but due to android problems I started learning SDL and now auto-completions for SDL is not working correctly . It always suggest some wrong members ,even If I didn't include any library . I don't have enough experience with VS . I came to VS from neovim only for auto completions which not working properly :(
I had tried restring ,updating and deleting .vscode dir but nothing happened
Hover your cursor on the header file mentioned in the source code
You'll notice a red/green swiggly underline
A light bulb icon appears, click on it
select the option called "edit includepath setting"
It takes you to a new "c_cpp_properties.json"
In this json file, under your platform, add all the paths to the headerfiles
After doing this, most of the unwanted intellisense results disappear. Only releavent ones show up the top.
VS code is a very good tool which comes with source control features. Add C++ extension and a debugger and you are good to go.

Where exactly do I add my BMP files in my OpenGL C++ project? Using Xcode for the Mac

I have my code working perfectly on Visual Studio C++ with OpenGL. The code is able to call the images folder. And when I run the program the images show up on my application.
Now I am trying to run my OpenGL C++ program on my Mac. Everything compiles and runs. However, the images that I use are not showing up.
Here is a screenshot of how my project directory looks. I have the images inside the texture folder.
Is there specific place where I need to put my texture folder so they will be able to be loaded? Like I said it works fine on the windows visual C++.
Given the screenshot you posed in the comments, it could be because you're using backslashes for the path separators. UNIX-based systems (Mac, Linux, BSD, etc.) use forward slashes to separate directories - Windows is fairly unique in using the backslash. Conveniently, Windows functions will accept paths with forward slashes anyways.