Closed mwinters-stuff closed 6 years ago
Thank you for your feedback. I'll fix it ASAP.
You can try to add 'inline' or 'static' for redefinition functions as a quick fix.
It was fixed by latest commit.
Apologize for my delay cause there was too much work to do this week.
First issue is there is no "#pragma once" or #ifndef block around the header to make sure that it can handle being included more than once.
Second, as my app includes the header and uses it in more than once cpp file, the linking failed with
build/debug/obj/main.o: In function
influxdb_cpp::detail::to_hex(unsigned char)': main.cc:(.text+0x0): multiple definition ofinfluxdb_cpp::detail::to_hex(unsigned char)' build/debug/obj/firebase.o:firebase.cc:(.text+0xccc): first defined here build/debug/obj/main.o: In function
influxdb_cpp::detail::url_encode(std::string&, std::string const&)': main.cc:(.text+0x14): multiple definition ofinfluxdb_cpp::detail::url_encode(std::string&, std::string const&)' build/debug/obj/firebase.o:firebase.cc:(.text+0xce0): first defined here build/debug/obj/main.o: In function
influxdb_cpp::detail::http_request(char const, char const, std::string const&, std::string const&, influxdb_cpp::server_info const&, std::string)': main.cc:(.text+0x210): multiple definition of `influxdb_cpp::detail::http_request(char const, char const, std::string const&, std::string const&, influxdb_cpp::server_info const&, std::string)' build/debug/obj/firebase.o:firebase.cc:(.text+0xedc): first defined here build/debug/obj/main.o: In functioninfluxdb_cpp::query(std::string&, std::string const&, influxdb_cpp::server_info const&)': main.cc:(.text+0x2054): multiple definition of
influxdb_cpp::query(std::string&, std::string const&, influxdb_cpp::server_info const&)' build/debug/obj/firebase.o:firebase.cc:(.text+0x2d20): first defined here build/debug/obj/main.o: In functioninfluxdb_cpp::create_db(std::string&, std::string const&, influxdb_cpp::server_info const&)': main.cc:(.text+0x2220): multiple definition of
influxdb_cpp::create_db(std::string&, std::string const&, influxdb_cpp::server_info const&)' build/debug/obj/firebase.o:firebase.cc:(.text+0x2eec): first defined here build/debug/obj/decodereadings.o: In functioninfluxdb_cpp::detail::to_hex(unsigned char)': decodereadings.cc:(.text+0x70): multiple definition of
influxdb_cpp::detail::to_hex(unsigned char)' build/debug/obj/firebase.o:firebase.cc:(.text+0xccc): first defined here build/debug/obj/decodereadings.o: In functioninfluxdb_cpp::detail::url_encode(std::string&, std::string const&)': decodereadings.cc:(.text+0x84): multiple definition of
influxdb_cpp::detail::url_encode(std::string&, std::string const&)' build/debug/obj/firebase.o:firebase.cc:(.text+0xce0): first defined here build/debug/obj/decodereadings.o: In functioninfluxdb_cpp::detail::http_request(char const*, char const*, std::string const&, std::string const&, influxdb_cpp::server_info const&, std::string*)': decodereadings.cc:(.text+0x280): multiple definition of
influxdb_cpp::detail::http_request(char const, char const, std::string const&, std::string const&, influxdb_cpp::server_info const&, std::string)' build/debug/obj/firebase.o:firebase.cc:(.text+0xedc): first defined here build/debug/obj/decodereadings.o: In functioninfluxdb_cpp::query(std::string&, std::string const&, influxdb_cpp::server_info const&)': decodereadings.cc:(.text+0x2070): multiple definition of
influxdb_cpp::query(std::string&, std::string const&, influxdb_cpp::server_info const&)' build/debug/obj/firebase.o:firebase.cc:(.text+0x2d20): first defined here build/debug/obj/decodereadings.o: In functioninfluxdb_cpp::create_db(std::string&, std::string const&, influxdb_cpp::server_info const&)': decodereadings.cc:(.text+0x223c): multiple definition of
influxdb_cpp::create_db(std::string&, std::string const&, influxdb_cpp::server_info const&)' build/debug/obj/firebase.o:firebase.cc:(.text+0x2eec): first defined here build/debug/obj/radiohandler.o: In functioninfluxdb_cpp::detail::to_hex(unsigned char)': radiohandler.cc:(.text+0x2ec): multiple definition of
influxdb_cpp::detail::to_hex(unsigned char)' build/debug/obj/firebase.o:firebase.cc:(.text+0xccc): first defined here build/debug/obj/radiohandler.o: In functioninfluxdb_cpp::detail::url_encode(std::string&, std::string const&)': radiohandler.cc:(.text+0x300): multiple definition of
influxdb_cpp::detail::url_encode(std::string&, std::string const&)' build/debug/obj/firebase.o:firebase.cc:(.text+0xce0): first defined here build/debug/obj/radiohandler.o: In function `influxdb_cpp::detail::http_request(char const, char const, std::string const&, std::string const&, influxdb_cpp::server_info const&, std::string)': radiohandler.cc:(.text+0x4fc): multiple definition ofinfluxdb_cpp::detail::http_request(char const*, char const*, std::string const&, std::string const&, influxdb_cpp::server_info const&, std::string*)' build/debug/obj/firebase.o:firebase.cc:(.text+0xedc): first defined here build/debug/obj/radiohandler.o: In function
influxdb_cpp::query(std::string&, std::string const&, influxdb_cpp::server_info const&)': radiohandler.cc:(.text+0x2340): multiple definition ofinfluxdb_cpp::query(std::string&, std::string const&, influxdb_cpp::server_info const&)' build/debug/obj/firebase.o:firebase.cc:(.text+0x2d20): first defined here build/debug/obj/radiohandler.o: In function
influxdb_cpp::create_db(std::string&, std::string const&, influxdb_cpp::server_info const&)': radiohandler.cc:(.text+0x250c): multiple definition of `influxdb_cpp::create_db(std::string&, std::string const&, influxdb_cpp::server_info const&)' build/debug/obj/firebase.o:firebase.cc:(.text+0x2eec): first defined here collect2: error: ld returned 1 exit status RadioReceiver.make:91: recipe for target 'build/debug/radioreceiver' failed make[1]: [build/debug/radioreceiver] Error 1 Makefile:16: recipe for target 'RadioReceiver' failed make: [RadioReceiver] Error 2`
Already added #pragma once on my copy, but will have to work on the linking..