Link to home
Start Free TrialLog in
Avatar of GTsafas
GTsafas

asked on

QuickFIX engine c++

I am new to c++ but I am trying to build something in it, I know this is a long shot but there is no good support I can find for QuickFIX engine

The error im recieving is as follows

In file included from rosnfix.cpp:5:
ROSNAPP.h:7: error: expected primary-expression before public
ROSNAPP.h:7: error: ISO C++ forbids declaration of type name with no type
ROSNAPP.h:7: error: expected ; before public
rosnfix.cpp: In function int main(int, char**):
rosnfix.cpp:24: error: no matching function for call to FIX::SocketInitiator::SocketInitiator(Application&, FIX::FileStoreFactory&, FIX::SessionSettings&, FIX::ScreenLogFactory&)
/opt/quickfix/include/quickfix/SocketInitiator.h:41: note: candidates are: FIX::SocketInitiator::SocketInitiator(FIX::Application&, FIX::MessageStoreFactory&, const FIX::SessionSettings&, FIX::LogFactory&)
/opt/quickfix/include/quickfix/SocketInitiator.h:39: note:                 FIX::SocketInitiator::SocketInitiator(FIX::Application&, FIX::MessageStoreFactory&, const FIX::SessionSettings&)
/opt/quickfix/include/quickfix/SocketInitiator.h:37: note:                 FIX::SocketInitiator::SocketInitiator(const FIX::SocketInitiator&)

I will attach code,
rosnfix.cpp

#include "/opt/quickfix/include/quickfix/FileStore.h"
#include "/opt/quickfix/include/quickfix/FileLog.h"
#include "/opt/quickfix/include/quickfix/SocketInitiator.h"
#include "/opt/quickfix/include/quickfix/SessionSettings.h"
#include "ROSNAPP.h"
#include <string>
#include <iostream>
#include <fstream>

int main( int argc, char** argv )
{

  try
  {

    if ( argc < 2 ) return 1;
    std::string file = argv[0];

    FIX::SessionSettings settings( file );

    Application application;
    FIX::FileStoreFactory storeFactory(settings);
    FIX::ScreenLogFactory logFactory(settings);
    FIX::SocketInitiator initiator(application, storeFactory, settings, logFactory);

    initiator.start();
    while ( true )
    {
	std::cout << "CONNECTED" << std::endl;    
    }
    initiator.stop();
    return 0;
  }
  catch ( std::exception & e )
  {
    std::cout << e.what() << std::endl;
    return 1;
  }
}


ROSNAPP.cpp

#include "ROSNAPP.h"
#include "/opt/quickfix/include/quickfix/Session.h"
#include "/opt/quickfix/include/quickfix/MessageCracker.h"


    void fromApp( const FIX::Message& message, const FIX::SessionID& sessionID )
      throw( FIX::FieldNotFound&, FIX::IncorrectDataFormat&, FIX::IncorrectTagValue&, FIX::UnsupportedMessageType& )
    {
      crack(message, sessionID);
    }

    void onMessage( const FIX42::NewOrderSingle& message, const FIX::SessionID& )
    {
      FIX::ClOrdID clOrdID;
      message.get(clOrdID);

      FIX::ClearingAccount clearingAccount;
      message.get(clearingAccount);
    }

    void onMessage( const FIX41::NewOrderSingle& message, const FIX::SessionID& )
    {
      FIX::ClOrdID clOrdID;
      message.get(clOrdID);

      // compile time error!! field not defined in FIX41
      FIX::ClearingAccount clearingAccount;
      message.get(clearingAccount);
    }

    void onMessage( const FIX42::OrderCancelRequest& message, const FIX::SessionID& )
    {
      FIX::ClOrdID clOrdID;
      message.get(clOrdID);

      // compile time error!! field not defined for OrderCancelRequest
      FIX::Price price;
      message.get(price);
    }

ROSNAPP.h

#include "/opt/quickfix/include/quickfix/Application.h"
#include "/opt/quickfix/include/quickfix/MessageCracker.h"


class Application
{
       : public FIX::Application,
         public FIX::MessageCracker

    void fromApp( const FIX::Message& message, const FIX::SessionID& sessionID ) throw( FIX::FieldNotFound&, FIX::IncorrectDataFormat&, FIX::IncorrectTagValue&, FIX::UnsupportedMessageType& );
 
    void onMessage( const FIX42::NewOrderSingle& message, const FIX::SessionID& );
    void onMessage( const FIX41::NewOrderSingle& message, const FIX::SessionID& );
    void onMessage( const FIX42::OrderCancelRequest& message, const FIX::SessionID& );
    
};

SocketInitiator.h

/* -*- C++ -*- */

/****************************************************************************
** Copyright (c) quickfixengine.org  All rights reserved.
**
** This file is part of the QuickFIX FIX Engine
**
** This file may be distributed under the terms of the quickfixengine.org
** license as defined by quickfixengine.org and appearing in the file
** LICENSE included in the packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.quickfixengine.org/LICENSE for licensing information.
**
** Contact ask@quickfixengine.org if any conditions of this licensing are
** not clear to you.
**
****************************************************************************/

#ifndef FIX_SOCKETINITIATOR_H
#define FIX_SOCKETINITIATOR_H

#ifdef _MSC_VER
#pragma warning( disable : 4503 4355 4786 4290 )
#endif

#include "Initiator.h"
#include "SocketConnector.h"
#include "SocketConnection.h"

namespace FIX
{
/// Socket implementation of Initiator.
class SocketInitiator : public Initiator, SocketConnector::Strategy
{
public:
  SocketInitiator( Application&, MessageStoreFactory&,
                   const SessionSettings& ) throw( ConfigError );
  SocketInitiator( Application&, MessageStoreFactory&,
                   const SessionSettings&, LogFactory& ) throw( ConfigError );

  virtual ~SocketInitiator();

private:
  typedef std::map < int, SocketConnection* > SocketConnections;
  typedef std::map < SessionID, int > SessionToHostNum;

  void onConfigure( const SessionSettings& ) throw ( ConfigError );
  void onInitialize( const SessionSettings& ) throw ( RuntimeError );

  void onStart();
  bool onPoll();
  void onStop();

  bool doConnect( const SessionID&, const Dictionary& d );
  void onConnect( SocketConnector&, int );
  void onWrite( SocketConnector&, int );
  bool onData( SocketConnector&, int );
  void onDisconnect( SocketConnector&, int );
  void onError( SocketConnector& );
  void onTimeout( SocketConnector& );

  void getHost( const SessionID&, const Dictionary&, std::string&, short& );

  SessionSettings m_settings;
  SessionToHostNum m_sessionToHostNum;
  SocketConnector m_connector;
  SocketConnections m_pendingConnections;
  SocketConnections m_connections;
  time_t m_lastConnect;
  int m_reconnectInterval;
  bool m_noDelay;
  bool m_stop;
};
/*! @} */
}

#endif //FIX_SOCKETINITIATOR_H

Open in new window

Avatar of js-profi
js-profi

in rosnapp.h the { after class Application must be moved 2 lines deeper after the :public ... lines.
Avatar of GTsafas

ASKER

new error,

In file included from rosnfix.cpp:5:
ROSNAPP.h:10: error: looser throw specifier for virtual void Application::fromApp(const FIX::Message&, const FIX::SessionID&)
/opt/quickfix/include/quickfix/Application.h:62: error:   overriding virtual void FIX::Application::fromApp(const FIX::Message&, const FIX::SessionID&) throw (FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType)
rosnfix.cpp: In function int main(int, char**):
rosnfix.cpp:21: error: cannot declare variable application to be of abstract type Application
ROSNAPP.h:9: note:   because the following virtual functions are pure within Application:
/opt/quickfix/include/quickfix/Application.h:48: note:  virtual void FIX::Application::onCreate(const FIX::SessionID&)
/opt/quickfix/include/quickfix/Application.h:50: note:  virtual void FIX::Application::onLogon(const FIX::SessionID&)
/opt/quickfix/include/quickfix/Application.h:52: note:  virtual void FIX::Application::onLogout(const FIX::SessionID&)
/opt/quickfix/include/quickfix/Application.h:54: note:  virtual void FIX::Application::toAdmin(FIX::Message&, const FIX::SessionID&)
/opt/quickfix/include/quickfix/Application.h:56: note:  virtual void FIX::Application::toApp(FIX::Message&, const FIX::SessionID&)
/opt/quickfix/include/quickfix/Application.h:59: note:  virtual void FIX::Application::fromAdmin(const FIX::Message&, const FIX::SessionID&)


Attached is Application.h


/* -*- C++ -*- */

/****************************************************************************
** Copyright (c) quickfixengine.org  All rights reserved.
**
** This file is part of the QuickFIX FIX Engine
**
** This file may be distributed under the terms of the quickfixengine.org
** license as defined by quickfixengine.org and appearing in the file
** LICENSE included in the packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.quickfixengine.org/LICENSE for licensing information.
**
** Contact ask@quickfixengine.org if any conditions of this licensing are
** not clear to you.
**
****************************************************************************/

#ifndef FIX_APPLICATION_H
#define FIX_APPLICATION_H

#include "Message.h"
#include "SessionID.h"
#include "Mutex.h"

namespace FIX
{
/**
 * This interface must be implemented to define what your %FIX application
 * does.
 *
 * These methods notify your application about events that happen on
 * active %FIX sessions. There is no guarantee how many threads will be calling
 * these functions. If the application is sharing resources among multiple sessions,
 * you must synchronize those resources. You can also use the SynchronizedApplication
 * class to automatically synchronize all function calls into your application.
 * The various MessageCracker classes can be used to parse the generic message
 * structure into specific %FIX messages.
 */
class Application
{
public:
  virtual ~Application() {};
  /// Notification of a session begin created
  virtual void onCreate( const SessionID& ) = 0;
  /// Notification of a session successfully logging on
  virtual void onLogon( const SessionID& ) = 0;
  /// Notification of a session logging off or disconnecting
  virtual void onLogout( const SessionID& ) = 0;
  /// Notification of admin message being sent to target
  virtual void toAdmin( Message&, const SessionID& ) = 0;
  /// Notification of app message being sent to target
  virtual void toApp( Message&, const SessionID& )
  throw( DoNotSend ) = 0;
  /// Notification of admin message being received from target
  virtual void fromAdmin( const Message&, const SessionID& )
  throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon ) = 0;
  /// Notification of app message being received from target
  virtual void fromApp( const Message&, const SessionID& )
  throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) = 0;
};

/**
* This is a special implementation of the Application interface that takes
* in another Application interface and synchronizes all of its callbacks. This
* will guarantee that only one thread will access the applications code at a time.
*
* This class is a great convenience for writing applications where you
* don't want to worry about synchronization. There is of course a tradeoff
* in that you may be synchronizing more than you need to. There is also a very
* minor performance penalty due to the extra virtual table lookup.
*/
class SynchronizedApplication : public Application
{
public:
  SynchronizedApplication( Application& app ) : m_app( app ) {}

  void onCreate( const SessionID& sessionID )
  { Locker l( m_mutex ); app().onCreate( sessionID ); }
  void onLogon( const SessionID& sessionID )
  { Locker l( m_mutex ); app().onLogon( sessionID ); }
  void onLogout( const SessionID& sessionID )
  { Locker l( m_mutex ); app().onLogout( sessionID ); }
  void toAdmin( Message& message, const SessionID& sessionID )
  { Locker l( m_mutex ); app().toAdmin( message, sessionID ); }
  void toApp( Message& message, const SessionID& sessionID )
  throw( DoNotSend )
  { Locker l( m_mutex ); app().toApp( message, sessionID ); }
  void fromAdmin( const Message& message, const SessionID& sessionID )
  throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon )
  { Locker l( m_mutex ); app().fromAdmin( message, sessionID ); }
  void fromApp( const Message& message, const SessionID& sessionID )
  throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType )
  { Locker l( m_mutex ); app().fromApp( message, sessionID ); }

  Mutex m_mutex;

  Application& app() { return m_app; }
  Application& m_app;
};

/**
* An empty implementation of an Application. This can be used if you
* do not want to provide an implementation for all the callback methods.
* It is also useful for unit tests writing unit tests where the callback
* values of some or all methods are not of interest.
*/
class NullApplication : public Application
{
  void onCreate( const SessionID& ) {}
  void onLogon( const SessionID& ) {}
  void onLogout( const SessionID& ) {}
  void toAdmin( Message&, const SessionID& ) {}
  void toApp( Message&, const SessionID& )
  throw( DoNotSend ) {}
  void fromAdmin( const Message&, const SessionID& )
  throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, RejectLogon ) {}
  void fromApp( const Message&, const SessionID& )
  throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) {}
};
/*! @} */
}

#endif //FIX_APPLICATION_H

Open in new window

Avatar of Infinity08
>> ROSNAPP.h:10: error: looser throw specifier for virtual void Application::fromApp(const FIX::Message&, const FIX::SessionID&)
>> /opt/quickfix/include/quickfix/Application.h:62: error:   overriding virtual void FIX::Application::fromApp(const FIX::Message&, const FIX::SessionID&) throw (FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType)
>> rosnfix.cpp: In function int main(int, char**):

You need to match the prototype of the Application::fromApp method to that of FIX::Application::fromApp method. Right now they're unmatched, ie. :

>>     void fromApp( const FIX::Message& message, const FIX::SessionID& sessionID ) throw( FIX::FieldNotFound&, FIX::IncorrectDataFormat&, FIX::IncorrectTagValue&, FIX::UnsupportedMessageType& );

vs. :

>>   virtual void fromApp( const Message&, const SessionID& )
>>   throw( FieldNotFound, IncorrectDataFormat, IncorrectTagValue, UnsupportedMessageType ) = 0;

Notice that the throw specifications don't match (because the use of references in the one and not in the other) ?

Note that the error message said just that ... Read error messages in detail, and they'll point you to the solutioN :)


>> rosnfix.cpp:21: error: cannot declare variable application to be of abstract type Application
>> ROSNAPP.h:9: note:   because the following virtual functions are pure within Application:
>> <SNIP>

Your Application class needs to implement ALL of the pure virtual methods of its abstract base classes FIX::Application and FIX::MessageCracker. Otherwise your Application class is itself an abstract class which cannot be instantiated. And that's what the error message tells you (the methods that you still need to implement are listed after the error message).
Avatar of GTsafas

ASKER

Thank you I figured that out earlier after posting, new error though and hopefully the last

When I compile with g++ -c rosnfix.cpp ROSNAPP.cpp

I get the following,
ROSNAPP.cpp: In function void fromApp(const FIX::Message&, const FIX::SessionID&):
ROSNAPP.cpp:8: error: crack was not declared in this scope
ROSNAPP.cpp: In function void onMessage(const FIX42::NewOrderSingle&, const FIX::SessionID&):
ROSNAPP.cpp:14: error: invalid use of incomplete type const struct FIX42::NewOrderSingle
/opt/quickfix/include/quickfix/fix42/MessageCracker.h:58: error: forward declaration of const struct FIX42::NewOrderSingle
ROSNAPP.cpp:17: error: invalid use of incomplete type const struct FIX42::NewOrderSingle
/opt/quickfix/include/quickfix/fix42/MessageCracker.h:58: error: forward declaration of const struct FIX42::NewOrderSingle
ROSNAPP.cpp: In function void onMessage(const FIX41::NewOrderSingle&, const FIX::SessionID&):
ROSNAPP.cpp:23: error: invalid use of incomplete type const struct FIX41::NewOrderSingle
/opt/quickfix/include/quickfix/fix41/MessageCracker.h:44: error: forward declaration of const struct FIX41::NewOrderSingle
ROSNAPP.cpp:27: error: invalid use of incomplete type const struct FIX41::NewOrderSingle
/opt/quickfix/include/quickfix/fix41/MessageCracker.h:44: error: forward declaration of const struct FIX41::NewOrderSingle
ROSNAPP.cpp: In function void onMessage(const FIX42::OrderCancelRequest&, const FIX::SessionID&):
ROSNAPP.cpp:33: error: invalid use of incomplete type const struct FIX42::OrderCancelRequest
/opt/quickfix/include/quickfix/fix42/MessageCracker.h:62: error: forward declaration of const struct FIX42::OrderCancelRequest
ROSNAPP.cpp:37: error: invalid use of incomplete type const struct FIX42::OrderCancelRequest
/opt/quickfix/include/quickfix/fix42/MessageCracker.h:62: error: forward declaration of const struct FIX42::OrderCancelRequest

Open in new window

>> ROSNAPP.cpp:8: error: crack was not declared in this scope

Where is crack defined ?


>> ROSNAPP.cpp:14: error: invalid use of incomplete type const struct FIX42::NewOrderSingle

Where is that type defined ?
Avatar of GTsafas

ASKER

crack is in MessageCracker.h


and isnt FIX42::NewOrderSingle in ROSNAPP.cpp ?

attached is messagecracker.h
/* -*- C++ -*- */

/****************************************************************************
** Copyright (c) quickfixengine.org  All rights reserved.
**
** This file is part of the QuickFIX FIX Engine
**
** This file may be distributed under the terms of the quickfixengine.org
** license as defined by quickfixengine.org and appearing in the file
** LICENSE included in the packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.quickfixengine.org/LICENSE for licensing information.
**
** Contact ask@quickfixengine.org if any conditions of this licensing are
** not clear to you.
**
****************************************************************************/

#ifndef FIX_MESSAGECRACKER_H
#define FIX_MESSAGECRACKER_H

#include "fix40/MessageCracker.h"
#include "fix41/MessageCracker.h"
#include "fix42/MessageCracker.h"
#include "fix43/MessageCracker.h"
#include "fix44/MessageCracker.h"
#include "Values.h"

namespace FIX
{
/** Takes in a generic Message and produces an object that represents
 *  its specific version and message type.
 */
class MessageCracker
      : public FIX40::MessageCracker,
      public FIX41::MessageCracker,
      public FIX42::MessageCracker,
      public FIX43::MessageCracker,
      public FIX44::MessageCracker
{
public:
  void crack( const Message& message,
              const SessionID& sessionID )
  {
    const FIX::BeginString& beginString = 
      FIELD_GET_REF( message.getHeader(), BeginString );

    if ( beginString == BeginString_FIX40 )
    {
      ( ( FIX40::MessageCracker& ) ( *this ) )
      .crack( ( const FIX40::Message& ) message, sessionID );
    }
    else if ( beginString == BeginString_FIX41 )
    {
      ( ( FIX41::MessageCracker& ) ( *this ) )
      .crack( ( const FIX41::Message& ) message, sessionID );
    }
    else if ( beginString == BeginString_FIX42 )
    {
      ( ( FIX42::MessageCracker& ) ( *this ) )
      .crack( ( const FIX42::Message& ) message, sessionID );
    }
    else if ( beginString == BeginString_FIX43 )
    {
      ( ( FIX43::MessageCracker& ) ( *this ) )
      .crack( ( const FIX43::Message& ) message, sessionID );
    }
    else if ( beginString == BeginString_FIX44 )
    {
      ( ( FIX44::MessageCracker& ) ( *this ) )
      .crack( ( const FIX44::Message& ) message, sessionID );
    }
  }

  void crack( Message& message,
              const SessionID& sessionID )
  {
    const FIX::BeginString& beginString = 
      FIELD_GET_REF( message.getHeader(), BeginString );

    if ( beginString == BeginString_FIX40 )
    {
      ( ( FIX40::MessageCracker& ) ( *this ) )
      .crack( ( FIX40::Message& ) message, sessionID );
    }
    else if ( beginString == BeginString_FIX41 )
    {
      ( ( FIX41::MessageCracker& ) ( *this ) )
      .crack( ( FIX41::Message& ) message, sessionID );
    }
    else if ( beginString == BeginString_FIX42 )
    {
      ( ( FIX42::MessageCracker& ) ( *this ) )
      .crack( ( FIX42::Message& ) message, sessionID );
    }
    else if ( beginString == BeginString_FIX43 )
    {
      ( ( FIX43::MessageCracker& ) ( *this ) )
      .crack( ( FIX43::Message& ) message, sessionID );
    }
    else if ( beginString == BeginString_FIX44 )
    {
      ( ( FIX44::MessageCracker& ) ( *this ) )
      .crack( ( FIX44::Message& ) message, sessionID );
    }
  }
};
}

#endif //FIX_MESSAGECRACKER_H

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Infinity08
Infinity08
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it looks as if you created rosnapp.h by extracting class Application from a .cpp. all the implementation of member functions of Application were indented so as they were within the class Application { }; before. you can do such extraction but all the former inline member functions now need a Application:: prefix.
Avatar of GTsafas

ASKER

I will look tomorrow ty
Avatar of GTsafas

ASKER

Here is my current code throwing this error
g++ -c myinit.cpp MYAPP.cpp throws this 


