Answer the question
In order to leave comments, you need to log in
Why is there an Unresolved external symbol?
Hello. I recently wanted to separate part of my project into a separate DLL, which I did for the first time. According to this guide https://docs.microsoft.com/en-us/cpp/build/walkthr... I made a DLL and set up a linker in my project, however, I got the error that is written in the title. I saw the same question on Habré https://qna.habr.com/q/113839 and tried to do what was advised there. Namely, I went to Build and clicked "clean solution ".However, after that I got another error: "cannot open file "name of my DLL""
Why did this problem arise? The path to the DLL is correct, I just copied it from the explorer and pasted it into the linker, although, anyway, maybe I I entered not quite right or not quite there. Here is what and where I entered:
Answer the question
In order to leave comments, you need to log in
My solution: I
added the following code to the definition of EACH method in .cpp: "__declspec(dllexport)"
In general, it looks something like this:
public:
__declspec(dllexport) static void DrawObject(COORD coord, GameObject object) {
//Your code...
}
Specify the full path to the lib file, make sure that this path contains your lib file.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question