Answer the question
In order to leave comments, you need to log in
C++ linker error, although if you throw the code into one file it compiles, how to fix it?
In general, I wrote everything in the question, and uploaded the code to github.
I do everything through visual studio. I have zero guesses.
Code:
https://github.com/ASMcoder-Source/JUST-WORK-PLISS...
Error:
Ошибка LNK2019 ссылка на неразрешенный внешний символ "public: __thiscall ThreadWorker<void (__cdecl*)(struct ThreadData)>::ThreadWorker<void (__cdecl*)(struct ThreadData)>(int,int,void (__cdecl*)(struct ThreadData))" ([email protected]@@@[email protected]@[email protected]@@@[email protected]) в функции _main. JUST WORK PLISS C:\Users\vital\source\repos\JUST WORK PLISS\JUST WORK PLISS\JUST WORK PLISS.obj 1
Answer the question
In order to leave comments, you need to log in
If the class is template, then it must be all in h (or hpp), and connected. Otherwise it won't compile. Those. a separate cpp with the implementation of methods, it simply cannot compile separately, because does not know what class T is, the template parameter is substituted at the compilation stage; and for different T everything is recompiled (so sometimes, for example, instead of passing a function or a functor in the form of superfunc (FUNC&& func), where FUNC is a function or an object with an operator (), you can pass, for example, superfunc (std::function is less than int(int) more func), i.e. make it non-template, but have the overhead of a std::function intermediary, but the machine code will be generated once and will be universal)
Console scripts do not have this limitation.
Use running the script from the console. What is the problem here? and no updates needed.
Do not refresh the page - refresh data
https://www.google.ru/webhp?sourceid=chrome-instan...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question