   Visual C++ DLL Link Error
  So what I'm trying to do I'm not sure it can totally be done. It's been awhile since I've done any C++. Anyway, I have created a DLL application project in Visual Studio C++ 2008 Express Edition. In the project, I have a class, say:// Foo.h#ifndef FOO_H#define FOO_H#include "stdafx.h"using namespace std;class Foo {public:Foo(void) {}~Foo(void) {}void bar();};#endifAnd the implementation file:// Foo.cpp#include "stdafx.h"void Foo::bar() {// ...}Then when I create another regular Win32 Project within the same Solution and call the bar() method like so (I'm using UnitTest++ in this project):// FooTest.h#include "UnitTest++.h"#include "Foo.h"TEST(TestLinker) {Foo foo;foo.bar();}Then I get the following error:error LNK2001: unresolved external symbol "public: void __thiscall Foo::bar(void)" (?bar@Foo@@QAEXXZ)However, if I move the implementation of the bar method into the Foo header, everything works. Then Foo looks like so:// Foo.hclass Foo {public:Foo(void) {}~Foo(void) {}void bar() {// ...}};I suspect that, if this is even possible, it is a Linker option issue. I've tried adding project that contains Foo's Debug folder to the "Additional Library Dependences" option in the Linker -> Input settings for the project using this class, but this has not worked.Is this even possible to do? When creating a DLL in C++, am I allowed to use implementation files? Is there missing code or additional setup required within the DLL project? Another example of the steps I used to create the DLL are here.I appreciate any insight that anyone can offer on this.Thanks!   
  You need to define your Foo class as __declspec(dllexport) in the DLL and __declspec(dllimport) in the application.   ;  It looks like you aren't exporting the function.  Info on dllexport and dllimport.However, awhile ago I came across this article you may be interested in.[edit]ninja'd++; // bloody SiCrane   ;  Thanks for the replies, looks like I need to read up more on using DLLs.I'll try exporting the function and see how that goes.   