-
-
Notifications
You must be signed in to change notification settings - Fork 14
Description
First of, thanks for your time and effort!
I am trying to use the qspdlog in a qt project which uses qmake to build (instead of cmake). I am getting undefined reference errors to some of the types in the spdlog library when building the project. I believe I am doing all the right things but this could simply be a cmake/qmake or a library flag issue which I am failing to root cause. I have already spent a good time debugging and trying various things (like building with different versions of C++ in case this is a ABI issue) with no avail. I would appreciate any tip/help/example you can provide to resolve this. Thanks!
Here is a simple code that's failing to build:
#include "main_window.hh"
#include <QApplication>
#include "qspdlog/qspdlog.hpp"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
QSpdLog log;
return a.exec();
}
And here is how qspdlog is added to the .pro file:
INCLUDEPATH += /path/to/the/qspdlog/include
LIBS += -L/path/to/the/qspdlog -lqspdlog_lib
I am using C++17 for building all the libraries (spdlog, qspdlog, and my project).
Note that I am able to build and run the sample code in qspdlog with no problem.
Here are some of the undefined reference errors I get:
qspdlog\build\src/libqspdlog_lib.a(qspdlog.cpp.obj):qspdlog.cpp:(.text+0x10af): undefined reference to `spdlog::sinks::base_sink<std::mutex>::base_sink()'
qspdlog\build\src/libqspdlog_lib.a(qspdlog.cpp.obj):qspdlog.cpp:(.rdata$_ZTVN6spdlog5sinks9base_sinkISt5mutexEE[_ZTVN6spdlog5sinks9base_sinkISt5mutexEE]+0x20): undefined reference to `spdlog::sinks::base_sink<std::mutex>::log(spdlog::details::log_msg const&)'
qspdlog\build\src/libqspdlog_lib.a(qspdlog.cpp.obj):qspdlog.cpp:(.rdata$_ZTVN6spdlog5sinks9base_sinkISt5mutexEE[_ZTVN6spdlog5sinks9base_sinkISt5mutexEE]+0x28): undefined reference to `spdlog::sinks::base_sink<std::mutex>::flush()'
qspdlog\build\src/libqspdlog_lib.a(qspdlog.cpp.obj):qspdlog.cpp:(.rdata$_ZTVN6spdlog5sinks9base_sinkISt5mutexEE[_ZTVN6spdlog5sinks9base_sinkISt5mutexEE]+0x30): undefined reference to `spdlog::sinks::base_sink<std::mutex>::set_pattern(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'