abumq / easyloggingpp

C++ logging library. It is powerful, supports asynchronous low latency, extendable, light-weight, fast performing, thread and type safe and consists of many built-in features. It provides ability to write logs in your own customized format. It also provide support for logging your classes, third-party libraries, STL and third-party containers etc.
MIT License
3.79k stars 927 forks source link

compile error #797

Open lazy-wangxl opened 3 years ago

lazy-wangxl commented 3 years ago

error:

/home/combile/src/installer/build/ds-nsfocus/internal/driver/mqtt.o:(.bss+0x0): multiple definition of el::base::elStorage' /home/combile/src/installer/build/ds-nsfocus/internal/driver/comm_data.o:(.bss+0x0): first defined here /home/combile/src/installer/build/ds-nsfocus/internal/driver/mqtt.o: In functionstd::__detail::_Hash_node<std::pair<std::string const, std::unordered_map<std::string, unsigned short, std::hash, std::equal_to, std::allocator<std::pair<std::string const, unsigned short> > > >, true>::_M_next() const': /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/gthr-default.h:251: multiple definition of el::elCrashHandler' /home/combile/src/installer/build/ds-nsfocus/internal/driver/comm_data.o:/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/gthr-default.h:251: first defined here /home/combile/src/installer/build/ds-nsfocus/internal/config/config.o:(.bss+0x0): multiple definition ofel::base::elStorage' /home/combile/src/installer/build/ds-nsfocus/internal/driver/comm_data.o:/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/gthr-default.h:248: first defined here /home/combile/src/installer/build/ds-nsfocus/internal/config/config.o: In function operator new(unsigned long, void*)': /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/gthr-default.h:251: multiple definition ofel::elCrashHandler' /home/combile/src/installer/build/ds-nsfocus/internal/driver/comm_data.o:/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/gthr-default.h:251: first defined here

limuy2022 commented 2 years ago

Because it can only compile as a static library. If you try to compile it as a dynamic library, it will throw an error