I am attempting to use SFML for my next project, however I have yet to find reliable information on how to install SFML for MinGW, the page on the main SFML website is for using code::blocks, and I would prefer to keep using VS Code if I could. Additionally all of the tutorials for visual studio are for older versions where the UI is much different. I was hoping that someone who has installed it could guide me through the steps they used to install it. Thanks.
I am on Windows.
Just to be clear, I have never used Visual Studio Code, but it supports Nuget Package Manager, so it should work the same as in the 'normal' Visual Studio. So after creating new project:
Your should be getting/installing Nuget Package Manager from here.
Then according to answers to this question, you should be able to Press Ctrl+P or Ctrl+Shift+P and search for SFML packages, and choose version 2.5.1.
There are five modules: Audio, Graphics, Network, System and Window, choose what you need or install all five.
As I said at the begining, I do not have a way to test it, but it should work.
This question is fairly old at this point but for anyone in the future wondering how I solved it, I ended up switching compilers to Clang and creating a .bat file the just runs clang++ and links the SFML lib directory. (SFML GCC-64 worked fine with Clang)
To fix any errors in VS Code, you can add SFML to the workspace config
in .vscode/c_cpp_properties.json:
add or edit a field called "configurations" (should be an array), and add the following:
"configurations": [
{
"name": "SFML",
"intelliSenseMode": "clang-x64",
"includePath": ["${defaultInclude}", "C:/libs/SFML/GCC-64-Bit/SFML-2.5.1/include"],
"compilerPath": "C:/msys64/mingw64/bin/clang++.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"browse": {
"path": ["${workspaceFolder}"],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
]
You'll have to change some of the paths to fit your setup, and you could very well put this in your global C++ configuration.
Finally, make sure that the needed DLLs are copied to your compilation output directory
Related
I recently installed VSCode for my C++ projects. That's a great tool, very light, easy to use and no trouble to install C++ dedicated extensions. But I've realized after checking some videos/documentation about VSCode, IntelliSense is not fully working in my environment. So far, most IntelliSense features I've used work well...except Quick Info feature to show accompanying documentation for a method (signature help). As I can see from C++ tutorials/videos using VSCode, I should have a Quick Info blue icon when writing a method that expands to the side parameter info.
In my case there is no Quick Info blue icon, there is just the parameters name or short info. Im figuring out since several days why my VSCode is not able to provide the Signature help feature. I also tried with C#, but I get same behavior...
So Im heading to the StackOverflow community to get help. I've seen so many things about VScode on the Web but nothing concerning my issue.
My configuration:
MacBookPro - MacOS Catalina V10.15.4 (OS: Darwin x64 19.4.0)
VSCode Version: 1.45.1
C++ Microsoft (ms-vscode.cpptools) extension
C++ Intellisense (austin.code-gnu-global) extension
UserSettings:
"editor.detectIndentation": false,
"editor.multiCursorModifier": "alt",
"workbench.iconTheme": "vscode-icons",
"workbench.view.alwaysShowHeaderActions": true,
"C_Cpp.updateChannel": "Insiders",
"editor.insertSpaces": false,
"editor.minimap.maxColumn": 100,
"editor.minimap.size": "fill",
"editor.tabSize": 4,
"task.saveBeforeRun": "never",
"window.closeWhenEmpty": true,
"workbench.colorTheme": "Default Light+",
"workbench.editor.closeEmptyGroups": false,
"workbench.editor.showTabs": true,
"workbench.settings.editor": "json",
"workbench.settings.openDefaultSettings": true,
"workbench.settings.useSplitJSON": true
Example with pictures:
My working Environment without quick info blue icon
C++ example with quick info blue icon
(source : https://www.youtube.com/watch?v=3Tc6f3nhCxo)
Thank you in advance for your help!
For more details, here are some c++ IntelliSense Settings
> "C_Cpp.autocomplete": "Default",
"C_Cpp.default.intelliSenseMode": "",
"C_Cpp.intelliSenseCachePath": "",
"C_Cpp.intelliSenseEngine": "Default",
"C_Cpp.intelliSenseEngineFallback": "Disabled"
Faced the same problem getting VS Code C++ IntelliSense Quick Info to work on Mac M1 (arm64) without having to install Xcode for personal reasons (large and not needed).
Simply using the gcc provided by homebrew did the trick.
Make sure to install Homebrew first if not installed
Then install gcc
brew install gcc
Open your c_cpp_properties.json file in .vscode directory and replace the compilerPath value with the one from homebrew.
"compilerPath": "/opt/homebrew/Cellar/gcc/11.2.0/bin/g++-11"
In my case this is gcc-11 with version 11.2.0. Yours may be different so confirm from the brew install gcc output or confirm manually.
(This solution should work for MacOS and isn't limited to just the M1.)
I finally solved my Intellisense issue on my VS code configuration!
Now "Quick Info" feature is shown when I start typing functions, methods or whatever.
It has been fixed after installing xcode macOS application and updating gcc version by Homebrew (see attached pictures).
gcc version 10.2.0 on Homebrew
my cpp configuration (c_cpp_properties.json)
Hope it may help other people that have same Intellisense issue to show accompanying documentation for a method (signature help).
I'm having difficulties trying to compile an opensource framework (EmulationStation) in VS2015 on Windows. I've never used any of the tools before, apart from Visual Studio - so please forgive me if these are some obvious mistakes.
The guide says i need to do like this:
Boost (you'll need to compile yourself or get the pre-compiled binaries)
Eigen3 (header-only library)
FreeImage
FreeType2 (you'll need to compile)
SDL2
cURL (you'll need to compile or get the pre-compiled DLL version)
(Remember to copy necessary .DLLs into the same folder as the executable: probably FreeImage.dll, freetype6.dll, SDL2.dll, libcurl.dll, and zlib1.dll. Exact list depends on if you built your libraries in "static" mode or not.)
CMake (this is used for generating the Visual Studio project)
(If you don't know how to use CMake, here are some hints: run cmake-gui and point it at your EmulationStation folder. Point the "build" directory somewhere - I use EmulationStation/build. Click configure, choose "Visual Studio [year] Project", fill in red fields as they appear and keep clicking Configure (you may need to check "Advanced"), then click Generate.)
This is how my CMake looks like (it says generating done)
I get alot of compilation errors in visual studio when trying to build though:
1) Cannot open include file: 'curl/curl.h': No such file or directory (compiling source file C:\Users\retropie\Documents\GitHub\EmulationStation\es-app\src\guis\GuiMetaDataEd.cpp) emulationstation C:\Users\retropie\Documents\GitHub\EmulationStation\es-core\src\HttpReq.h
Where do I get this header file from?
2) 'round': redefinition; different exception specifications (compiling source file C:\Users\retropie\Documents\GitHub\EmulationStation\es-app\src\guis\GuiMenu.cpp) emulationstation C:\Users\retropie\Documents\GitHub\EmulationStation\es-core\src\Util.h 18
I have a lot of these errors with round. Am I missing a reference to a library?
Another screendump of some of the errors from VS2015:
Hope someone can point me in the right direction.
I am currently in de same boat as you, trying to get ES building under MSVS2015.
I am also very green, so hopefully others chime in as well.
Regarding the 'round' errors, apparently the MS compiler has no knowledge of these. For this issue, and some others, the newer ES fork by Herdinger has fixed this.
As this is currently the most active ES branch out there, and has the explicit goal of consolidating at least some of the backlog of PRs from the original Aloshi git, I would suggest you use this one.
In issue #4, there is some more information on building in recent VS versions. There is also a link for the precompiled cURL libs, including the header.
Having gone that far, I am sad to say that I still do not have a succesfull build as of yet. Compiling is no problem, however linking gives me a LNK2005 error.
Hope this helps a bit. Let me know how you fare.
When I compile with SFML, does the computer running the .exe need to have any of the SFML or other files installed or can it just run the application without worry.
Sorry for the noob question just wondering because I want to use SFML for a programming assignment and this is my first time. Thanks in advance
First of all, your question is a little confusing in that when you say "compile with SFML" it sounds like you are using SFML as a compiler. This is simply impossible as SFML is a library not a compiler so I'm going to assume you mean "compile a program that makes use of SFML".
Second, It sounds like you are compiling from the command line rather than from an IDE but I will answer both. In summary though you will need to "tell" the compiler in some way that you are making use of SFML; just using import is not enough. This is instead done by linking the necessary SFML libraries.
Command Line on Linux
Assuming you have the files downloaded, navigate to their directory (SFML-x. I believe) and use the command sudo make install to install the libraries.
To link files from the command line, you need to use the -l tag for linking (that's dash L, not dash 1). For example, if I made a small program called circle.cpp that makes use of SFML like below:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(240, 240), "Test Window");
sf::CircleShape circle(20.f);
circle.setFillColor(sf::Color::Red);
while (window.isOpen())
{
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
Then to compile (using g++ for example), I would just need to write the following command: g++ -c circle.cpp. However, to create the final .exe, I would need to link the outputted circle.o file with the appropriate SFML libary like such: g++ -o circle circle.o -lsfml-graphics.
IDE
IDE's such as Microsoft's Visual Studio are much easier to work with than the command line for SFML. In an IDE, you need to set settings within a section called "External dependencies" to include SFML libraries. You will also need to link the SFML libraries within a "Linker" section. These sections are generally sound in your project settings. See SFML's very good tutorial here for screenshots and such that will make my description a lot more understandable.
I am not 100% sure what you are asking, but I think you are asking how to use and compile SFML.
The best thing you can do is go to the official SFML documentation. It is really well written and explains everything you need to get up and running.
You can find an official tutorial for getting started here:
http://www.sfml-dev.org/tutorials/2.3/start-vc.php (This is for Visual Studio)
If you follow through each step carefully, SFML should run perfectly. Also, if you need Visual Studio, you can download it for free from here:
https://www.visualstudio.com/products/free-developer-offers-vs
I'm really interested in an Arduino IDE project from GitHub, but since I'm a new programmer i don't have figured out how to compile those source files on my Mac. There is already ported to Mac as it shows on the version 0.6.0.0 changelog but i just does not know how to do it.
Can someone provide instructions for me?
GitHub link:https://github.com/aporto/mariamole
So as I'm sure you've noticed, that project is a vcxproj-- i.e visual studio. Compiling it on Mac would require some finagling. I don't have experience myself, but I found this in my queries for you
How to support both vcxproj to cmake on a project?
You're going to want to read up on a lot of resources to try to get a better understanding and maybe form a better google query. Alternatively the easiest route would just to get your hands on a windows machine to build this
Good luck!
You have two options:
1) There's already a cmake project included in the project file. It's used for compiling it at Linux
2) There's also a Qt .pro file, also included in the project files, that you can load at Qt Creator
There was a similar question (here or on some related SE site), but I didn't find so I ask a new question (if you find it, send a link and vote to close this question if they are too similar).
I have finished installing WxWidgets (configure; make; make install), but while installing PgAdmin III 1.16 the make console doesn't recognize WxWidgets as installed. I found that absence of Unicode might be a problem in this case, but I have enabled the Unicode. What else should I do?
I have 32bit Windows XP and WxWidgets 2.9.4. Including PostgreSQL 9.1.3 went OK.
EDIT: I tried another way - through Visual Studio and Visual C++. I don't know if my problem is the same or just similar, but Visual Studio reports this error:
error C1083: Cannot open include file: 'wx/wxprec.h': No such file or directory
followed by 100 of other errors which seem to be conclusion of this one (mostly undefined types/functions with names beginning with "wx"). I added semicolons to the header (as was suggested here - fourth entry after "all replies"), but it didn't help. I also tried to add "include" and "lib" directories in WxWidgets to include path for every project, but no joy here.
Do anybody know how to solve it?
You need to point pgAdmin to wxWidgets installation under Windows. Its build instruction should explain how to do it but you must set up the include path (-I compiler option) and the libraries path (-L linker option) for it to compile and link properly.
Notice that for the include paths you must put the directory containing the wx/setup.h file generated during the build by configure first and the directory with all the rest of wx headers later.
Also, it probably goes without saying, but you must use the same compiler to build both wxWidgets and pgAdmin, so if you built wx using configure+make you can't use MSVC for pgAdmin.