0

Here it goes:

  1. I downloaded the QuickFix source, built it using CMake and got the .sln file.

  2. Then I opened the .sln file in VC++ 2010 and built the project named "quickfix_vs10" (actually i built a library named quickFix.lib) and got some warnings but the build was successful.

  3. I then used this .lib file in another project using #pragma comment(lib, "quickFix.lib")

  4. Whenever I declare an instance of class FIX::TransactTime in my project, I get numerous link time errors. All of them have to do with an unresolved token in utility.obj. These errors don't come if I use any other class.

One of those errors is:

quickFix.lib(Utility.obj) : error LNK2028: unresolved token (0A000426) "extern "C" int __stdcall getpeername(unsigned int,struct sockaddr *,int *)" (?getpeername@@$$J212YGHIPAUsockaddr@@PAH@Z) referenced in function "char const * __cdecl FIX::socket_peername(int)" (?socket_peername@FIX@@$$FYAPBDH@Z)

simchona
  • 1,878
  • 3
  • 19
  • 18
Rampal Chaudhary
  • 707
  • 1
  • 8
  • 18

1 Answers1

1

The error message indicates that you need to link "Ws2_32.lib"

see getpeername reference

billz
  • 44,644
  • 9
  • 83
  • 100
  • Not a very explanatory answer but it told me about "Ws2_32.lib" which solved my problem. I just introduced the line #pragma comment(lib, "Ws2_32.lib") and it solved my problem. I got the idea of doing so through link: http://forums.codeguru.com/showthread.php?445581-RESOLVED-cannot-find-ws2_32.lib-for-socket-programming – Rampal Chaudhary Jan 11 '13 at 06:38