-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSW: Unable to build / test as dll #460
Comments
Thanks for the feedback.
The original goal is to export all necessary symbols to be able to use the fmt library itself DLL on Windows. However, it probably hasn't been kept up to date because the default configuration is a static library. If you want to use fmt as a part of a larger DLL, it might still better to link it a static library and set Another options is to use the header-only mode. |
Would you accept a PR with the FMT_API additions I needed to add if I throw one up? Perhaps only those that affect format.h/cc, as the rest of the code seems to be for tests that weren't designed with DLL support in mind. Header-only is an option. We'd like to reduce as much of the headers that we pull in as possible, but still might do it. |
Absolutely. |
I guess this can be closed now. |
Yes, thanks for the merge! |
Hi there and thanks for the wonderful formatting library. I've been using it for the last couple years and it has been great, my goto for string formatting.
Now I'm in need of building fmtlib as part of a larger shared library, specifically with Visual Studio 2015 / v140, which I do by adding format.cc to its sources and enabling
FMT_EXPORT
. To get this to work however, I had to add some extraFMT_API
declarations, at minimum these. After doing this, I went to see how fmtlib's tests run as is. So I cloned the master branch and generated Visual Studio 2015 projects with-DBUILD_SHARED_LIBS=1
, then proceeded to build the solution and hit a number of other compiler errors. I fixed a few others in this branch but stopped when I hit one that would require restructing a test in order to gain some feedback first on how to proceed. What is the goal of theFMT_API
support?I'm not so familiar with the entirety of the codebase as I've only ever used format.h/cpp (I've ignored posix.h/cpp, printf.h/cpp, etc - are those only for testing and benchmarks?), so I'm not sure if
FMT_API
declarations belong there for the sole purpose of building all of the tests with a shared lib configuration.By the way, the error message I stopped on was due to this line, which causes a
__declspec(dllimport)
to end up in that file while it wasn't actually being imported from a DLL. Instead I think that test could just use the header only version in order to gain extra access to format.cc.The text was updated successfully, but these errors were encountered: