简体   繁体   English

如果我将静态库目标链接到OMNeT ++模拟器不会更新

[英]OMNeT++ Simulator doesn't update if I target static library to link

I'm new to OMNeT++, and I'm trying to link Crypto++5.6.5 to OMNeT++5.1.1. 我是OMNeT ++的新手,我正在尝试将Crypto ++ 5.6.5链接到OMNeT ++ 5.1.1。 The only way that OMNeT++ seems to allow me to link the Crypto++ library is using the static version of the Crypto++ library like I describe below: OMNeT ++似乎允许我链接Crypto ++库的唯一方法是使用Crypto ++库的静态​​版本,如下所述:

  • Right clicking on Project->Properties->OMNeT++->Makemake->Option, from "Target" I choose "Static Library(.lib or .a)" 右键单击Project-> Properties-> OMNeT ++-> Makemake-> Option,从“ Target”中选择“ Static Library(.lib或.a)”
  • From "Compile" I choose the directory where cryptlib.lib is located (C:\\cryptopp565\\Win32\\DLL_Output\\Debug) 从“编译”中,选择cryptlib.lib所在的目录(C:\\ cryptopp565 \\ Win32 \\ DLL_Output \\ Debug)
  • From "Link" I choose the additional library "cryptlib". 从“链接”中,选择附加库“ cryptlib”。 (The actual library file is "cryptlib.lib") (实际的库文件是“ cryptlib.lib”)

All my encryption errors go away (so it seems like my crypto library is linked) and I can run the simulator, but the problem is when I run the simulation, the simulation hasn't updated from when I previously ran the simulator. 我所有的加密错误都消失了(因此好像我的密码库已链接在一起),我可以运行模拟器,但是问题是当我运行模拟时,模拟没有从我先前运行模拟器时更新。 I know I'm seeing the simulator run my previous (old) version of my project, from before I included a static library, because my old debug output plays even though I change the debug output using "EV<<...". 我知道我看到模拟器在包含静态库之前就运行了我项目的先前(旧)版本,因为即使我使用“ EV << ...”更改了调试输出,我的旧调试输出也会播放。

I don't think putting encryption into a simulator is a great idea, BUT this static-library-executing-old-simulator problem seems to happen regardless of what library I connect. 我认为将加密放入模拟器不是一个好主意,但是无论我连接的是哪个库,这个静态库执行老模拟器问题似乎都会发生。 So long as I select "Static Library(.lib or .a)" from the Target makemake page, even if I don't include a static library, the simulator doesn't update. 只要我从Target makemake页面中选择“ Static Library(.lib或.a)”,即使我不包括静态库,模拟器也不会更新。 When I go back to "Target Type"->"Executable" and build/run the simulator (and get rid of my link & compile to cryptlib), the most up-to-date project gets simulated, but my crypto library isn't linked. 当我回到“目标类型”->“可执行文件”并构建/运行模拟器(并摆脱我的链接并编译为cryptlib)时,将对最新项目进行模拟,但我的密码库为“链接。

Can anyone help me fix my settings so the OMNeT++ simulator runs my most recently built project when I target a static library? 任何人都可以帮助我修复设置,以便在针对静态库的情况下OMNeT ++仿真器运行我最近构建的项目吗?

Here's a picture of how I target static library 这是我如何定位静态库的图片

Here are h files included in my .cc file 这是我的.cc文件中包含的h文件

There is some confusion here. 这里有些混乱。 Based on the images you've attached, you switched your project to create a static library. 根据您附加的图像,您切换了项目以创建静态库。 A static library is NOT executable so I'm not sure what you are actually running. 静态库不可执行,因此我不确定您实际在运行什么。 At the end of the build process you will get your Anotherthy.a file, but that's just a library that you can link to an other executable sometimes in the future. 在构建过程结束时,您将获得Anotherthy.a文件,但这只是一个库,您可以在将来有时链接到另一个可执行文件。

Because of this (ie no executable is generated) you are probably running the last executable you have created (before switching to static lib). 因此(即未生成任何可执行文件),您可能正在运行所创建的最后一个可执行文件(在切换到静态库之前)。 Long story short: 长话短说:

You must build an executable or at least a shared library to be able to run it... Static library won't do. 您必须构建一个可执行文件或至少一个共享库才能运行它...静态库不会。

As for the original problem, if I see it right, you are trying to link a 32bit library of crypto++? 至于原始问题,如果我看对的话,您正在尝试链接32位crypto ++库? Because OMNeT++ 5.1 is 64-bit only. 因为OMNeT ++ 5.1仅是64位。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM