Need help with QuickFIX 4.4 C++

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Need help with QuickFIX 4.4 C++

fixuser2
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.

#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 ) );

}


/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*)'
/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&)'
/tmp/ccSks0a9.o: In function `FIX::FieldMap::FieldMap(FIX::message_order const&)':
tstquickfix.cpp:(.text._ZN3FIX8FieldMapC2ERKNS_13message_orderE[_ZN3FIX8FieldMapC5ERKNS_13message_orderE]+0x18): undefined reference to `vtable for FIX::FieldMap'
/tmp/ccSks0a9.o: In function `FIX::Message::Message(FIX::BeginString const&, FIX::MsgType const&)':
tstquickfix.cpp:(.text._ZN3FIX7MessageC2ERKNS_11BeginStringERKNS_7MsgTypeE[_ZN3FIX7MessageC5ERKNS_11BeginStringERKNS_7MsgTypeE]+0x15f): undefined reference to `FIX::FieldMap::~FieldMap()'
tstquickfix.cpp:(.text._ZN3FIX7MessageC2ERKNS_11BeginStringERKNS_7MsgTypeE[_ZN3FIX7MessageC5ERKNS_11BeginStringERKNS_7MsgTypeE]+0x16f): undefined reference to `FIX::FieldMap::~FieldMap()'
tstquickfix.cpp:(.text._ZN3FIX7MessageC2ERKNS_11BeginStringERKNS_7MsgTypeE[_ZN3FIX7MessageC5ERKNS_11BeginStringERKNS_7MsgTypeE]+0x17b): undefined reference to `FIX::FieldMap::~FieldMap()'
/tmp/ccSks0a9.o: In function `FIX::Message::~Message()':
tstquickfix.cpp:(.text._ZN3FIX7MessageD2Ev[_ZN3FIX7MessageD5Ev]+0x26): undefined reference to `FIX::FieldMap::~FieldMap()'
tstquickfix.cpp:(.text._ZN3FIX7MessageD2Ev[_ZN3FIX7MessageD5Ev]+0x36): undefined reference to `FIX::FieldMap::~FieldMap()'
tstquickfix.cpp:(.text._ZN3FIX7MessageD2Ev[_ZN3FIX7MessageD5Ev]+0x42): undefined reference to `FIX::FieldMap::~FieldMap()'
tstquickfix.cpp:(.text._ZN3FIX7MessageD2Ev[_ZN3FIX7MessageD5Ev]+0x6f): undefined reference to `FIX::FieldMap::~FieldMap()'
tstquickfix.cpp:(.text._ZN3FIX7MessageD2Ev[_ZN3FIX7MessageD5Ev]+0x80): undefined reference to `FIX::FieldMap::~FieldMap()'
/tmp/ccSks0a9.o:(.rodata._ZTIN3FIX7MessageE[typeinfo for FIX::Message]+0x10): undefined reference to `typeinfo for FIX::FieldMap'
collect2: ld returned 1 exit status


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Need help with QuickFIX 4.4 C++

K. Frank
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX Support: http://www.quickfixengine.org/services.html

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 <[hidden email]> 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( &currentTime );
>
>         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

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
Loading...