Q
Q
Quark2021-09-12 18:03:20
C++ / C#
Quark, 2021-09-12 18:03:20

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:

613e14c206136753969811.png

613e150c80954146588663.png

613e154966422017221896.png

613e18735114d327752235.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Q
Quark, 2021-09-13
@Quark_Hell

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...
}

A
Alexander Ananiev, 2021-09-12
@SaNNy32

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 question

Ask a Question

731 491 924 answers to any question