编译一个快速修复程序

2023-12-29

我正在尝试使用 QuickFix 库通过 FIX 协议连接到代理。我刚刚使用他们提供的文档构建了库,并立即使用他们的示例代码

#include "quickfix/FileStore.h"
#include "quickfix/FileLog.h"
#include "quickfix/SocketAcceptor.h"
#include "quickfix/Session.h"
#include "quickfix/SessionSettings.h"
#include "quickfix/Application.h"

int main( int argc, char** argv )
{
  try
  {
    if(argc < 2) return 1;
    std::string fileName = argv[1];

    FIX::SessionSettings settings(fileName);

    MyApplication application;
    FIX::FileStoreFactory storeFactory(settings);
    FIX::FileLogFactory logFactory(settings);
    FIX::SocketAcceptor acceptor
      (application, storeFactory, settings, logFactory /*optional*/);
    acceptor.start();
    // while( condition == true ) { do something; }
    acceptor.stop();
    return 0;
  }
  catch(FIX::ConfigError& e)
  {
    std::cout << e.what();
    return 1;
  }
}

但是,当我尝试使用以下命令编译它时:

g++ fix.cpp -fexceptions -finline-functions -lquickfix -lpthread -lxml2

我收到一堆错误:

In file included from /usr/local/include/quickfix/Session.h:34:0,
                 from fix.cpp:6:
/usr/local/include/quickfix/DataDictionaryProvider.h:54:72: error: ‘ptr::shared_ptr’ has not been declared
   void addTransportDataDictionary(const BeginString& beginString, ptr::shared_ptr<DataDictionary>);
                                                                        ^
/usr/local/include/quickfix/DataDictionaryProvider.h:54:82: error: expected ‘,’ or ‘...’ before ‘<’ token
   void addTransportDataDictionary(const BeginString& beginString, ptr::shared_ptr<DataDictionary>);
                                                                                  ^
/usr/local/include/quickfix/DataDictionaryProvider.h:55:70: error: ‘ptr::shared_ptr’ has not been declared
   void addApplicationDataDictionary(const ApplVerID& applVerID, ptr::shared_ptr<DataDictionary>);
                                                                      ^
/usr/local/include/quickfix/DataDictionaryProvider.h:55:80: error: expected ‘,’ or ‘...’ before ‘<’ token
   void addApplicationDataDictionary(const ApplVerID& applVerID, ptr::shared_ptr<DataDictionary>);
                                                                                ^
/usr/local/include/quickfix/DataDictionaryProvider.h:63:25: error: ‘shared_ptr’ is not a member of ‘ptr’
   std::map<std::string, ptr::shared_ptr<DataDictionary> > m_transportDictionaries;
                         ^
/usr/local/include/quickfix/DataDictionaryProvider.h:63:25: error: ‘shared_ptr’ is not a member of ‘ptr’
/usr/local/include/quickfix/DataDictionaryProvider.h:63:55: error: template argument 2 is invalid
   std::map<std::string, ptr::shared_ptr<DataDictionary> > m_transportDictionaries;
                                                       ^
/usr/local/include/quickfix/DataDictionaryProvider.h:63:55: error: template argument 4 is invalid
/usr/local/include/quickfix/DataDictionaryProvider.h:63:57: error: expected unqualified-id before ‘>’ token
   std::map<std::string, ptr::shared_ptr<DataDictionary> > m_transportDictionaries;
                                                         ^
/usr/local/include/quickfix/DataDictionaryProvider.h:64:25: error: ‘shared_ptr’ is not a member of ‘ptr’
   std::map<std::string, ptr::shared_ptr<DataDictionary> > m_applicationDictionaries;
                         ^
/usr/local/include/quickfix/DataDictionaryProvider.h:64:25: error: ‘shared_ptr’ is not a member of ‘ptr’
/usr/local/include/quickfix/DataDictionaryProvider.h:64:55: error: template argument 2 is invalid
   std::map<std::string, ptr::shared_ptr<DataDictionary> > m_applicationDictionaries;
                                                       ^
/usr/local/include/quickfix/DataDictionaryProvider.h:64:55: error: template argument 4 is invalid
/usr/local/include/quickfix/DataDictionaryProvider.h:64:57: error: expected unqualified-id before ‘>’ token
   std::map<std::string, ptr::shared_ptr<DataDictionary> > m_applicationDictionaries;
                                                         ^
/usr/local/include/quickfix/DataDictionaryProvider.h: In member function ‘void FIX::DataDictionaryProvider::addTransportDataDictionary(const FIX::BeginString&, const string&)’:
/usr/local/include/quickfix/DataDictionaryProvider.h:58:45: error: ‘shared_ptr’ is not a member of ‘ptr’
   { addTransportDataDictionary(beginString, ptr::shared_ptr<DataDictionary>( new DataDictionary(path) )); }
                                             ^
/usr/local/include/quickfix/DataDictionaryProvider.h:58:75: error: expected primary-expression before ‘>’ token
   { addTransportDataDictionary(beginString, ptr::shared_ptr<DataDictionary>( new DataDictionary(path) )); }
                                                                           ^
/usr/local/include/quickfix/DataDictionaryProvider.h: In member function ‘void FIX::DataDictionaryProvider::addApplicationDataDictionary(const FIX::ApplVerID&, const string&)’:
/usr/local/include/quickfix/DataDictionaryProvider.h:60:45: error: ‘shared_ptr’ is not a member of ‘ptr’
   { addApplicationDataDictionary(applVerID, ptr::shared_ptr<DataDictionary>( new DataDictionary(path) )); }
                                             ^
/usr/local/include/quickfix/DataDictionaryProvider.h:60:75: error: expected primary-expression before ‘>’ token
   { addApplicationDataDictionary(applVerID, ptr::shared_ptr<DataDictionary>( new DataDictionary(path) )); }
                                                                           ^
fix.cpp: In function ‘int main(int, char**)’:
fix.cpp:19:5: error: ‘MyApplication’ was not declared in this scope
     MyApplication application;
     ^
fix.cpp:19:19: error: expected ‘;’ before ‘application’
     MyApplication application;
                   ^
fix.cpp:23:8: error: ‘application’ was not declared in this scope
       (application, storeFactory, settings, logFactory /*optional*/);
        ^
