Unresolved external symbol on basic function

43 Views Asked by At

Build error LNK2019 happens when building project with 1 cpp file



namespace foo {

    __declspec(dllimport) void Print();

}


void main()
{
    foo::Print();
}

foo is defined.

header (in other folder):

#pragma once

namespace foo {

    __declspec(dllexport) void Print();

}

Severity Code Description Project File Line Suppression State Error LNK2019 unresolved external symbol "__declspec(dllimport) void __cdecl foo::Print(void)" (_imp?Print@foo@@YAXXZ) referenced in function main sb C:\Users\user\source\repos\foo\sb\Application.obj 1

context if needed: following a VS2017 guide. I don't know if something might have changed.

0

There are 0 best solutions below