0

I have a VS2013 project with a class in a separate file where I want to use the BeaEngine to disassemble a binary. I added all the necessary files (BeaEngine.h and BeaEngine.lib) to the project and set the linker to include the .lib. When I call the Disasm function from inside the main() function my project compiles just fine, but when I try to call it from inside one of the member functions of my class, I get the following error:

error LNK2019: Verweis auf nicht aufgelöstes externes Symbol 
"__imp__Disasm" in Funktion 
""private: void __thiscall BinaryBlob::callScan(unsigned int,unsigned int)"
(?callScan@BinaryBlob@@AAEXII@Z)"

So to me it looks like the linker cannot find the implementation for the Disasm function. If I comment the following line out it will compile without an error.

len = Disasm( &(this->disasm) );

My includes are like follows:

#include "stdafx.h"
#include "BinaryBlob.h"
#define BEA_ENGINE_STATIC  /* specify the usage of a static version of BeaEngine */
#define BEA_USE_STDCALL    /* specify the usage of a stdcall version of BeaEngine */
#include "BeaEngine.h"

Do I need to do something else besides including the BeaEngine.h?

Any help would be really appreciated!

aeveris
  • 39
  • 5

1 Answers1

2

What this says is that the compiler can see the .h file (it recognizes the .h file name) but is not linked to the library itself. I'm using VC10 but you should need to do something like

Property Pages, General, then add the directory of the lib under Additional Library Directories

then

Input, Additional Dependencies, put the name of the library mylib.lib

If it's a .dll either just put it with the .exe of your program or add the path of the .dll to your system PATH

Basically it's like a lawn mower: If it's getting air, gas and a spark it will run.

Air = .h file
Gas = linked to .lib or .dll (or other things on Linux)
Spark = Your program calling the lib
Patrick K
  • 341
  • 2
  • 5