You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMakeFiles/project_tlinux.dir/include/metric/prometheus.cpp.o: In function `metric::Prometheus::StartHttpServer()':
prometheus_producer.cpp:(.text+0x141): undefined reference to `promhttp_start_daemon(unsigned int, unsigned short, int (*)(void*, sockaddr const*, unsigned int), void*)'
CMakeFiles/project_tlinux.dir/include/metric/prometheus_producer.cpp.o: In function `metric::Prometheus::PrometheusProducer(int)':
prometheus_producer.cpp:(.text+0x1af): undefined reference to `promhttp_start_daemon(unsigned int, unsigned short, int (*)(void*, sockaddr const*, unsigned int), void*)'
prometheus.cpp:(.text+0x1b8): undefined reference to `prom_collector_registry_default_init()'
If you encounter a linking issue like this, please use extern "C" in this way in you C++ project:
#ifdef __cplusplus
extern"C" {
#endif
#include"promhttp.h"// Include the original C header
#include"prom.h"// Include the original C header
#ifdef __cplusplus
}
#endif
If you encounter a linking issue like this, please use extern "C" in this way in you C++ project: