Re: [Quickfix-developers] Need help with QuickFIX 4.4 C++
Brought to you by:
orenmnero
From: K. F. <kfr...@gm...> - 2014-05-05 14:36:45
|
Hello fixuser2! It looks like your linker isn't finding your FIX library, perhaps either because you're not specifying the FIX library in your build command, or the library isn't where it ought to be. But we would need more detail not to be just guessing. Further comments in line, below: On Mon, May 5, 2014 at 3:43 AM, fixuser2 <ama...@yo...> wrote: > > All, > > I'm trying to learn QuickFIX and wrote a small program below. I want to use > QuickFIX to generate FIX messages. When I tried to compile it, I'm getting > errors messages that I couldn't figure out. Your help will be greatly > appreciated. Thank in advance. First, it would be helpful is you could provide more detail about what you are doing. Where did you get QuickFIX, and how and where did you install it? What platform are you running on? (I see a "/tmp" so I might guess some version of linux.) What toolchain (compiler suite) are you using? (It looks like gcc, but what version from where?) What build command did you use to compile / link your test program? > #include <iostream> > #include "quickfix/Message.h" > #include "quickfix/fix44/NewOrderSingle.h" > > using std::cout; > using std::endl; > > int main( int argc, char *argv[] ) > { > time_t currentTime; > > time( ¤tTime ); > > FIX44::NewOrderSingle *newOrder = new FIX44::NewOrderSingle( > FIX::ClOrdID( "1234" ), FIX::Side( FIX::Side_BUY ), > FIX::TransactTime( > FIX::UtcTimeStamp( currentTime ) ), FIX::OrdType( FIX::OrdType_MARKET ) ); > > } Assuming that your build command first compiles and then links your test program, it appears that your compile is successfully finding the QuickFIX header files. So it appears that you have QuickFIX at least partly installed, with its header files in a known location in your include path, or properly pointed to in your compile command. > /tmp/ccSks0a9.o: In function `FIX::DateTime::fromUtcTimeT(long, int)': > tstquickfix.cpp:(.text._ZN3FIX8DateTime12fromUtcTimeTEli[FIX::DateTime::fromUtcTimeT(long, > int)]+0x22): undefined reference to `FIX::time_gmtime(long const*)' This says that at link time your object file /tmp/ccSks0a9.o (so something got compiled successfully from source) has a reference to a QuickFIX function that the linker can't find. This suggests that either you haven't installed a compiled version of QuickFIX on your system (you do appear to have the headers), or you do have it installed, but your toolchain and /or build command doesn't know where it is. > /tmp/ccSks0a9.o: In function > `FIX::message_order::message_order(FIX::message_order const&)': > tstquickfix.cpp:(.text._ZN3FIX13message_orderC2ERKS0_[_ZN3FIX13message_orderC5ERKS0_]+0x36): > undefined reference to `FIX::message_order::operator=(FIX::message_order > const&)' Again, the rest of the errors you posted are link-time missing symbol errors. > ... Just guessing -- again we would need more detail to be able to help you further -- but one possibility is that you only installed the source distribution for QuickFIX. (That would explain why you have the headers but not the compiled library.) If this were the case you would need either to build your own copy of the library from the source you have, or to find and download a pre-built binary version of QuickFIX (that is compatible with your platform and toolchain). Good luck K. Frank |