I have my GatewayLT.hpp list class:
Code:
class GatewayList
{
private:
typedef std::list<Gateway*> GatewayStoreType;
GatewayStoreType store;
public:
void AddGateway(Gateway * const gw);
void Send(struct lgw_pkt_rx_s pkt_data);
};
extern "C" void call_GatewayList_Send(struct lgw_pkt_rx_s pkt_data)
{
Global::gatewayList.Send(pkt_data);
return;
}
This list resides in my GlobalDataLT.hpp class as below:
Code:
namespace Global
{
//below defined in GlobalDataLT.cpp
extern GatewayList gatewayList;
}
I want to call Global::gatewayList.Send(...).
1. Including the GlobalDataLT.hpp file in my C code and calling Global::gatewayList.Send() yields 100s of errors
2. Using the extern function call_GatewayList_Send as defined in my GatewayLT.hpp (as you can see above) seems to be the recommended way but when compiling the C file I still get an error:
Code:
sx1272.c:1982: undefined reference to `call_GatewayList_Send'
although it's definitley in the GatewayLT.hpp as you can see and I've defined the prototype for it in my .c file.
So what's the correct way to get around this ?
regards