root@luis:/home/luis/tradingbot/bot4#     In file included from /usr/local/include/quickfix/Session.h:34:0,
In: command not found
root@luis:/home/luis/tradingbot/bot4#                      from fix.cpp:6:
from: can't read /var/mail/fix.cpp:6:
root@luis:/home/luis/tradingbot/bot4#     /usr/local/include/quickfix/DataDictionaryProvider.h:54:72: error: ‘ptr::shared_ptr’ has not been declared
bash: /usr/local/include/quickfix/DataDictionaryProvider.h:54:72:: No such file or directory
root@luis:/home/luis/tradingbot/bot4#        void addTransportDataDictionary(const BeginString& beginString, ptr::shared_ptr<DataDictionary>);
bash: syntax error near unexpected token `('
root@luis:/home/luis/tradingbot/bot4#                                                                             ^
^: command not found
root@luis:/home/luis/tradingbot/bot4#     /usr/local/include/quickfix/DataDictionaryProvider.h:54:82: error: expected ‘,’ or ‘...’ before ‘<’ token
bash: ’: No such file or directory
root@luis:/home/luis/tradingbot/bot4#        void addTransportDataDictionary(const BeginString& beginString, ptr::shared_ptr<DataDictionary>);
bash: syntax error near unexpected token `('
root@luis:/home/luis/tradingbot/bot4#                                                                                       ^
^: command not found
root@luis:/home/luis/tradingbot/bot4#     /usr/local/include/quickfix/DataDictionaryProvider.h:55:70: error: ‘ptr::shared_ptr’ has not been declared
bash: /usr/local/include/quickfix/DataDictionaryProvider.h:55:70:: No such file or directory

我究竟做错了什么?


您需要提供一个实现MyApplication类并使用适当的 C++11 标志进行编译。

Your MyApplication对象通常需要派生自FIX::Application类是一个纯虚拟类,需要您实现一系列方法,例如onLogon(...) and toApp(...)

如果您只想让代码编译作为第一步,您可以尝试使用FIX::NullApplication类(在quickfix/Application.h 中定义)作为您的启动应用程序对象。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

编译一个快速修复程序 的相关文章

  • 谁能建议我一种在 C++ 中分割名称的简单方法

    我一直在尝试将名称分为名字和姓氏 但我确信我的实现就简单性而言并不是最好的 string name John Smith string first string last name name find getting lastname fo
  • 如何在 DataColumn.Expression 中使用 IF/ELSE 或 CASE?

    我有一个包含 1 列的表 状态 我想添加另一列名为 Action 的列 其值如下 如果 Status Yes 则 Action Go 否则 Action Stop 我使用以下代码添加到 操作 列中 但它不起作用 myDataTable Co
  • 何时使用 =default 使析构函数默认?

    尽管对构造函数使用 default 对我来说很清楚 即强制编译器在其他构造函数存在时创建默认构造函数 但我仍然无法理解这两种类型的析构函数之间的区别 那些使用 default 的 那些没有显式定义并由编译器自动生成的 我唯一想到的是 gro
  • 更改 Qt OpenGL 窗口示例以使用 OpenGL 3.3

    我正在尝试更改 Qt OpenGL 示例以使用更现代的 opengl 版本 330 似乎合适 所以我做了 在 main cpp 上设置版本和配置文件 设置着色器版本 更改着色器以使用统一 它现在构建没有任何错误 但我只看到一个空白窗口 我错
  • ASP.NET Web API 客户端 ProgressMessageHandler Post 任务卡在 WinForm 应用程序中

    我在用着HttpClient and ProgressMessageHandler来自MS ASP NET Web API 客户端库 http nuget org packages Microsoft AspNet WebApi Clien
  • 防止 boost::asio::io_context 在空轮询调用时停止

    此代码调用发布的句柄 boost asio io context ioc boost asio post ioc std cout lt lt lol lt lt std endl ioc poll 而这并没有 boost asio io
  • 与 Qt 项目的静态链接

    我有一个在 Visual Studio 2010 Professional 中构建的 Qt 项目 但是 当我运行它 在调试或发布模式下 时 它会要求一些 Qt dll 如果我提供 dll 并将它们放入 System32 中 它就可以工作 但
  • 如何在 SqlDataReader.Read() 期间从死锁异常中恢复

    我的 NET 应用程序的事件日志显示 它在从 Sql Server 读取数据时偶尔会出现死锁 这种情况通常非常罕见 因为我们已经优化了查询以避免死锁 但有时仍然会发生 过去 我们在调用ExecuteReader函数在我们的SqlComman
  • 找不到 assimp-vc140-mt.dll ASSIMP

    我已经从以下位置下载了 Assimp 项目http assimp sourceforge net main downloads html http assimp sourceforge net main downloads html Ass
  • ASP.Net Core 内容配置附件/内联

    我正在从 WebAPI 控制器返回一个文件 Content Disposition 标头值自动设置为 附件 例如 处置 附件 文件名 30956 pdf 文件名 UTF 8 30956 pdf 当它设置为附件时 浏览器将要求保存文件而不是打
  • 时间:2019-03-17 标签:c#ThreadSafeDeepCopy

    我一直在阅读很多其他问题以及大量谷歌搜索 但我一直无法找到明确的解决方案 根据我读过的一些最佳实践 类的静态方法应该创建线程安全的 并且实例成员应该将线程安全留给消费者 我想为该类实现深度复制方法 该类本身还有其他引用类型成员 有没有什么方
  • vs2008 c#:Facebook.rest.api如何使用它来获取好友列表?

    如何在此基础上取得进一步的进步 获取好友列表的下一步是什么 string APIKey ConfigurationManager AppSettings API Key string APISecret ConfigurationManag
  • 如何在 QTabWidget Qt 中展开选项卡

    我有一个QTabWidget像这个 但我想展开选项卡以 填充 整个小部件宽度 如下所示 我怎样才能做到这一点 我在用Qt 5 3 2 and Qt 创建者 3 2 1 Update 我尝试使用setExpanding功能 ui gt myT
  • 在 JSQMessagesViewController 中显示 LocationMediaItem

    我刚刚尝试实施LocationMediaItem in my Xamarin iOS应用程序使用JSQMessagesViewController 一切都很顺利 唯一的问题是UICollectionView应该显示位置的单元格永远停留在加载
  • std::forward_as_tuple 将参数传递给 2 个构造函数

    我想传递多个参数以便在函数内构造两个对象 以同样的方式std pair
  • 将二进制数据从 C# 上传到 PHP

    我想将文件从 Windows C 应用程序上传到运行 PHP 的 Web 服务器 我知道 WebClient UploadFile 方法 但我希望能够分块上传文件 以便我可以监控进度并能够暂停 恢复 因此 我正在读取文件的一部分并使用 We
  • 无法在内存位置找到异常源:cudaError_enum

    我正在尝试确定 Microsoft C 异常的来源 test fft exe 中 0x770ab9bc 处的第一次机会异常 Microsoft C 异常 内存位置 0x016cf234 处的 cudaError enum 我的构建环境是 I
  • 如何分析组合的 python 和 c 代码

    我有一个由多个 python 脚本组成的应用程序 其中一些脚本正在调用 C 代码 该应用程序现在的运行速度比以前慢得多 因此我想对其进行分析以查看问题所在 是否有工具 软件包或只是一种分析此类应用程序的方法 有一个工具可以将 python
  • 每个数据库多个/单个 *.edmx 文件

    我有一个通过 ADO net 数据服务与数据库交互的项目 数据库很大 近 150 个具有依赖关系的表 该项目几年前开始 当时使用的是数据集 现在我们正在转向实体模型关系 由于我们添加了更多需要使用的表 该模型正在不断增长 这是管理这一切的正
  • 使我的 COM 程序集调用异步

    我刚刚 赢得 了在当前工作中维护用 C 编码的遗留库的特权 这个dll 公开使用 Uniface 构建的大型遗留系统的方法 除了调用 COM 对象之外别无选择 充当此遗留系统与另一个系统的 API 之间的链接 在某些情况下 使用 WinFo

随机推荐

  • ngserve 命令首先显示错误,最后编译成功

    我使用最新的 Angular 版本在我的计算机上本地设置了 Angular 项目 每当我使用 CLI 命令作为 ng 服务运行该项目时 它都会首先以红色显示错误 这是一个用于测试或调试 Angular 应用程序的简单服务器 本地 尚未经过安
  • 将图像添加到导航项的标题

    我想在导航栏标题的左侧添加一个徽标 title 属性似乎只接受 NSString 将图像添加到导航栏的最佳方法是什么 您可以将标题视图替换为如下图像 navigationItem titleView UIImageView alloc in
  • conda-forge 存储库是否需要 Anaconda 商业版许可证?

    我认为在 Anaconda 最近的许可证变更之后我需要获得 Anaconda 的商业许可证 不过我很好奇 访问 conda forge 存储库是否需要商业许可证 因为它是社区存储库 或者这仅适用于主要的 anaconda 存储库 我一直无法
  • PHP Readfile 方法的安全问题

    嘿 使用时有什么安全问题需要担心吗readfilePHP 中的方法 我想使用 readfile 方法来获取存储在各种第三方服务器上的文件的 URL 然后我将文件提供给用户 直观上 似乎存在风险 因为 URL 可以指向任何文件 另一方面 我只
  • 从 List.map() 获取迭代索引

    我在字母列表上编写了一个迭代 并使用 地图 类将内部卡片放在屏幕上 在代码中 您可以看到我做了一行 并使用 map 将卡片上的所有用户板打印到屏幕上 我想在里面添加一些逻辑 所以我需要获取元素的 id 用于录制事件 有什么办法可以做到这一点
  • 为什么 android:buttonStyle 不设置按钮样式?

    所以 我有一个奇怪的问题 我的应用程序非常简单 主要活动只有一个按钮 并且清单中设置的活动的自定义主题 我可以确认主题有效并被选中 因为我可以更改活动背景或字体颜色 例如 但是当我尝试为我的活动中的所有按钮设置样式时 它不起作用 这是样式
  • 在 Bukkit 中设置原理图的块数据?

    我正在尝试加载并粘贴 schematicbukkit 中的文件 不挂钩 MCEdit API 下面是我用来粘贴原理图的函数 方法 粘贴时 我不断收到NullPointerException在粘贴过程中 当我记录放置的物品时 我看到草块 石头
  • 从控制台禁用/更改 Spring Boot 的 ApplicationContext 的时间戳

    每次我们启动 Spring Boot 应用程序时 Spring Boot 都会打印以下行 2017 07 20 00 43 53 605 INFO 3857 main ationConfigEmbeddedWebApplicationCon
  • 目前是否有适用于 iOS4 和 Xcode4 的 BDD 解决方案?

    所以我一直在努力寻找 iOS4 和 Xcode4 的可靠 BDD 替代品 但一切似乎要么很久以前就被放弃了 要么sortof工作但相当混乱 我找到的最好的解决方案称为 Cedar 主要文章 http pivotallabs com user
  • FileSystemWatcher - 目标目录所需的最低权限?

    使用 NET FileSystemWatcherhttp msdn microsoft com en us library system io filesystemwatcher aspx http msdn microsoft com e
  • 使用 Google 登录时的服务条款和隐私政策链接不起作用

    我已经实现了 firebase 身份验证 UI 包括电子邮件和 Google 作为提供商 我还提供了服务条款和隐私政策链接 如下所示 List
  • Jaxrs 多部分

    我正在尝试向 jaxrs 服务执行请求 该服务的媒体类型设置为multipart form data 该请求包含实体列表 xml 和图像 png 二进制 我已按照中所述创建了请求this https stackoverflow com qu
  • 从派生类对象调用基类方法

    如何从派生类对象调用被派生类重写的基类方法 class Base public void foo cout lt lt base class Derived public Base public void foo cout lt lt de
  • 使用不同的值作为列创建 MySQL 视图

    我搜索了一段时间 找不到我的问题的答案 我有一个看起来像这样的表 date name status 2011 01 01 m1 online 2011 01 01 m2 offline 2011 01 01 m3 online 2011 0
  • 为什么是替换而不是替换!对于红宝石中的字符串?

    replace更改当前字符串而不是返回新实例 为了与 Ruby 中的其他方法保持一致 似乎应该调用replace 这是一个错误 不一致还是我错过了什么 来自 matz 的帖子https www ruby forum com topic 17
  • 如何在gradle中的测试任务中指定@category?

    我想了解是否可以在 gradle 测试任务中指定 category 所以 我可以单独运行集成 junit 和正常的 junit 测试 http weblogs java net blog johnsmart archive 2010 04
  • 使用 async 函数作为 EventEmitter 监听器有什么问题吗?

    我正在编写一个 Node js v10 应用程序 我想使用await在事件监听器函数中 所以我做了一个async监听器功能 根据下面的代码 它似乎有效 但我很好奇注册时是否有隐藏的缺点或我应该注意的事情async功能作为EvenEmitte
  • 尽管提供了接受属性,Antd 上传程序仍然接受所有文件

    我正在使用 antd 拖放组件https ant design components upload components upload demo drag https ant design components upload compone
  • Flexbox 顺序和选项卡导航

    我想用显示 柔性改变order的 div 与line类 但我想保持这个 TAB 导航顺序 A B C D 正如您在代码片段中看到的 第一个示例工作正常 DOM 序列与 Order 相同 但在第二个示例中 选项卡遵循 DOM 序列 不使用 j
  • 编译一个快速修复程序

    我正在尝试使用 QuickFix 库通过 FIX 协议连接到代理 我刚刚使用他们提供的文档构建了库 并立即使用他们的示例代码 include quickfix FileStore h include quickfix FileLog h i