How can I get this mouse to joystick program to work? - c++

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

Related

How can I open my project in DevC++ to edit its code?

Hi there I am a beginner and I am learning C++ using IDE DevC++
Till now I was just creating simple files by choosing the source file in the upleft corner.
And it was easy to run them and edit them.
But now, for the first time, I have created a project in it. It was a graphics project; it ran well
But now I don't know how to open its code, so I can edit it and make it better.
Hope the problem is clear
Help needed.

VSCode does not show errors before building

I use VSCode(code editor, not IDE) for C++ with only Microsoft's C++ extension and today I have encountered a problem here. When I write the wrong syntax, the "PROBLEMS" panel does not show errors. It only shows errors on building the code. Earlier that wasn't the case. How do I fix this ?
Before building:
After building:
I got that error by Disable error squiggles. If you don't reach that error in my case, don't read anymore.
After ignoring, I got your problem:
To fix this, open settings.json file:
Scroll to the end, then set "C_Cpp.errorSquiggles": from Disabled to Enabled.
After reading the question, and the comments, my understanding is that you want Visual Studio Code to tell you when you make a mistake on the sintax, without having to compile the project.
What could be wrong is your C++ IntelliSense, which is odd because it comes in bundle with the C/C++ extension from Microsoft. The extension itself might be disabled, corrupted during an aborted update, or uninstalled.
Have you tried the good old and helpful uninstall and reinstall the extension? That normally fixes my problems with extensions in Visual Studio and VS Code
Note: You have to install the extension first: C/C++ IntelliSense, debugging, and code browsing extension
This is because the C/C++ IntelliSense, debugging, and code browsing extension does not know about the current project.
Navigate to View | Command Palette, enter and select C/C++ Build and debug active file: Select
Project, and then select the correct project that you want to work with.
This will help you see the problems as you create your code without requiring you to run it.
The extension has to know that it is allowed to continuously check your code.
I hope this helps you in the future with other extensions too...
Try and close your current folder and open a different folder. Then come back to your original folder. This worked for me.

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.

CodeBlocks 13.12 adding sound

Hello I just started learning c++, and my teacher wants us to create a game for our final exam.
I am using CodeBlocks 13.12 and can't seem to be able to add any game sound. I just need to play a simple .wav file if you guys could show me how that would look I'd greatly appreciate it.
The teacher made adding sound extra credit because he didn't actually show us how to do that. I have no clue as to how to do it so please show if I have to change anything in the settings.
I haven't worked much with audio files either, but a quick search turned up the following links:
StackOverflow: Playing a wav file
CodeProject: Audio files in c++
It looks that (for Windows at least) you can use
PlaySound
Check out the Windows documentation for PlaySound and make sure to include windows.h!
#include <windows.h>
Note: I should expand on AdamS's comment. CodeBlocks is your Integrated Development Environment (IDE). Your question is specific to the language C++ but not to the IDE CodeBlocks. If your code is correct but you still can't hear the sounds, then it could be an issue with your IDE or your computer.