Arduino WiFi UDP upload problems - c++

I recently got an arduino and wifi sheild but i am having trouble with the wifi library specifically the udp class. the connection and everything works fine when i dont have the WiFiUdp.h and cpp files in the folder. I can get on the internet, send data, get a green and blue light which establishes connection and data being sent. But the moment i include wifiudp.h in my sketch., I get a bunch of errors. the errors are listed below. I got my library from github, downloaded it, extracted and stuffed it into the library like i did with everything else on github. Its not my code because when i use the wifisendreceive example on the arduino website, i get the same errors when i upload it. something isnt working right in this 'master' arduino file from github. has anyone experienced the same issue i am dealing with and does anyone know how to fix this? I know as many errors as i get, its probably not including or defining something, i just dont know where and what. the errors explain where its not working but the problem is there is a bunch of them. here are the errors. thanks for anyone that can shed light on this udp class. By the way, this is just half of the errors. I am not allowed to send more than 3000 characters in the body. the errors are the same type just from different files, etc.
WiFi\WiFi.cpp.o: In function `WiFiClass::getSocket()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:26: multiple definition of `WiFiClass::getSocket()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:25: first defined here
c:/users/albertr/desktop/arduino-1.0.3/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/bin/ld.exe: Disabling relaxation: it will not work with multiple definitions
WiFi\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:26: multiple definition of `WiFiClass::_server_port'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:25: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::hostByName(char const*, IPAddress&)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:227: multiple definition of `WiFiClass::hostByName(char const*, IPAddress&)'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:194: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::status()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:224: multiple definition of `WiFiClass::status()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:191: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::encryptionType(unsigned char)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:217: multiple definition of `WiFiClass::encryptionType(unsigned char)'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:184: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::RSSI(unsigned char)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:212: multiple definition of `WiFiClass::RSSI(unsigned char)'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:179: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::SSID(unsigned char)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:207: multiple definition of `WiFiClass::SSID(unsigned char)'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:174: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::scanNetworks()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:191: multiple definition of `WiFiClass::scanNetworks()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:158: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::encryptionType()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:187: multiple definition of `WiFiClass::encryptionType()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:154: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::RSSI()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:182: multiple definition of `WiFiClass::RSSI()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:149: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::BSSID(unsigned char*)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:173: multiple definition of `WiFiClass::BSSID(unsigned char*)'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:140: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::SSID()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:170: multiple definition of `WiFiClass::SSID()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:137: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::gatewayIP()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:161: multiple definition of `WiFiClass::gatewayIP()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:128: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::subnetMask()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:154: multiple definition of `WiFiClass::subnetMask()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:121: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::localIP()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:147: multiple definition of `WiFiClass::localIP()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:114: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::macAddress(unsigned char*)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:140: multiple definition of `WiFiClass::macAddress(unsigned char*)'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:107: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::disconnect()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:137: multiple definition of `WiFiClass::disconnect()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:104: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::begin(char*, char const*)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:82: multiple definition of `WiFiClass::begin(char*, char const*)'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:82: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::begin(char*, unsigned char, char const*)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:63: multiple definition of `WiFiClass::begin(char*, unsigned char, char const*)'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:62: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::begin(char*)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:43: multiple definition of `WiFiClass::begin(char*)'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:42: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::firmwareVersion()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:40: multiple definition of `WiFiClass::firmwareVersion()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:39: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::init()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:23: multiple definition of `WiFiClass::init()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:22: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::init()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:23: multiple definition of `WiFiClass::WiFiClass()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:22: first defined here
WiFi\WiFi.cpp.o: In function `WiFiClass::init()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:23: multiple definition of `WiFiClass::WiFiClass()'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:22: first defined here
WiFi\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:26: multiple definition of `WiFiClass::_state'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:25: first defined here
WiFi\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFi.cpp:26: multiple definition of `WiFi'
WiFi1\WiFi.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFi.cpp:25: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:17: multiple definition of `WiFiClient::WiFiClient()'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:17: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:17: multiple definition of `WiFiClient::WiFiClient()'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:17: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:20: multiple definition of `WiFiClient::WiFiClient(unsigned char)'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:20: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:20: multiple definition of `WiFiClient::WiFiClient(unsigned char)'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:20: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::write(unsigned char)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:56: multiple definition of `WiFiClient::write(unsigned char)'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:56: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::flush()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:121: multiple definition of `WiFiClient::flush()'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:121: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::operator bool()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:164: multiple definition of `WiFiClient::operator bool()'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:164: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::getFirstSocket()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:169: multiple definition of `WiFiClient::getFirstSocket()'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:169: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::status()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:157: multiple definition of `WiFiClient::status()'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:157: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::connected()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:142: multiple definition of `WiFiClient::connected()'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:142: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::stop()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:126: multiple definition of `WiFiClient::stop()'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:126: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::peek()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:112: multiple definition of `WiFiClient::peek()'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:112: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::read()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:96: multiple definition of `WiFiClient::read()'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:96: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::read(unsigned char*, unsigned int)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:106: multiple definition of `WiFiClient::read(unsigned char*, unsigned int)'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:106: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::available()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:88: multiple definition of `WiFiClient::available()'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:88: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::write(unsigned char const*, unsigned int)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:60: multiple definition of `WiFiClient::write(unsigned char const*, unsigned int)'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:60: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::connect(IPAddress, unsigned int)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:32: multiple definition of `WiFiClient::connect(IPAddress, unsigned int)'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:32: first defined here
WiFi\WiFiClient.cpp.o: In function `WiFiClient::connect(char const*, unsigned int)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiClient.cpp:23: multiple definition of `WiFiClient::connect(char const*, unsigned int)'
WiFi1\WiFiClient.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiClient.cpp:23: first defined here
WiFi\WiFiClient.cpp.o:(.data._ZN10WiFiClient8_srcportE+0x0): multiple definition of `WiFiClient::_srcport'
WiFi1\WiFiClient.cpp.o:(.data._ZN10WiFiClient8_srcportE+0x0): first defined here
WiFi\WiFiServer.cpp.o: In function `WiFiServer':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiServer.cpp:12: multiple definition of `WiFiServer::WiFiServer(unsigned int)'
WiFi1\WiFiServer.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiServer.cpp:12: first defined here
WiFi\WiFiServer.cpp.o: In function `WiFiServer':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiServer.cpp:12: multiple definition of `WiFiServer::WiFiServer(unsigned int)'
WiFi1\WiFiServer.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiServer.cpp:12: first defined here
WiFi\WiFiServer.cpp.o: In function `WiFiServer::write(unsigned char)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiServer.cpp:66: multiple definition of `WiFiServer::write(unsigned char)'
WiFi1\WiFiServer.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiServer.cpp:65: first defined here
WiFi\WiFiServer.cpp.o: In function `WiFiServer::write(unsigned char const*, unsigned int)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiServer.cpp:71: multiple definition of `WiFiServer::write(unsigned char const*, unsigned int)'
WiFi1\WiFiServer.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiServer.cpp:70: first defined here
WiFi\WiFiServer.cpp.o: In function `WiFiServer::status()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiServer.cpp:62: multiple definition of `WiFiServer::status()'
WiFi1\WiFiServer.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiServer.cpp:61: first defined here
WiFi\WiFiServer.cpp.o: In function `WiFiServer::available(unsigned char*)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiServer.cpp:28: multiple definition of `WiFiServer::available(unsigned char*)'
WiFi1\WiFiServer.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiServer.cpp:27: first defined here
WiFi\WiFiServer.cpp.o: In function `WiFiServer::begin()':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi/WiFiServer.cpp:17: multiple definition of `WiFiServer::begin()'
WiFi1\WiFiServer.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1/WiFiServer.cpp:17: first defined here
WiFi\utility\socket.c.o: In function `socket':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/socket.c:10: multiple definition of `socket'
WiFi1\utility\socket.c.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/socket.c:10: first defined here
WiFi\utility\socket.c.o: In function `close':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/socket.c:11: multiple definition of `close'
WiFi1\utility\socket.c.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/socket.c:11: first defined here
WiFi\utility\socket.c.o: In function `connect':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/socket.c:12: multiple definition of `connect'
WiFi1\utility\socket.c.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/socket.c:12: first defined here
WiFi\utility\socket.c.o: In function `disconnect':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/socket.c:13: multiple definition of `disconnect'
WiFi1\utility\socket.c.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/socket.c:13: first defined here
WiFi\utility\socket.c.o: In function `listen':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/socket.c:14: multiple definition of `listen'
WiFi1\utility\socket.c.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/socket.c:14: first defined here
WiFi\utility\socket.c.o: In function `send':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/socket.c:15: multiple definition of `send'
WiFi1\utility\socket.c.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/socket.c:15: first defined here
WiFi\utility\socket.c.o: In function `recv':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/socket.c:16: multiple definition of `recv'
WiFi1\utility\socket.c.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/socket.c:16: first defined here
WiFi\utility\socket.c.o: In function `sendto':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/socket.c:17: multiple definition of `sendto'
WiFi1\utility\socket.c.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/socket.c:17: first defined here
WiFi\utility\socket.c.o: In function `recvfrom':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/socket.c:18: multiple definition of `recvfrom'
WiFi1\utility\socket.c.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/socket.c:18: first defined here
WiFi\utility\socket.c.o: In function `igmpsend':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/socket.c:20: multiple definition of `igmpsend'
WiFi1\utility\socket.c.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/socket.c:20: first defined here
WiFi\utility\server_drv.cpp.o: In function `ServerDrv::availData(unsigned char)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/server_drv.cpp:125: multiple definition of `ServerDrv::availData(unsigned char)'
WiFi1\utility\server_drv.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/server_drv.cpp:123: first defined here
WiFi\utility\server_drv.cpp.o: In function `ServerDrv::getClientState(unsigned char)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/server_drv.cpp:104: multiple definition of `ServerDrv::getClientState(unsigned char)'
WiFi1\utility\server_drv.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/server_drv.cpp:102: first defined here
WiFi\utility\server_drv.cpp.o: In function `ServerDrv::getServerState(unsigned char)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/server_drv.cpp:83: multiple definition of `ServerDrv::getServerState(unsigned char)'
WiFi1\utility\server_drv.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/server_drv.cpp:81: first defined here
WiFi\utility\server_drv.cpp.o: In function `ServerDrv::stopClient(unsigned char)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/server_drv.cpp:62: multiple definition of `ServerDrv::stopClient(unsigned char)'
WiFi1\utility\server_drv.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/server_drv.cpp:60: first defined here
WiFi\utility\server_drv.cpp.o: In function `ServerDrv::checkDataSent(unsigned char)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/server_drv.cpp:275: multiple definition of `ServerDrv::checkDataSent(unsigned char)'
WiFi1\utility\server_drv.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/server_drv.cpp:227: first defined here
WiFi\utility\server_drv.cpp.o: In function `ServerDrv::sendData(unsigned char, unsigned char const*, unsigned int)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/server_drv.cpp:248: multiple definition of `ServerDrv::sendData(unsigned char, unsigned char const*, unsigned int)'
WiFi1\utility\server_drv.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/server_drv.cpp:200: first defined here
WiFi\utility\server_drv.cpp.o: In function `ServerDrv::getDataBuf(unsigned char, unsigned char*, unsigned int*)':
C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi\utility/server_drv.cpp:173: multiple definition of `ServerDrv::getDataBuf(unsigned char, unsigned char*, unsigned int*)'
WiFi1\utility\server_drv.cpp.o:C:\Users\AlbertR\Desktop\arduino-1.0.3\libraries\WiFi1\utility/server_drv.cpp:176: first defined here

multiple definition means you are either linking the same symbols multiple times or you are have a header included multiple times without proper include guards. In your case it looks like you have a WiFi and WiFi1 folder containing the same library getting linked (linking the same symbols multiple times). – Joe

Related

Constexpr class function definition linking error [duplicate]

This question already has answers here:
C++17: Defining static constexpr member functons in .cpp file
(1 answer)
Is it possible to declare constexpr class in a header and define it in a separate .cpp file?
(2 answers)
Undefined symbols for constexpr function
(3 answers)
Closed 5 months ago.
Function is declared in hpp file like this:
class StringProcessor
{
static constexpr const char* string_process(const char* initial_string, std::size_t string_length, const char* key, std::size_t key_length);
};
And defined in cpp like this:
constexpr const char* StringProcessor:: string_process(const char* initial_string, std::size_t string_length, const char* key, std::size_t key_length)
{
...
}
How do I call it, because following line throws Undefined symbols for architecture x86_64: "StringProcessor::string_process(char const*, unsigned long, char const*, unsigned long)", referenced from: _main in main.cpp.o error:
std::cout << StringProcessor::string_process("Test", 4, "Test", 4) << std::endl;
constexpr functions are implicitly inline and therefore need to be defined in every translation unit where they are used. That usually means that the definition should go into a header shared between the translation units using the function.
Also, in order for constexpr to be of any use, the function needs to be defined before its potential use in a constant expression. Therefore it usually only really makes sense to define it directly on the first declaration, i.e. here in the class definition in the header.

Compiling C++ project with optimization level

I have not mine C++ project, which I can successfully compile using this line:
g++ -o minit minit.c MinitGlobal.h Item.c ItemsetQueue.c Transaction.c Error.h Dataset.c SubDataset.c RankItems.c MinitAlgo.c but if I add optimization level like below (same for -O3):
[ec2-user#ip-10-209-16-177 minit++]$ g++ -o -O0 minit minit.c MinitGlobal.h Item.c ItemsetQueue.c Transaction.c Error.h Dataset.c SubDataset.c RankItems.c MinitAlgo.c
minit: In function `_start':
(.text+0x2a8): multiple definition of `_start'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.text+0x0): first defined here
minit: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crti.o:(.fini+0x0): first defined here
minit:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.rodata.cst4+0x0): first defined here
minit: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.data+0x0): first defined here
minit:(.rodata+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/crtbegin.o:(.rodata+0x0): first defined here
minit: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crti.o:(.init+0x0): first defined here
/tmp/cc0cvoT6.o: In function `main':
minit.c:(.text+0x4d2): multiple definition of `main'
minit:(.text+0x0): first defined here
/tmp/ccRfRvQv.o:(.bss+0x0): multiple definition of `minit::Itemset::count'
minit:(.bss+0x638): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::ItemsetQueue()':
ItemsetQueue.c:(.text+0x0): multiple definition of `minit::ItemsetQueue::ItemsetQueue()'
minit:(.text+0x390): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::enqueue(unsigned int const&, unsigned int)':
ItemsetQueue.c:(.text+0x7e): multiple definition of `minit::ItemsetQueue::enqueue(unsigned int const&, unsigned int)'
minit:(.text+0x430): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::enqueue(minit::Itemset const&, unsigned int const&, unsigned int)':
ItemsetQueue.c:(.text+0xfe): multiple definition of `minit::ItemsetQueue::enqueue(minit::Itemset const&, unsigned int const&, unsigned int)'
minit:(.text+0x520): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::dequeue()':
ItemsetQueue.c:(.text+0x186): multiple definition of `minit::ItemsetQueue::dequeue()'
minit:(.text+0x3b0): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::print(std::basic_ostream<char, std::char_traits<char> >&) const':
ItemsetQueue.c:(.text+0x1f2): multiple definition of `minit::ItemsetQueue::print(std::basic_ostream<char, std::char_traits<char> >&) const'
minit:(.text+0x6d0): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::printItemsets(std::basic_ostream<char, std::char_traits<char> >&) const':
ItemsetQueue.c:(.text+0x306): multiple definition of `minit::ItemsetQueue::printItemsets(std::basic_ostream<char, std::char_traits<char> >&) const'
minit:(.text+0xa60): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::ItemsetQueue()':
ItemsetQueue.c:(.text+0x0): multiple definition of `minit::ItemsetQueue::ItemsetQueue()'
minit:(.text+0x390): first defined here
/tmp/cc6ZqTIl.o: In function `minit::Transaction::readTransaction(std::basic_istream<char, std::char_traits<char> >&)':
Transaction.c:(.text+0x0): multiple definition of `minit::Transaction::readTransaction(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x16b0): first defined here
/tmp/cc6ZqTIl.o: In function `minit::Transaction::readValue(std::basic_istream<char, std::char_traits<char> >&)':
Transaction.c:(.text+0x14a): multiple definition of `minit::Transaction::readValue(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x15b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
Dataset.c:(.text+0x0): multiple definition of `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x29b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::readDataset(std::basic_istream<char, std::char_traits<char> >&)':
Dataset.c:(.text+0x644): multiple definition of `minit::Dataset::readDataset(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x2350): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::~Dataset()':
Dataset.c:(.text+0x512): multiple definition of `minit::Dataset::~Dataset()'
minit:(.text+0x1af0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::toString() const':
Dataset.c:(.text+0x7f0): multiple definition of `minit::Dataset::toString() const'
minit:(.text+0x1c00): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::printColumnInfo()':
Dataset.c:(.text+0x9d6): multiple definition of `minit::Dataset::printColumnInfo()'
minit:(.text+0x2200): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
Dataset.c:(.text+0x0): multiple definition of `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x29b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::~Dataset()':
Dataset.c:(.text+0x512): multiple definition of `minit::Dataset::~Dataset()'
minit:(.text+0x1af0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::Dataset const&)':
SubDataset.c:(.text+0x0): multiple definition of `minit::SubDataset::SubDataset(minit::Dataset const&)'
minit:(.text+0x3c20): first defined here
/tmp/cc3PBOXh.o:(.bss+0x0): multiple definition of `minit::SubDataset::count'
minit:(.bss+0x670): first defined here
/tmp/cc3PBOXh.o:(.bss+0x10): multiple definition of `minit::SubDataset::preComputeCallsPerMaxc'
minit:(.bss+0x650): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::SubDataset const&)':
SubDataset.c:(.text+0x11a): multiple definition of `minit::SubDataset::SubDataset(minit::SubDataset const&)'
minit:(.text+0x3360): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::~SubDataset()':
SubDataset.c:(.text+0x1b8): multiple definition of `minit::SubDataset::~SubDataset()'
minit:(.text+0x33f0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::~SubDataset()':
SubDataset.c:(.text+0x1b8): multiple definition of `minit::SubDataset::~SubDataset()'
minit:(.text+0x33f0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::supportSet(unsigned int) const':
SubDataset.c:(.text+0x242): multiple definition of `minit::SubDataset::supportSet(unsigned int) const'
minit:(.text+0x33a0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::preComputeSupportSets(minit::RankItems const&, int, int, int)':
SubDataset.c:(.text+0x2ac): multiple definition of `minit::SubDataset::preComputeSupportSets(minit::RankItems const&, int, int, int)'
minit:(.text+0x40d0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::preComputeSupportSetsLeafNode(minit::RankItems const&, unsigned int, unsigned int)':
SubDataset.c:(.text+0x514): multiple definition of `minit::SubDataset::preComputeSupportSetsLeafNode(minit::RankItems const&, unsigned int, unsigned int)'
minit:(.text+0x3f30): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::SubDataset const&)':
SubDataset.c:(.text+0x11a): multiple definition of `minit::SubDataset::SubDataset(minit::SubDataset const&)'
minit:(.text+0x3360): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::doneWithAnchorItem(unsigned int const&)':
SubDataset.c:(.text+0x6a0): multiple definition of `minit::SubDataset::doneWithAnchorItem(unsigned int const&)'
minit:(.text+0x37e0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::Dataset const&)':
SubDataset.c:(.text+0x0): multiple definition of `minit::SubDataset::SubDataset(minit::Dataset const&)'
minit:(.text+0x3c20): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::Dataset const&)':
RankItems.c:(.text+0x0): multiple definition of `minit::RankItems::RankItems(minit::Dataset const&)'
minit:(.text+0x56c0): first defined here
/tmp/ccWMQMqM.o:(.bss+0x0): multiple definition of `minit::RankItems::count'
minit:(.bss+0x680): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)':
RankItems.c:(.text+0x1fa): multiple definition of `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)'
minit:(.text+0x5990): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::toString() const':
RankItems.c:(.text+0x4e0): multiple definition of `minit::RankItems::toString() const'
minit:(.text+0x5130): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::Dataset const&)':
RankItems.c:(.text+0x0): multiple definition of `minit::RankItems::RankItems(minit::Dataset const&)'
minit:(.text+0x56c0): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)':
RankItems.c:(.text+0x1fa): multiple definition of `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)'
minit:(.text+0x5990): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
MinitAlgo.c:(.text+0x0): multiple definition of `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x6eb0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::~MinitAlgo()':
MinitAlgo.c:(.text+0x128): multiple definition of `minit::MinitAlgo::~MinitAlgo()'
minit:(.text+0x6dc0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::search(int, int, bool)':
MinitAlgo.c:(.text+0x1ee): multiple definition of `minit::MinitAlgo::search(int, int, bool)'
minit:(.text+0x93f0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::minitRecursive(minit::SubDataset&, minit::RankItems const&, int, int)':
MinitAlgo.c:(.text+0x6fc): multiple definition of `minit::MinitAlgo::minitRecursive(minit::SubDataset&, minit::RankItems const&, int, int)'
minit:(.text+0x9860): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::processMinII(int, unsigned int, unsigned int)':
MinitAlgo.c:(.text+0x678): multiple definition of `minit::MinitAlgo::processMinII(int, unsigned int, unsigned int)'
minit:(.text+0x6d70): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::requiredSupportTransactionsExist(unsigned int const&, minit::Itemset const&, unsigned int const&, minit::SubDataset const&, int)':
MinitAlgo.c:(.text+0x10f0): multiple definition of `minit::MinitAlgo::requiredSupportTransactionsExist(unsigned int const&, minit::Itemset const&, unsigned int const&, minit::SubDataset const&, int)'
minit:(.text+0x6fe0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
MinitAlgo.c:(.text+0x0): multiple definition of `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x6eb0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::~MinitAlgo()':
MinitAlgo.c:(.text+0x128): multiple definition of `minit::MinitAlgo::~MinitAlgo()'
minit:(.text+0x6dc0): first defined here
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/crtend.o:(.dtors+0x0): multiple definition of `__DTOR_END__'
minit:(.dtors+0x8): first defined here
/usr/bin/ld: error in minit(.eh_frame); no .eh_frame_hdr table will be created.
collect2: ld returned 1 exit status
[ec2-user#ip-10-209-16-177 minit++]$
[ec2-user#ip-10-209-16-177 minit++]$ g++ -o -O0 minit minit.c MinitGlobal.h Item.c ItemsetQueue.c Transaction.c Error.h Dataset.c SubDataset.c RankItems.c MinitAlgo.c
minit: In function `_start':
(.text+0x2a8): multiple definition of `_start'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.text+0x0): first defined here
minit: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crti.o:(.fini+0x0): first defined here
minit:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.rodata.cst4+0x0): first defined here
minit: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crt1.o:(.data+0x0): first defined here
minit:(.rodata+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/crtbegin.o:(.rodata+0x0): first defined here
minit: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/../../../../lib64/crti.o:(.init+0x0): first defined here
/tmp/cc0cvoT6.o: In function `main':
minit.c:(.text+0x4d2): multiple definition of `main'
minit:(.text+0x0): first defined here
/tmp/ccRfRvQv.o:(.bss+0x0): multiple definition of `minit::Itemset::count'
minit:(.bss+0x638): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::ItemsetQueue()':
ItemsetQueue.c:(.text+0x0): multiple definition of `minit::ItemsetQueue::ItemsetQueue()'
minit:(.text+0x390): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::enqueue(unsigned int const&, unsigned int)':
ItemsetQueue.c:(.text+0x7e): multiple definition of `minit::ItemsetQueue::enqueue(unsigned int const&, unsigned int)'
minit:(.text+0x430): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::enqueue(minit::Itemset const&, unsigned int const&, unsigned int)':
ItemsetQueue.c:(.text+0xfe): multiple definition of `minit::ItemsetQueue::enqueue(minit::Itemset const&, unsigned int const&, unsigned int)'
minit:(.text+0x520): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::dequeue()':
ItemsetQueue.c:(.text+0x186): multiple definition of `minit::ItemsetQueue::dequeue()'
minit:(.text+0x3b0): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::print(std::basic_ostream<char, std::char_traits<char> >&) const':
ItemsetQueue.c:(.text+0x1f2): multiple definition of `minit::ItemsetQueue::print(std::basic_ostream<char, std::char_traits<char> >&) const'
minit:(.text+0x6d0): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::printItemsets(std::basic_ostream<char, std::char_traits<char> >&) const':
ItemsetQueue.c:(.text+0x306): multiple definition of `minit::ItemsetQueue::printItemsets(std::basic_ostream<char, std::char_traits<char> >&) const'
minit:(.text+0xa60): first defined here
/tmp/ccQhesuV.o: In function `minit::ItemsetQueue::ItemsetQueue()':
ItemsetQueue.c:(.text+0x0): multiple definition of `minit::ItemsetQueue::ItemsetQueue()'
minit:(.text+0x390): first defined here
/tmp/cc6ZqTIl.o: In function `minit::Transaction::readTransaction(std::basic_istream<char, std::char_traits<char> >&)':
Transaction.c:(.text+0x0): multiple definition of `minit::Transaction::readTransaction(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x16b0): first defined here
/tmp/cc6ZqTIl.o: In function `minit::Transaction::readValue(std::basic_istream<char, std::char_traits<char> >&)':
Transaction.c:(.text+0x14a): multiple definition of `minit::Transaction::readValue(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x15b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
Dataset.c:(.text+0x0): multiple definition of `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x29b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::readDataset(std::basic_istream<char, std::char_traits<char> >&)':
Dataset.c:(.text+0x644): multiple definition of `minit::Dataset::readDataset(std::basic_istream<char, std::char_traits<char> >&)'
minit:(.text+0x2350): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::~Dataset()':
Dataset.c:(.text+0x512): multiple definition of `minit::Dataset::~Dataset()'
minit:(.text+0x1af0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::toString() const':
Dataset.c:(.text+0x7f0): multiple definition of `minit::Dataset::toString() const'
minit:(.text+0x1c00): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::printColumnInfo()':
Dataset.c:(.text+0x9d6): multiple definition of `minit::Dataset::printColumnInfo()'
minit:(.text+0x2200): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
Dataset.c:(.text+0x0): multiple definition of `minit::Dataset::Dataset(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x29b0): first defined here
/tmp/ccZandoO.o: In function `minit::Dataset::~Dataset()':
Dataset.c:(.text+0x512): multiple definition of `minit::Dataset::~Dataset()'
minit:(.text+0x1af0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::Dataset const&)':
SubDataset.c:(.text+0x0): multiple definition of `minit::SubDataset::SubDataset(minit::Dataset const&)'
minit:(.text+0x3c20): first defined here
/tmp/cc3PBOXh.o:(.bss+0x0): multiple definition of `minit::SubDataset::count'
minit:(.bss+0x670): first defined here
/tmp/cc3PBOXh.o:(.bss+0x10): multiple definition of `minit::SubDataset::preComputeCallsPerMaxc'
minit:(.bss+0x650): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::SubDataset const&)':
SubDataset.c:(.text+0x11a): multiple definition of `minit::SubDataset::SubDataset(minit::SubDataset const&)'
minit:(.text+0x3360): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::~SubDataset()':
SubDataset.c:(.text+0x1b8): multiple definition of `minit::SubDataset::~SubDataset()'
minit:(.text+0x33f0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::~SubDataset()':
SubDataset.c:(.text+0x1b8): multiple definition of `minit::SubDataset::~SubDataset()'
minit:(.text+0x33f0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::supportSet(unsigned int) const':
SubDataset.c:(.text+0x242): multiple definition of `minit::SubDataset::supportSet(unsigned int) const'
minit:(.text+0x33a0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::preComputeSupportSets(minit::RankItems const&, int, int, int)':
SubDataset.c:(.text+0x2ac): multiple definition of `minit::SubDataset::preComputeSupportSets(minit::RankItems const&, int, int, int)'
minit:(.text+0x40d0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::preComputeSupportSetsLeafNode(minit::RankItems const&, unsigned int, unsigned int)':
SubDataset.c:(.text+0x514): multiple definition of `minit::SubDataset::preComputeSupportSetsLeafNode(minit::RankItems const&, unsigned int, unsigned int)'
minit:(.text+0x3f30): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::SubDataset const&)':
SubDataset.c:(.text+0x11a): multiple definition of `minit::SubDataset::SubDataset(minit::SubDataset const&)'
minit:(.text+0x3360): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::doneWithAnchorItem(unsigned int const&)':
SubDataset.c:(.text+0x6a0): multiple definition of `minit::SubDataset::doneWithAnchorItem(unsigned int const&)'
minit:(.text+0x37e0): first defined here
/tmp/cc3PBOXh.o: In function `minit::SubDataset::SubDataset(minit::Dataset const&)':
SubDataset.c:(.text+0x0): multiple definition of `minit::SubDataset::SubDataset(minit::Dataset const&)'
minit:(.text+0x3c20): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::Dataset const&)':
RankItems.c:(.text+0x0): multiple definition of `minit::RankItems::RankItems(minit::Dataset const&)'
minit:(.text+0x56c0): first defined here
/tmp/ccWMQMqM.o:(.bss+0x0): multiple definition of `minit::RankItems::count'
minit:(.bss+0x680): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)':
RankItems.c:(.text+0x1fa): multiple definition of `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)'
minit:(.text+0x5990): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::toString() const':
RankItems.c:(.text+0x4e0): multiple definition of `minit::RankItems::toString() const'
minit:(.text+0x5130): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::Dataset const&)':
RankItems.c:(.text+0x0): multiple definition of `minit::RankItems::RankItems(minit::Dataset const&)'
minit:(.text+0x56c0): first defined here
/tmp/ccWMQMqM.o: In function `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)':
RankItems.c:(.text+0x1fa): multiple definition of `minit::RankItems::RankItems(minit::SubDataset&, int, minit::RankItems const&, int, unsigned int)'
minit:(.text+0x5990): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
MinitAlgo.c:(.text+0x0): multiple definition of `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x6eb0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::~MinitAlgo()':
MinitAlgo.c:(.text+0x128): multiple definition of `minit::MinitAlgo::~MinitAlgo()'
minit:(.text+0x6dc0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::search(int, int, bool)':
MinitAlgo.c:(.text+0x1ee): multiple definition of `minit::MinitAlgo::search(int, int, bool)'
minit:(.text+0x93f0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::minitRecursive(minit::SubDataset&, minit::RankItems const&, int, int)':
MinitAlgo.c:(.text+0x6fc): multiple definition of `minit::MinitAlgo::minitRecursive(minit::SubDataset&, minit::RankItems const&, int, int)'
minit:(.text+0x9860): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::processMinII(int, unsigned int, unsigned int)':
MinitAlgo.c:(.text+0x678): multiple definition of `minit::MinitAlgo::processMinII(int, unsigned int, unsigned int)'
minit:(.text+0x6d70): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::requiredSupportTransactionsExist(unsigned int const&, minit::Itemset const&, unsigned int const&, minit::SubDataset const&, int)':
MinitAlgo.c:(.text+0x10f0): multiple definition of `minit::MinitAlgo::requiredSupportTransactionsExist(unsigned int const&, minit::Itemset const&, unsigned int const&, minit::SubDataset const&, int)'
minit:(.text+0x6fe0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
MinitAlgo.c:(.text+0x0): multiple definition of `minit::MinitAlgo::MinitAlgo(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
minit:(.text+0x6eb0): first defined here
/tmp/ccDeL01h.o: In function `minit::MinitAlgo::~MinitAlgo()':
MinitAlgo.c:(.text+0x128): multiple definition of `minit::MinitAlgo::~MinitAlgo()'
minit:(.text+0x6dc0): first defined here
/usr/lib/gcc/x86_64-amazon-linux/4.6.3/crtend.o:(.dtors+0x0): multiple definition of `__DTOR_END__'
minit:(.dtors+0x8): first defined here
/usr/bin/ld: error in minit(.eh_frame); no .eh_frame_hdr table will be created.
collect2: ld returned 1 exit status
[ec2-user#ip-10-209-16-177 minit++]$
It crashes. All the errors are of "multiple definition" nature, could you please suggest how to fix that?
gcc/g++ expect the name of the output file directly after -o. You mixed up the argument order:
Instead of g++ -o -O0 minit ... try g++ -O0 -o minit ....
g++ tried to link the executable minit and the objects files together into one assembly, that's why you get these errors.

Compiling SAX printing example (xerces)

I tried several times, it's probably fairly easy to solve but I can't see the solution.
I tried to compile SAXPrint example from xerces site ( the link to four *.cpp and *.hpp files is here [sorry for using skydrive, my FTP died]) using g++ in linux (got xerces-dev package) and windows (MinGW with libraries) and I couldn't succeed Is there any chance you could lend me a hand? I tried command:
g++ SAXPrint.hpp SAXPrint.cpp SAXPrintHandlers.hpp SAXPrintHandlers.cpp -o output
and it gave me:
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x0): multiple definition of `SAXPrintHandlers::SAXPrint
Handlers(char const*, xercesc_3_1::XMLFormatter::UnRepFlags)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x0): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x0): multiple definition of `SAXPrintHandlers::SAXPrint
Handlers(char const*, xercesc_3_1::XMLFormatter::UnRepFlags)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x0): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x11e): multiple definition of `SAXPrintHandlers::~SAXPr
intHandlers()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x11e): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x11e): multiple definition of `SAXPrintHandlers::~SAXPr
intHandlers()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x11e): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x1c9): multiple definition of `non-virtual thunk to SAX
PrintHandlers::~SAXPrintHandlers()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x1c9): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x1d3): multiple definition of `non-virtual thunk to SAX
PrintHandlers::~SAXPrintHandlers()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x1d3): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x1dd): multiple definition of `non-virtual thunk to SAX
PrintHandlers::~SAXPrintHandlers()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x1dd): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x1e7): multiple definition of `non-virtual thunk to SAX
PrintHandlers::~SAXPrintHandlers()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x1e7): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x1f2): multiple definition of `SAXPrintHandlers::~SAXPr
intHandlers()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x1f2): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x212): multiple definition of `non-virtual thunk to SAX
PrintHandlers::~SAXPrintHandlers()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x212): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x219): multiple definition of `non-virtual thunk to SAX
PrintHandlers::~SAXPrintHandlers()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x219): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x220): multiple definition of `non-virtual thunk to SAX
PrintHandlers::~SAXPrintHandlers()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x220): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x227): multiple definition of `non-virtual thunk to SAX
PrintHandlers::~SAXPrintHandlers()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x227): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x22e): multiple definition of `SAXPrintHandlers::writeC
hars(unsigned char const*)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x22e): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x234): multiple definition of `SAXPrintHandlers::writeC
hars(unsigned char const*, unsigned long, xercesc_3_1::XMLFormatter*)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x234): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x262): multiple definition of `non-virtual thunk to SAX
PrintHandlers::writeChars(unsigned char const*, unsigned long, xercesc_3_1::XMLFormatter*)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x262): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x26a): multiple definition of `SAXPrintHandlers::error(
xercesc_3_1::SAXParseException const&)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x26a): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x39a): multiple definition of `non-virtual thunk to SAX
PrintHandlers::error(xercesc_3_1::SAXParseException const&)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x39a): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x3a4): multiple definition of `SAXPrintHandlers::fatalE
rror(xercesc_3_1::SAXParseException const&)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x3a4): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x4d4): multiple definition of `non-virtual thunk to SAX
PrintHandlers::fatalError(xercesc_3_1::SAXParseException const&)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x4d4): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x4de): multiple definition of `SAXPrintHandlers::warnin
g(xercesc_3_1::SAXParseException const&)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x4de): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x60e): multiple definition of `non-virtual thunk to SAX
PrintHandlers::warning(xercesc_3_1::SAXParseException const&)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x60e): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x618): multiple definition of `SAXPrintHandlers::unpars
edEntityDecl(unsigned short const*, unsigned short const*, unsigned short const*, unsigned short const*)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x618): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x61d): multiple definition of `non-virtual thunk to SAX
PrintHandlers::unparsedEntityDecl(unsigned short const*, unsigned short const*, unsigned short const*, unsigned short const*)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x61d): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x624): multiple definition of `SAXPrintHandlers::notati
onDecl(unsigned short const*, unsigned short const*, unsigned short const*)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x624): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x629): multiple definition of `non-virtual thunk to SAX
PrintHandlers::notationDecl(unsigned short const*, unsigned short const*, unsigned short const*)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x629): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x630): multiple definition of `SAXPrintHandlers::charac
ters(unsigned short const*, unsigned long)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x630): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x666): multiple definition of `non-virtual thunk to SAX
PrintHandlers::characters(unsigned short const*, unsigned long)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x666): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x66e): multiple definition of `SAXPrintHandlers::endDoc
ument()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x66e): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x673): multiple definition of `non-virtual thunk to SAX
PrintHandlers::endDocument()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x673): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x67a): multiple definition of `SAXPrintHandlers::endEle
ment(unsigned short const*)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x67a): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x6cd): multiple definition of `non-virtual thunk to SAX
PrintHandlers::endElement(unsigned short const*)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x6cd): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x6d4): multiple definition of `SAXPrintHandlers::ignora
bleWhitespace(unsigned short const*, unsigned long)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x6d4): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x70a): multiple definition of `non-virtual thunk to SAX
PrintHandlers::ignorableWhitespace(unsigned short const*, unsigned long)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x70a): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x712): multiple definition of `SAXPrintHandlers::proces
singInstruction(unsigned short const*, unsigned short const*)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x712): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x7aa): multiple definition of `non-virtual thunk to SAX
PrintHandlers::processingInstruction(unsigned short const*, unsigned short const*)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x7aa): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x7b4): multiple definition of `SAXPrintHandlers::startD
ocument()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x7b4): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x7b9): multiple definition of `non-virtual thunk to SAX
PrintHandlers::startDocument()'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x7b9): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x7c0): multiple definition of `SAXPrintHandlers::startE
lement(unsigned short const*, xercesc_3_1::AttributeList&)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x7c0): first defined here
C:\Users\Mati\AppData\Local\Temp\cctzntQK.o:SAXPrintHandlers.cpp:(.text+0x925): multiple definition of `non-virtual thunk to SAX
PrintHandlers::startElement(unsigned short const*, xercesc_3_1::AttributeList&)'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x925): first defined here
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x44): undefined reference to `_imp___ZN11xercesc_3_16XMLUni22fg
XercescDefaultLocaleE'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x64): undefined reference to `_imp___ZN11xercesc_3_116XMLPlatfo
rmUtils10InitializeEPKcS2_PNS_12PanicHandlerEPNS_13MemoryManagerE'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x76): undefined reference to `_imp___ZN11xercesc_3_116XMLPlatfo
rmUtils9TerminateEv'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0xd8): undefined reference to `_imp___ZN11xercesc_3_116XMLPlatfo
rmUtils9TerminateEv'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x211): undefined reference to `_imp___ZN11xercesc_3_116XMLPlatf
ormUtils9TerminateEv'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x4b2): undefined reference to `_imp___ZN11xercesc_3_116XMLPlatf
ormUtils9TerminateEv'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x543): undefined reference to `_imp___ZN11xercesc_3_116XMLPlatf
ormUtils9TerminateEv'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x57a): undefined reference to `_imp___ZN11xercesc_3_17XMemorynw
Ej'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x583): undefined reference to `_imp___ZN11xercesc_3_116XMLPlatf
ormUtils15fgMemoryManagerE'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x5a3): undefined reference to `_imp___ZN11xercesc_3_19SAXParser
C1EPNS_12XMLValidatorEPNS_13MemoryManagerEPNS_14XMLGrammarPoolE'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x5c4): undefined reference to `_imp___ZN11xercesc_3_19SAXParser
19setValidationSchemeENS0_10ValSchemesE'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x5e1): undefined reference to `_imp___ZN11xercesc_3_19SAXParser
15setDoNamespacesEb'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x5fe): undefined reference to `_imp___ZN11xercesc_3_19SAXParser
11setDoSchemaEb'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x617): undefined reference to `_imp___ZN11xercesc_3_19SAXParser
24setHandleMultipleImportsEb'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x634): undefined reference to `_imp___ZN11xercesc_3_19SAXParser
31setValidationSchemaFullCheckingEb'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x6dc): undefined reference to `_imp___ZNK11xercesc_3_19SAXParse
r13getErrorCountEv'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x700): undefined reference to `_imp___ZN11xercesc_3_116XMLPlatf
ormUtils9TerminateEv'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x734): undefined reference to `_imp___ZN11xercesc_3_116XMLPlatf
ormUtils9TerminateEv'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text+0x819): undefined reference to `_imp___ZN11xercesc_3_17XMemorydl
EPv'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text$_ZN4StrXC1EPKt[StrX::StrX(unsigned short const*)]+0x7): undefine
d reference to `_imp___ZN11xercesc_3_116XMLPlatformUtils15fgMemoryManagerE'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text$_ZN4StrXC1EPKt[StrX::StrX(unsigned short const*)]+0x18): undefin
ed reference to `_imp___ZN11xercesc_3_19XMLString9transcodeEPKtPNS_13MemoryManagerE'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text$_ZN4StrXD1Ev[StrX::~StrX()]+0x7): undefined reference to `_imp__
_ZN11xercesc_3_116XMLPlatformUtils15fgMemoryManagerE'
C:\Users\Mati\AppData\Local\Temp\ccJzlNBi.o:SAXPrint.cpp:(.text$_ZN4StrXD1Ev[StrX::~StrX()]+0x18): undefined reference to `_imp_
__ZN11xercesc_3_19XMLString7releaseEPPcPNS_13MemoryManagerE'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x52): undefined reference to `_imp___ZN11xercesc_3_116X
MLPlatformUtils15fgMemoryManagerE'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x8e): undefined reference to `_imp___ZN11xercesc_3_112X
MLFormatterC1EPKcS2_PNS_15XMLFormatTargetENS0_11EscapeFlagsENS0_10UnRepFlagsEPNS_13MemoryManagerE'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0xb6): undefined reference to `_imp___ZN11xercesc_3_112X
MLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0xc4): undefined reference to `_imp___ZN11xercesc_3_112X
MLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0xd6): undefined reference to `_imp___ZN11xercesc_3_112X
MLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0xea): undefined reference to `_imp___ZN11xercesc_3_112X
MLFormatterD1Ev'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x160): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterD1Ev'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x192): undefined reference to `_imp___ZN11xercesc_3_17X
MemorydlEPv'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x20a): undefined reference to `_imp___ZN11xercesc_3_17X
MemorydlEPv'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x29a): undefined reference to `_imp___ZNK11xercesc_3_11
7SAXParseException15getColumnNumberEv'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x2a9): undefined reference to `_imp___ZNK11xercesc_3_11
7SAXParseException13getLineNumberEv'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x2b8): undefined reference to `_imp___ZNK11xercesc_3_11
7SAXParseException11getSystemIdEv'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x3d4): undefined reference to `_imp___ZNK11xercesc_3_11
7SAXParseException15getColumnNumberEv'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x3e3): undefined reference to `_imp___ZNK11xercesc_3_11
7SAXParseException13getLineNumberEv'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x3f2): undefined reference to `_imp___ZNK11xercesc_3_11
7SAXParseException11getSystemIdEv'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x50e): undefined reference to `_imp___ZNK11xercesc_3_11
7SAXParseException15getColumnNumberEv'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x51d): undefined reference to `_imp___ZNK11xercesc_3_11
7SAXParseException13getLineNumberEv'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x52c): undefined reference to `_imp___ZNK11xercesc_3_11
7SAXParseException11getSystemIdEv'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x65e): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatter9formatBufEPKtmNS0_11EscapeFlagsENS0_10UnRepFlagsE'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x6a2): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x6b3): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x6c5): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x702): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatter9formatBufEPKtmNS0_11EscapeFlagsENS0_10UnRepFlagsE'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x73a): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x74b): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x769): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x77a): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x7a2): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x7ea): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x7fb): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x87a): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x888): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x89a): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x8ac): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x8ca): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEPKt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x8ec): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text+0x918): undefined reference to `_imp___ZN11xercesc_3_112
XMLFormatterlsEt'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text$_ZN11xercesc_3_115DocumentHandlerC2Ev[xercesc_3_1::Docum
entHandler::DocumentHandler()]+0x4): undefined reference to `_imp___ZTVN11xercesc_3_115DocumentHandlerE'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text$_ZN11xercesc_3_115DocumentHandlerD2Ev[xercesc_3_1::Docum
entHandler::~DocumentHandler()]+0x7): undefined reference to `_imp___ZTVN11xercesc_3_115DocumentHandlerE'
C:\Users\Mati\AppData\Local\Temp\ccF7gVrk.o:SAXPrintHandlers.cpp:(.text$_ZN11xercesc_3_115DocumentHandlerD1Ev[xercesc_3_1::Docum
entHandler::~DocumentHandler()]+0x7): undefined reference to `_imp___ZTVN11xercesc_3_115DocumentHandlerE'
etc.
Is there any chance to solve it quick? Thanks anyway!
don't put the .hpp files in the compiler command line. they are included automatically by the .cpp files.
g++ SAXPrint.cpp SAXPrintHandlers.cpp -o output
I solved my problem, it was simplier than I had imagined. All you need to do is use flag:
-lxerces-c
It worked out great, but thanks for trying, guys! I appreciate it :)

Improper typecasting in Class constructor

I'm new to C++ and I have a problem with classes.
I got this prototype
class MMA7455 : public Accel
{
public:
MMA7455(uint8_t);
uint8_t accel_get_data(acceleration_t*);
private:
uint8_t accel_data_ready(void);
};
and I want to create an instance of it
MMA7455 accel = MMA7455(0x21);
but the following message appears
In function `global constructors keyed to accel':
sensors.cpp:(.text+0x8): undefined reference to `MMA7455::MMA7455(unsigned char)'
Why it's looking for 'unsigned char' argument? Same message even if I try to implicitly cast the type of constant
MMA7455 accel = MMA7455((uint8_t)0x21);
You probably didn't link your .cpp file containing the constructor definition. "uint8_t" is a typedef for 'unsigned char".
You need to define MMA7455::MMA7455(uint8_t) somewhere in your program, i.e. add a {}-body after the definition in the prototype (or perhaps you just forgot to compile and link the cpp-file containing the definitions for MMA7455.
It looks for unsigned char because uint8_t happens to be a typedef for unsigned char on your system.
uint8_t is a typedef for unsigned char on your platform. The error is a linker error since you haven't provided an implementation for your constructor and is unrelated to the argument being an unsigned char or not.

multiple definition

My code had an error about not defining the operator<. I corrected the operator< problem in my code by overloading it. When I compile it, there was no error there but it has lots of errors about multidefinition. My code is:
int Vector3D::operator < (const Vector 3D &vector) const
{
if(x<vector.x)
return 1;
else
return 0;
}
Here are some of the lines:
debug/src/common/propagation-delay-model_1.o: In function `empty':
/usr/include/c++/4.1.2/limits:1044: multiple definition of `ns3::Vector3D::operator<(ns3::Vector3D const&) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/common/propagation-loss-model_1.o: In function `empty':
/usr/include/c++/4.1.2/new:94: multiple definition of `ns3::Vector3D::operator<(ns3::Vector3D const&) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/common/jakes-propagation-loss-model_1.o: In function `empty':
/usr/include/c++/4.1.2/new:94: multiple definition of `ns3::Vector3D::operator<(ns3::Vector3D const&) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/common/cost231-propagation-loss-model_1.o: In function `empty':
/usr/include/c++/4.1.2/limits:1044: multiple definition of `ns3::Vector3D::operator<(ns3::Vector3D const&) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/common/spectrum-propagation-loss-model_1.o: In function `~BandInfo':
/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/debug/ns3/type-id.h:392: multiple definition of `ns3::Vector3D::operator<(ns3::Vector3D const&) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/common/friis-spectrum-propagation-loss_1.o: In function `~BandInfo':
/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/debug/ns3/vector.h:118: multiple definition of `ns3::Vector3D::operator<(ns3::Vector3D const&) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/node/spectrum-phy_1.o: In function `~TypeId':
/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/debug/ns3/type-id.h:392: multiple definition of `ns3::Vector3D::operator<(ns3::Vector3D const&) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/internet-stack/ipv6-l3-protocol_1.o: In function `new_allocator':
/usr/include/c++/4.1.2/new:94: multiple definition of `ns3::Vector3D::operator<(ns3::Vector3D const&) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/routing/olsr/olsr-routing-protocol_1.o: In function `~Association':
/usr/include/c++/4.1.2/new:94: multiple definition of `ns3::Vector3D::operator<(ns3::Vector3D const&) const'
debug/src/core/vector_1.o:/home/bahar/Desktop/ns/ns-allinone-3.9/ns-allinone-3.9/ns-3.9/build/../src/core/vector.h:118: first defined here
debug/src/routing/olsr/test/bug780-test_1.o: In function `new_allocator':
/usr/include/c++/4.1.2/new:94: multiple definition of `ns3::Vector3D::operator<(ns3::Vector3D const&) const'
It looks like you are defining a function in a header file, so it gets defined in every source file that includes it. Either declare it inline (which allows multiple definitions), or move the implementation into a source file (so it's only defined once). EDIT: Or move the definition inside the class definition, which also makes it inline. (Thanks David.)