MYAPP.cpp: In function void fromApp(const FIX::Message&, const FIX::SessionID&): 
MYAPP.cpp:9: error: crack was not declared in this scope 
MYAPP.cpp: In function void onMessage(const FIX42::NewOrderSingle&, const FIX::SessionID&): 
MYAPP.cpp:15: error: invalid use of incomplete type const struct FIX42::NewOrderSingle 
/opt/quickfix/include/quickfix/fix42/MessageCracker.h:58: error: forward declaration of const struct FIX42::NewOrderSingle 
ROSNAPP.cpp:18: error: invalid use of incomplete type const struct FIX42::NewOrderSingle 
/opt/quickfix/include/quickfix/fix42/MessageCracker.h:58: error: forward declaration of const struct FIX42::NewOrderSingle 
MYAPP.cpp: In function void onMessage(const FIX41::NewOrderSingle&, const FIX::SessionID&): 
MYAPP.cpp:24: error: invalid use of incomplete type const struct FIX41::NewOrderSingle 
/opt/quickfix/include/quickfix/fix41/MessageCracker.h:44: error: forward declaration of const struct FIX41::NewOrderSingle 
MYAPP.cpp:28: error: invalid use of incomplete type const struct FIX41::NewOrderSingle 
/opt/quickfix/include/quickfix/fix41/MessageCracker.h:44: error: forward declaration of const struct FIX41::NewOrderSingle 
MYAPP.cpp: In function void onMessage(const FIX42::OrderCancelRequest&, const FIX::SessionID&): 
MYAPP.cpp:34: error: invalid use of incomplete type const struct FIX42::OrderCancelRequest 
/opt/quickfix/include/quickfix/fix42/MessageCracker.h:62: error: forward declaration of const struct FIX42::OrderCancelRequest 
MYAPP.cpp:38: error: invalid use of incomplete type const struct FIX42::OrderCancelRequest 
/opt/quickfix/include/quickfix/fix42/MessageCracker.h:62: error: forward declaration of const struct FIX42::OrderCancelRequest 



Here is MYAPP.cpp 


#include "/home/gt/SCRIPTS/GT-fix/MYAPP.h" 
#include "/opt/quickfix/include/quickfix/Session.h" 
#include "/opt/quickfix/include/quickfix/MessageCracker.h" 

   void fromApp( const FIX::Message& message, const FIX::SessionID& sessionID ) 
      throw( FIX::FieldNotFound&, FIX::IncorrectDataFormat&, FIX::IncorrectTagValue&, FIX::UnsupportedMessageType& ) 
    { 
      crack(message, sessionID); 
    } 

    void onMessage( const FIX42::NewOrderSingle& message, const FIX::SessionID& ) 
    { 
      FIX::ClOrdID clOrdID; 
      message.get(clOrdID); 

      FIX::ClearingAccount clearingAccount; 
      message.get(clearingAccount); 
    } 

    void onMessage( const FIX41::NewOrderSingle& message, const FIX::SessionID& ) 
    { 
      FIX::ClOrdID clOrdID; 
      message.get(clOrdID); 

      // compile time error!! field not defined in FIX41 
      FIX::ClearingAccount clearingAccount; 
      message.get(clearingAccount); 
    } 

    void onMessage( const FIX42::OrderCancelRequest& message, const FIX::SessionID& ) 
    { 
      FIX::ClOrdID clOrdID; 
      message.get(clOrdID); 

      // compile time error!! field not defined for OrderCancelRequest 
      FIX::Price price; 
      message.get(price); 
    } 


here is MYAPP.h 


#include "/opt/quickfix/include/quickfix/Application.h" 
#include "/opt/quickfix/include/quickfix/MessageCracker.h" 
#include <queue> 
#include <iostream> 



class MyApplication 

       : public FIX::Application, 
         public FIX::MessageCracker 
{ 
  
        
  void onCreate( const FIX::SessionID& ) {} 
  void onLogon( const FIX::SessionID& sessionID ); 
  void onLogout( const FIX::SessionID& sessionID ); 

  void toAdmin( FIX::Message&, const FIX::SessionID& ) {} 

  void toApp( FIX::Message&, const FIX::SessionID& )  throw( FIX::DoNotSend ) {} 
  
  void fromAdmin( const FIX::Message&, const FIX::SessionID& ) 
  throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::RejectLogon ) {} 
  
 void fromApp( const FIX::Message& message, const FIX::SessionID& sessionID ) 
  throw( FIX::FieldNotFound, FIX::IncorrectDataFormat, FIX::IncorrectTagValue, FIX::UnsupportedMessageType ); 
  

  void onMessage( const FIX42::NewOrderSingle& message, const FIX::SessionID& ); 
  void onMessage( const FIX41::NewOrderSingle& message, const FIX::SessionID& ); 
  void onMessage( const FIX42::OrderCancelRequest& message, const FIX::SessionID& ); 



    
};

Open in new window

You still haven't added the Application:: namespace qualifier for your method implementations. See my earlier post http:#26195692
Avatar of GTsafas

ASKER

Sorry for delay, I have found the solution on my own. This was part of it, thank you so much for your very hard work. Much appreciated as always