C++ : "undefined reference to" probably beacause of CMake files : I would like to test my Socket class with gtest but I get this error: "undefined reference to` Server :: Socket :: Socket (int, int, int) "

and:" (.text $ _ZN11SocketTestsC2Ev [_ZN11SocketTestsC2Ev] + 0x49) : relocation truncated to fit: R_X86_64_PC32 against undefined symbol `Server :: Socket :: Socket (int, int, int) 'I can not fix.

I think the problem has to come from one of my CMake files. Here is the architecture of the project:

    +-- CMakeLists.txt
    +-- Serveur
    |    +-- CMakeLists.txt
    |    +-- Serveur.cpp
    |    +-- Serveur.h
    |    +-- Socket.cpp
    |    +-- Socket.h
    |
    +-- Tests
    |    +-- CMakeLists.txt
    |    +-- main.cpp
    |    +-- lib
    |    +-- ServeurTests
    |    	+-- SocketTests.cpp

The different files :
./ CMakeLists.txt :

    cmake_minimum_required(VERSION 3.10)
    project(ServeurCheckIn)
    
    set(CMAKE_CXX_STANDARD 14)
    add_subdirectory(Serveur)
    add_subdirectory(Tests)

Serveur/CMakeLists.txt:

    cmake_minimum_required(VERSION 3.10)
    project(ServeurCheckIn)
    
    set(CMAKE_CXX_STANDARD 14)
    
    add_library(ServeurCheckIn SHARED Serveur.cpp Serveur.h Socket.cpp Socket.h)


Serveur/Socket.h :

    #include <sys/socket.h>
    #include <netinet/in.h>
    
    namespace Serveur
    {
        class Socket
        {
            public:
                Socket(int domaine, int type, int protocole);
    
                int Domaine();
                int Type();
                int Protocole();
    
            private:
                int _domaine;
                int _type;
                int _protocole;
        };
    }

Serveur/Socket.cpp:

    #include "Socket.h"
    
    using namespace Serveur;
    
    Socket::Socket(int domaine, int type, int protocole) :
        _domaine(domaine), _type(type), _protocole(protocole)
    {
    }
    
    int Socket::Domaine()
    {
        return _domaine;
    }
    
    int Socket::Type()
    {
        return _type;
    }
    
    int Socket::Protocole()
    {
        return _protocole;
    }

Tests/CMakeLists.txt:

    cmake_minimum_required(VERSION 3.10)
    project(Tests)
    
    set(CMAKE_CXX_STANDARD 14)
    
    add_subdirectory(lib/googletest-master)
    include_directories(lib/googletest-master/googletest/include)
    include_directories(lib/googletest-master/googlemock/include)
    
    add_executable(Tests main.cpp ServeurTests/SocketTests.cpp )
    target_link_libraries(Tests gtest gtest_main)
    enable_testing()

Tests/SocketTests.cpp:

    #include <gtest/gtest.h>
    #include "../../Serveur/Serveur.h"
    
    using namespace Serveur;
    
    class SocketTests : public testing::Test
    {
        public:
            SocketTests() : _socket(AF_INET, SOCK_RAW, IPPROTO_IP)
            {
            }
        protected:
            Socket _socket;
    };
    
    TEST_F(SocketTests, CreateSocket_SocketIsCreated)
    {
        ASSERT_EQ(1, 1);
    }

I thank you in advance for your answers :)
