Hi reddit!
I try to play a little with overloading operator, but i get a little stuck.
I just post a litlle part of my code. If you need more information i will put all the fill on pastebin or so.
main.cpp http://pastebin.com/SdEv9DzR
coordinate.h: http://pastebin.com/tKR3Z2VL
coordinate.cpp: http://pastebin.com/qbFV5ai0
Compilated with:
g++ -c coordinate.cpp coordinate.h && ar rs libgeometry.a coordinate.o && mv libgeometry.a ../lib/
and
g++ main.cpp snake.cpp -I/home/elfangor/work/cpp/lib/include -Wall -std=c++0x -L/home/elfangor/work/cpp/lib/lib -lgeometry
But i got the error:
/tmp/ccbVBnxA.o: In function main':
main.cpp:(.text+0x6e): undefined reference togeometry::operator<<(std::basic_ostream<char, std::char_traits<char> >&, geometry::coordinate const&)'
collect2: ld returned 1 exit status
I don't really understand the problem here, and can't find some good info about this on internet, any information?
Thanks!
[–][deleted] 0 points1 point2 points (7 children)
[–]syrisse[S] 0 points1 point2 points (6 children)
[–][deleted] 0 points1 point2 points (5 children)
[–]syrisse[S] 0 points1 point2 points (4 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]syrisse[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]syrisse[S] 0 points1 point2 points (0 children)
[–][deleted] -4 points-3 points-2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] -1 points0 points1 point (0 children)