Lichtso / netLink

Socket and Networking Library using msgpack.org[C++11]
GNU General Public License v3.0
217 stars 48 forks source link

Understanding the serialization #11

Closed DJuego closed 9 years ago

DJuego commented 9 years ago

I am trying to create two functions: FromPaqueteToMsgPack and FromMsgPackToPaquete.

int DeMsgPackAPaquete(const std::unique_ptrMsgPack::Element msgpack, Paquete &paquete); int DePaqueteAMsgPack(const Paquete paquete, std::unique_ptrMsgPack::Element &msgpack);

It works... partially. There are problems with the negative numbers in angulo var. I do not know if the approximation is correct.

It works in Visual Studio. And MinGW gcc 4.9.2 (debug) but in MinGW gcc 5.1.0 there are undefined references :-( Would you guide me?

Thx

Here is the code:

http://paste.ofcode.org/EnwpUuSBX9YMjDWXn8jGVA

Here is the result (MinGW gcc 5.1.0). 

g++.exe -Llib\Debug -o bin\Debug\TestRapido.exe obj\Debug\main.o obj\Debug\UtilidadesMsgPack.o  -lnetlink  
obj\Debug\UtilidadesMsgPack.o: In function `long long MsgPack::Number::getValue<long long>() const':
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:51: undefined reference to `loadFloat32(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:53: undefined reference to `loadFloat64(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:55: undefined reference to `loadUint8(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:57: undefined reference to `loadUint16(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:59: undefined reference to `loadUint32(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:61: undefined reference to `loadUint64(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:63: undefined reference to `loadInt8(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:65: undefined reference to `loadInt16(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:67: undefined reference to `loadInt32(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:69: undefined reference to `loadInt64(unsigned char const*)'
obj\Debug\UtilidadesMsgPack.o: In function `float MsgPack::Number::getValue<float>() const':
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:51: undefined reference to `loadFloat32(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:53: undefined reference to `loadFloat64(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:55: undefined reference to `loadUint8(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:57: undefined reference to `loadUint16(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:59: undefined reference to `loadUint32(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:61: undefined reference to `loadUint64(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:63: undefined reference to `loadInt8(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:65: undefined reference to `loadInt16(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:67: undefined reference to `loadInt32(unsigned char const*)'
P:\Mis-Proyectos\Cross-compilados\EV3\TestRapido/inc/netLink/include/Number.h:69: undefined reference to `loadInt64(unsigned char const*)'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
21 error(s), 0 warning(s) (0 minute(s), 0 second(s))
Lichtso commented 9 years ago

I pushed a commit... Could you try it again?

DJuego commented 9 years ago

It works! Problem solved! ;-)