After downloading GCC 4.9.2 TDM (SJLJ)-32 bit for SFML for codeblocks, I can build and run but can not run .exe files. Whenever i try to run .exe files, an error message shows up: "The program can't start because libgcc_s_sjlj-1.dll is missing from your computer. Try reinstalling the program to fix this problem. " I tried going to settings->compilers -> linker settings -> other linker settings -> added -shared-libgcc and -shared-libstdc++ , but same error message shows up still. Can anyone help me? I may need specific answers because I am a newbie. I spent hours trying to figure this out...
As always on Windows, any DLL with which a program is linked at buildtime
must be found at runtime by the OS program loader in one of the directories
where it looks for DLLs as per the Windows Dynamic-Link Library Search Order.
Therefore make sure that libgcc_s_sjlj-1.dll is in one of those
directories. The crudest way of doing this is to copy the DLL to
the same directory that contains the program. This DLL is your GCC compiler's runtime library, and you will find it in <Your_TDM_GCC_Install_Dir>/bin - e.g. C:/TDM-GCC-64/bin
Related
recently I realized my c++ program was detected as a virus and I think it must be a compiler problem. so I uninstalled my compiler and reinstall it through msys2. the output is ok in my system but when I run EXE outputs created by a new compiler in a Virtual machine or another system I've got this error: libstdc++-6.dll not found
I don't have any idea how to fix this problem. I appreciate any help.
Error Image
Some people call this DLL hell, but that's usually because they don't really understand completely how shared libraries work on Windows.
You can avoid DLL dependancies by building your .exe file with linker flag -static and linking with the necessary dependencies static library files (*.a).
Specifically for the C++ standard library libstdc++-6.dll you will need to specify linker flag -static-libstdc++.
Or you can use shared libraries (*.dll), but then you need to distribute them in the same folder as the .exe file.
I wrote a tool called copypedeps as part of https://github.com/brechtsanders/pedeps to copy .exe files along with all the required .dll files.
Language: C++
IDE: Code::blocks
Compiler: GNU GCC
OS: WIndows
I am trying to create an executable. When I go to the executable file, and I attempt to open it, it says " the code execution cannot proceed because libstc++-6.dll was not found. Reinstalling this program might fix this problem." The problem is that the code works when I run it inside my IDE, but not when I attempt to double-click the executable file itself.
I have done some experimenting and came up with this:
1: This problem only shows up if I am using the iostream library.
2: I have looked in the directories of my compiler, and libstc++-6.dll is indeed there.
This problem has been plaguing me for a while, and I have no idea how to resolve it...
Any help is appreciated. Thanks!
EDIT: I couldn’t figure out how to link it statically, if that’s a word. So what I did is I copy-and-pasted three libraries to the same directory as my exe and it worked. The libraries were the ones which my compiler told me were missing. Thanks everyone!
Based on libstdc++-6.dll not found, it looks like the problem is that your executable isn't in the same directory as the dll, so either copy the dll file to the directory with your executable, or better: use the static options to link the libraries without needing to copy the dll for each executable.
I'm trying to create an executable from my SDL2-Project, which will run on any Mac that I send it to.
My Program is written in C++, Xcode9.2
Apparently the way to go in XCode is Project->Archive. This works perfectly fine as long as I execute the product on my mac. On a mac that does not have the SDL2.framework installed under /Library/Frameworks/ it throws following error upon execution:
dyld: Library not loaded: #rpath/SDL2.framework/Versions/A/SDL2
Referenced from: /Users/thomas/Downloads/Chat_Program_Mac v1/Chat_Program 2
Reason: image not found
So this error is not very surprising, as I haven't linked statically (wouldn't know how this works anyways) and obviously the program needs the framework(s) to run.
On Windows you simply put the .dll files in the same folder as the .exe and that works.
Now on mac, putting the frameworks in the same folder as the executable won't change anything.
From my research I know, that in XCode under BuildSettings->"Framework Search Paths" there is the option to tell the compiler where to look for the frameworks.
Someone on this forum answered to a similar question to put ./ as search path and set it to recursive to let the compiler look for the frameworks in the same folder, where the executable is.
This somehow got me closer to the solution. During the build process XCode now looks for the frameworks inside the debug folder and creates the executable without error, while there are no SDL frameworks in /Library/Frameworks/.
EDIT: this does not work for Project->Archive. Even though I put the frameworks into the release folder. (/Users/Tim/Library/Developer/Xcode/DerivedData/Chat_Program-gapnuzuivnylrgbubtywdbzshous/Build/Products/Release)
When I try to run the executable though, the same error appears saying the library couldn't be loaded.
The executable does run though, if I put the frameworks back into /Library/Frameworks/, which tells me there must be an option to tell XCode where the executable has to search for frameworks, that is not the BuildSettings->"Framework Search Paths" of the project.
So how do I tell my executable to look for the framework inside it's own folder?
So here's how I solved my problem:
Goto BuildSettings->All->Linking->Runpath Search Paths
Change to "#loader_path/"
Apparently this changes #rpath in the error message above to the path where the executable is, so the framework(s) can now be put into the same folder as the executable.
Pretty simple actually, maybe I'm an idiot that I had to research a whole day to find this. Maybe it's just very well hidden and kept as secret as possible even on the internet...
Whatever - happy it works now :)
I have environment where both VisualStudio 2005 and VisualStudio 2013 are installed. And I have strange situation with some of the projects. I compile such projects with VS2013 and when I try to launch them through Explorer or command line I get an error - "The program can't start because MSVCR80.dll is missing ...". Why msvcr80 when I compile with msvcr120?
What I tried:
Put msvc*80.dll to directory with executable. I got runtime error "R6034. An application has made an attempt to load the C runtime library incorrectly..."
Checked binary dependencies with Dependency Walker. I saw that binary has dependencies to VS2013 runtime, and there is no mention about msvcr80.dll
Launched binary with empty PATH. I gave no positive effect.
Launched binary on another 'clean' pc. And it worked all right with vs2013 runtime.
How can this be?
Thank you for all, you was right. I just forgot, that I have installed old version of my product. It was launched in background and used old versions of libraries. So when I ran my new application it tried to use libraries that already had beed loaded. In another way Dependecy walker didn't check already loaded libraries and looked only in PATH.
MSDN link about DLL loading - https://msdn.microsoft.com/ru-ru/library/windows/desktop/ms682586(v=vs.85).aspx
I set up the project with a Debug library named libtesseract302d.lib. Additional library path is linked to the folder where libtesseract302d.lib is located. In the additional dependencies linker input, I set libtesseract302d.lib. But when I run the project, a system error comes out as The program can't start because libtesseract302.dll is missing from your computer. Try reinstalling the program to fix this problem. I don't have any linkage to this release lib libtesseract302.dll, but why this error has come out?
Thanks
A dll called libtesseract302.dll should have come with the library. This needs to be placed in the initial working directory of your executable, or you can place it in C:\Windows\System32 and register it.