0

ALL,

I have a DLL from which I am exporting a function. There is only one C++ file with the source code.

It turns out that I need to add a function to that source C++ file and call this function from the exported function. Unfortunately MSVC 2010 throws an error:

extern "C" declspec(__dllexport) ExportedFunc()
{
    int result = Foo();
}

int Foo();

Foo(): identifier not found.

I tried to export the Foo() function but it didn't change anything.

What is the best way to fix it?

Thank you.

Igor
  • 5,620
  • 11
  • 51
  • 103

1 Answers1

0

I think @Captain has pointed the possible error. I will just add some points that might help you deal with linking better.

It is useful to know compiler and linker errors separately. You can compile client code with -c flag that will only give errors from the compiler which includes identifier not found. These errors have nothing to do with your library and does not require the library at all. Once you clear these errors, compile without the -c flag (you can use the .o object file generated with -c flag instead of .cpp) and your library to link and make an executable.