D
D
Daniel2018-10-19 01:15:35
visual studio
Daniel, 2018-10-19 01:15:35

How to connect a class from another directory in visual studio. Link 2019?

A c++ project in vs looks like this. What are solutions anyway?
2 main functions in 2 projects, in the second project I want to call a function from the first one
, when I start I get LINK2019

<pre>
Решение Proect
   Проект1 //англ.
     Ссылки
      Внешнии зависимости
       Исходные файлы
        Main.cpp
        class.cpp
     заголовки
         class.h
   Проект2
     Ссылки
      Внешнии зависимости
       Исходные файлы
        Main.cpp  

</pre>

#include "..\\Proect1\\class.h"
Full error
Error LNK2019 reference to unresolved external symbol "public: __thiscall Socket::Socket(char *,int)" ([email protected]@[email protected]@Z) in function "public: __thiscall Client::Client(char *, int)" ([email protected]@[email protected]@Z) ClientSocket C:\Users\danii\source\repos\Stream\ClientSocket\ClientSocket.obj 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2018-10-30
@SaNNy32

If you have 2 executable files in your solution, then it will not work out just like that and call the function. It is necessary that one of the projects be executable (exe), and the second one should be linked to the first one as a dll or lib.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question