tags:

views:

88

answers:

2

I know that all forums are full of such question, but I've tried few hooks, and they doesn't work (or I do them bad).

So, I've got:

main.cpp <- fawn.h <- connector.cpp (defenition) <- conncetor.h (declaration)

                   <- portl.cpp (def)     <- portl.h (dcl)        <- connector.h

with include guard (thanks to Igor Zevaka and jk), everything compiles, but doesn't link, saying "already defined in main.obj" about all funcs., no metter are they static or not.

I've tryed already pulling the conncetor.h contents to connector.cpp, same way with portl.cpp (there was #include "connector.h" in it).

Thanks beforehand.

+1  A: 

Does fawn.h include connector.cpp? (or do I read it wrong?)

If so this is your error. Now connector.cpp (itself) has a function bla() and main.cpp has same function because it includes (read: copy-pasted in) connector.cpp. And you are trying to link them together.

EDIT: For the last error make sure FAWN::Sys::Connecter::getSocket(void) is implemented somewhere (and that cpp file it is in is linked in). Looks like it is just missing.

Eugene
Ah... Experience of working with interpretable languages makes itself felt :) ... Now it nearly works... Error 1 error LNK2019: unresolved external reference to the symbol "public: class boost:: asio:: basic_stream_socket <class boost:: asio:: ip:: tcp, class boost:: asio:: stream_socket_service <class boost:: asio:: ip:: tcp>> * __thiscall FAWN:: Sys:: Connecter:: getSocket (void) "(? ..... XZ) in function "private: void __thiscall FAWN:: Sys:: PortListner:: WaitForPromt (void)" (? WaitForPromt @ PortListner @ Sys @ FAWN @ @ AAEXXZ) portlistner.obj
MInner
A: 

Make sure that you link properly against the required libraries of boost...

Check the dependencies here: http://www.boost.org/doc/libs/1%5F41%5F0/doc/html/boost%5Fasio/using.html

smerlin