Open zeroxia opened 3 years ago
Are you using the symbol (and it's failing because it's not exported)? Are you linking all the parts together?
I'm not expert on shared library.
All I do is launch cmake-gui
to enable the example project and then "configure" and "generate". I suppose cmake should take care of all those setup.
I think it's clear that in the source code this operator<<
overloading function has no DOCOPT_API
with it (declared in docopt_value.h
).
So on Windows (or for Visual Studio?), I suppose by default a symbol is not exported.
The only change to fix this, as I listed in the OP, is adding DOCOPT_API
to that operator <<
function, the example project would build and run without problem.
Hi,
I build the project using CMake with Visual Studio 2015 Update 3, but the example program has link error.
I think this is due to the following
operator<<
overload function is not exported (the example program links to the DLL)If I move this function declaration to
docopt.h
to enable it to use the macroDOCOPT_API
, then example program is built and run successfully.