Closed SteveS-Serrano closed 1 year ago
I will have a look this weekend. I am in the processes of tidying up a few things and make the header only version neater.
@Loki-Astari - I'd really like to use this package, but I'm stuck until it can build in our environment. Did you have a chance to look at the issue yet? Can you tell me how I might go about working around it just so I can move forward? Should I drop back to an older version? I saw an old post on stack overflow about the same issue - was that ever resolved?
Are you building on Windows?
If you are then I am trying to get a few build issues sorted before I can rebuild the header only version.
But if you only Mac or Linux then I can switch focus and get the header only version working first. Then move back to solving build issues on Windows.
Linux, Ubuntu 22.04
From: Loki @.> Sent: Tuesday, May 16, 2023 3:49 PM To: @.> Cc: @.>; @.> Subject: Re: [Loki-Astari/ThorsSerializer] Linker fails with header-only build (Issue #81)
Are you building on Windows?
— Reply to this email directly, view it on GitHubhttps://github.com/Loki-Astari/ThorsSerializer/issues/81#issuecomment-1550455738, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AQCFUJR3PV57QRVDJBYOJUDXGP77RANCNFSM6AAAAAAX6YNLNU. You are receiving this because you authored the thread.Message ID: @.***>
You do know that it is available pre-built on linix via brew.
https://docs.brew.sh/Homebrew-on-Linux
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install libyaml brew install magic_enum brew install thors-serializer
Then you can simply link against it in your CMake file:
I am still working on the header only version. I'll update this as I get closer (this week).
I know about the pre-built version. Our project constraints require a header-only version for json serdes.
OK. Fixed the Windows build issues last night. Working on the Header Only version now.
you need add HEADER_ONLY macro
you need add HEADER_ONLY macro
Where? Can you give me an example?
@Ssscy 👍
you need add HEADER_ONLY macro
Thanks!!
I defined -DHEADER_ONLY=1
on the command line and this seems to have resolved the problem. This information should get added to doc/building.md
Update so the header-only version now builds out of the box. The current build tests: .github/workflows/build.yaml also validate the header-only version works out of the box. Latest build: https://github.com/Loki-Astari/ThorsSerializer/actions/runs/5458805284/jobs/9934301849
Describe the bug Header only build fails linking with undefined references to (apparently all) ThorsAnvil::Serialize::JsonPrinter:: and loguru:: functions.
I have installed the header-only branch of the repo:
the latest tagged version of the magic_enum package
I put both these sources in subdirectories and created a CMakeLists.txt file to build them both. Compilation succeeds ok. But linking fails when I try to compile the trivial example as a google test case.
Other than include ThorSerialize/JsonThor.h, what else should I be doing? There aren't any other instructions for the header only build that I can find. Any help greatly appreciated.
CMakeLists.txt for Thors...
google test file (.cpp)
Environment:
Additional context