When you say extern "C"
you tell the compiler to create a function that can be called from other languages than C++ (most notably C). However, no other language than C++ have std::list
, so it can not create such a function because the return type is part of the function signature in C++. And if you don't create a function which has C-compatible return type (or arguments) you can not create an extern "C"
function.
If you're going to use the DLL from a C++ program there is no need for the extern "C"
part. The C++ compiler and linker will be able to handle the mangled name without problems anyway.