0

So I have a project located at "C:/something/something/project.sln"

The functions I am using in this project I am wanting to use again over and over again. So I have created

"C:/folder/include.h", "C:/folder/maths/maths.h", "C:/folder/maths/maths.cpp"

Include.h:

#include #pragma once

#include "maths\maths.h"

maths.h

namespace maths
{
   int add(int a, int b);
}

maths.cpp

#include "maths.h"
namespace maths
{
  int add(int a, int b) { return a + b; }
}

function 'add' is unresolved external.

I am using VS2017. I am guessing it is to do with using the linker or additional include directories however, nothing I tried there got it to work. I suppose I could create a project in 'folder' then compile as .lib, however, I don't think that, that should be needed. Thanks :)

0 Answers0