xmake-io / xmake-repo

📦 An official xmake package repository
https://xrepo.xmake.io
Apache License 2.0
685 stars 396 forks source link

reflect-cpp is not header-only since v0.13.0 #4964

Closed Luffbee closed 2 months ago

Luffbee commented 2 months ago

Xmake Version

v2.9.4+HEAD.e85b001

Operating System Version and Architecture

Ubuntu 22.04.4 LTS

Describe Bug

Following code failed to compile. The reason is that reflect-cpp is not header-only since v0.13.0.

#include <rfl.hpp>
#include <rfl/Generic.hpp>

int main() { rfl::Generic b; }
error: /usr/bin/ld: build/.objs/tttm/linux/x86_64/releasedbg/main.cpp.o: in function `main':
/volume/workspace/xron-test-scripts/apps/main.cpp:4: undefined reference to `rfl::Generic::Generic()'
/usr/bin/ld: /volume/workspace/xron-test-scripts/apps/main.cpp:4: undefined reference to `rfl::Generic::~Generic()'
collect2: error: ld returned 1 exit status

Expected Behavior

pass compile

Project Configuration

add_requires("reflect-cpp")

target("tttm", function()
    set_languages("gnuxx20")
    add_files("./main.cpp")
    add_packages("reflect-cpp")
end)

Additional Information and Error Logs

error: /usr/bin/ld: build/.objs/tttm/linux/x86_64/releasedbg/main.cpp.o: in function `main':
/volume/workspace/xron-test-scripts/apps/main.cpp:4: undefined reference to `rfl::Generic::Generic()'
/usr/bin/ld: /volume/workspace/xron-test-scripts/apps/main.cpp:4: undefined reference to `rfl::Generic::~Generic()'
collect2: error: ld returned 1 exit status
star-hengxing commented 2 months ago

Thanks for the feedback, I'll fix it later.