So I have this problem. I am currently trying to create an app where a user can enter a nametag before using it. Let's say I have a main.cpp file in which I call func1.cpp and func2.cpp files. I have included a few heades files that I will list below. I compiled main.cpp into an executable file and it worked just fine on my machine. But when I tried to share it with someone, it said it was missing a few ddl. I tried putting the missing ddl in the same foler of my executable but now they get the error 0xc000007b
Here are the header files included : main.cpp :
#include <windows.h>
#include <winuser.h>
#include <string>
#include <iostream>
#include "func1.cpp"
#include "func2.cpp"
func1.cpp :
#include <iostream>
#include <fstream>
#include <string>
#include <windows.h>
#include <filesystem>
#include <unistd.h>
func2.cpp :
#include <string>
#include <fstream>
#include <filesystem>
#include <unistd.h>
The missing dll were :
- libgcc_s_seh-1.dll
- libstdc++-6.dll
- libwinpthread-1.dll
Does soemone know how to fix error 0xc000007b ? I heard that statically linking the required ddl to my executable file might solve the problem, although I don't have a single clue on how to do that. Or maybe it is because I included func1.cpp and func2.cpp as .cpp files and not .h files ?
I used Visual Studio Code 2019 and MSYS2 as a compiler. Please someone help me I have been struggling on this for litteral days
I also tried using
#if COMPILING_DLL
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT __declspec(dllimport)
#endif
but failed.