So I have an interesting problem. I work with my own dll sets, which obviously I have no source. The goal is to write an intermediate dll that groups together a large chain of funnction calls from proprietary dlls. The problem that occurs when compiling with g ++ is that I get errors for the source dlls line by line: cannot export libname_NULL_THUNK_DATA. Symbol not found.
If I add the main one and just compile the executable, everything will work as expected. I use mingw to compile. Thanks for any help.
In response to the first answer: Either I am embarrassed by what you say, or I did not formulate my question very well. I am not trying to explicitly export anything from my shell. I just call functions from my DLLs. The problem is that I get errors that it cannot export these specific characters from the dll to my shell. The problem is that I'm not even quite sure what these _NULL_THUNK_DATA characters are for. I did a search and read somewhere that they should not be exported because they are internal characters that windows use. I tried using the -exclude-symbols directive for the linker, but it did nothing. I apologize if I do not completely understand what you are trying to say.
So, I think my problem was related to this. When you simply compile a standard executable that uses the DLL, I was able to include headers and directly call functions, for example:
#include :3rdparty.h int main(){ dostuff();
this will compile and work fine. I just needed to link the libraries in the g ++ command. When binding with the -shared flag, I would get these errors (with the main remote of course). I think this is due to the fact that by default g ++ tries to import all the characters from the dll. I did not understand why this is happening in the dll vs in the executable. I will try to do this using GetProcAddress (). Thanks!
source share