I am coding in C++, using the SFML, since a little bit of time and everything has been running fine.
This morning I've been using the type sf::Image and some functions on that type, such as getPixel.
Then, the compilation works fine, however, when I try to run it, I get the missing dll error on sfml-graphics-d-2.dll.
I looked in the folder and I could see that indeed, there was no such dll! There was his brother sfml-graphics-2.dll instead however.
Why is it asking for the dll that I don't have :( ?
Informations:
I use code::blocks.
Linkers seems to be ok :
"C:\Program Files (x86)\SFML-2.3\lib\libsfml-graphics-d.a" for the debug
"C:\Program Files (x86)\SFML-2.3\lib\libsfml-graphics.a" for the release
I use the SFML2.
I'm on Windows 8.
My compiler is GCC MinGW.
I can't find sfml-graphics-d-2.dll on my computer (because I had to compile the SFML using Cmake, and it only generates files like sfml-graphics-2.dll, not like sfml-graphics-d-2.dll)
Thank you very much if you can help! :-)
The -d in sfml-graphics-d-2.dll stands for debug, so when you are building SFML, you need to change the build target from Release to Debug.
The Debug build target should have been generated by CMake when you ran it.
Related
I started programming in C++ using CLion IDE.
When I run the program inside the IDE it works. However, opening the .exe file outside the IDE generates a bunch of errors:
The code execution cannot proceed because libgcc_s_seh-1.dll was not found. Reinstalling the program may fix this problem.
Hitting OK pops the same message again with a different dll.
Why does this happen? What are the different ways to fix it? What is the best option?
You always need to ship any libraries your application is linked with along with your application. The libraries are just as much a part of your app as the code you wrote yourself. This includes your compilers runtime libraries (which you forgot in this case).
I have a C++ project running cinder. I would like to implement a plugin system using LoadLibrary and a .dll file using a custom interface. I got a simple example working, but once I add the cinder libraries to use as a reference in my dll, the dll won't compile, giving an error the and are not compatible with compiling with /clr.
I am a greenhorn when it comes to C++, most of my programming is done in C#. Is there anything I could do about this?
P.S. Switching off /clr gives me a bunch of errors about MT_static and MT_Dynamic mismatches in cinder.lib. I'm going nuts here.
Thank you for your help,
Matija
Well, the solution was not all that forward, but after a LOT of trial and error, this finally worked:
I turned off all clr options (set them to no support in visual studio). The the setting for Dynamic Debug DLL needed to be changed to Dynamic no debug (no DLL). After that, it was just a matter of commenting out Stdafx.h and setting and current setting incompatible flags to compatible.
The project built into a normal .dll and is now working fine :D
I am starting to learn DX11 and running into trouble with the effects framework. I know it was released as source and I have to build it, but the output from the build is not what I expected.
According to the research I've done on this question, the output from the build should be
D3DX11EffectsD.lib for debug
D3DX11Effects.lib for release
However, when I look into the 'Effects11\Debug' directory after building the project, I only see a file Effects11.lib (well, an Effects11 Object Library file which I assume is a .lib, I'm new to c++), and the exact same file in 'Effects11\Release'. Whats going on here? I've never used VS 2010 for c++ before now but I think I am building the solution correctly.
Is this a matter of renaming the files or have I done something wrong without realizing it? There really isn't much documentation on building and linking libraries in vs 2010 that I could find. Anybody have any suggestions?
Thanks
If you compiled exactly what you got off the web, then I think it would be just a naming convention problem.
You should try compiling it into your end application and see if it yells about debugging symbols missing.
You can also go into the build settings (it has been a while since I have used visual studio for anything other than C# so I don't know exactly where that menu option would be (I assume right clicking on the project should yield some useful results)...I generally do my C++ stuff on linux) and check to see what the built targets are for debug and release. If it turns out that the names are the same for both, but the build targets (i.e. the folder and a few other options, like including debugging symbols) are different then you should be good and it is just a naming problem.
Also, if the files are the exact same size it is likely that they are the same since the debug file should be at least a bit larger than the release one.
If it turns out that they are the same file, try re-downloading or re-extracting the source and just compiling the project again without any changes and see if that gets any results.
I've recently started using PDCurses in a C++ game I'm working on. When I compile the program on my own machine (windows) and run the .exe, everything works as it should.
When I take that .exe onto a different computer that doesn't have PDCurses and I try to run it, I get an error about a missing pdcurses.dll file.
After doing a bit of research online, I found out that including the .dll file along with the .exe should make it run but it didn't work for me.
This is how I compiled the program using MinGW: g++ game.cpp -o game -lpdcurses
So my question is, how do I make this program run on computers that don't have PDCurses setup, and also, is there a way to do this by combining the .exe with whatever additional file(s) the system needs to run the program? I've also read that you can do some sort of static linking but so far I've been unable to find a way to do this.
Thanks in advance for the help.
NOTE: In case it matters, I setup PDCurses following this tutorial: http://comptb.cects.com/1848-adding-pdcurses-to-mingw
Not sure if that was the best way to do it but I'm able to compile and run C++ code that uses pdcurses on my computer fine.
Sorry for not posting the exact messages. Here they are:
The first one I got when I didn't include the pdcurses.dll file along with the executable said :
The program can't start because pdcurses.dll is missing from your computer. Try reinstalling the program to fix this problem.
The second one I got after I included the pdcurses.dll:
*The program can't start because libcc_s_dw2-1.dll is missing from your computer. Try reinstalling the program to fix this problem.*
You need to include all the dynamic libraries you linked with. Be careful of licensing, although IIRC there's not much that will bite you with MinGW.
There should be a 'ldd' command if you have the MinGW shell. Try running it on game.exe and it will tell you what libraries you need to run your program. You need to include them all with the exe.
If you want to try and remove the dependency nightmare you can use the static linking (-static) option to your gcc link command. You may not be able to actually do that if you don't have the static versions of your libraries installed. This has other implications - your exe will be bigger and the OS's shared shared page code will not work because it can't tell what parts (DLL code) you are sharing with other apps. In effect, your application will use more memory as a result, although it may be insignificant.
Another option is to get the sources to PDCurses and compile it as a static library. That way you don't have to get involved in the DLL Hell.
Compile it as a C library instead of a C++ library and you should be good to go.
I am using AVR32 studio 2.6 to try to compile a c++ project, but everytime i try to run it, it says launch failure as no binaries could be found. Is there a fix for this error code ?
I have never used AVR32, but this is a very common C++ error. It essentially means that it can't find the executable to run the program from. Which either means you have not built the project properly, or your makefile has errors.
Make sure your project is properly built first, and if that isn't the problem, look up how to create makefiles for the compiler you are using.