Loki-Astari / ThorsMongo

C++ MongoDB API and BSON/JSON Serialization library
GNU General Public License v3.0
316 stars 72 forks source link

Linker Error? #77

Closed IMB11 closed 2 years ago

IMB11 commented 2 years ago

I tried to compile the example, I did #define HEADER_ONLY 1 but it provides a linker error?

error: undefined symbol: ThorsAnvil::Serialize::defaultPolymorphicMarker
>>> referenced by ThorsSerializerUtil.h:249
Loki-Astari commented 2 years ago

Sorry to hear that. Let me try (Its been a while since I did the header only version).

Loki-Astari commented 2 years ago
  1. Remember that you should not define HEADER_ONLY this is defined for you.
    See: ThorSerialize/SerializeConfig.h
  2. To use the header only version you should check out the appropriate branch. git clone --single-branch --branch header-only https://github.com/Loki-Astari/ThorsSerializer.git
  3. In your code you may need to include "ThorSerialize/ThorsSerializerUtil.h" in one of your files. This has defaultPolymorphicMarker defined in it.

I am sorry about the header only version. I don't use so it does not get the best checks.

For the best usage you can pull from homebrew (mac) linuxbrew (linux/Windows) then you don't need to build anything.

Loki-Astari commented 2 years ago

Let me know if this solves your problem.

IMB11 commented 2 years ago

I'm compiling this for an android c++ app, so header only really is my only option at the minute.

This fixed it anyways, thanks :+1:

Loki-Astari commented 1 year ago

Have massively cleaned up the header only version.