Difference between revisions of "Duby/Capstone"
m  | 
				 (→Compiling with Mingw)  | 
				||
| Line 1: | Line 1: | ||
Capstone Engine is an open source library for disassembly.  | Capstone Engine is an open source library for disassembly.  | ||
| + | |||
| + | ==Compiling with Mingw==  | ||
| + | The default compilation doesn't work and fails with a linking error:  | ||
| + |  ./arch/Sparc/SparcInstPrinter.o:SparcInstPrinter.c:(.text+0x4e0): multiple definition of `imaxabs'  | ||
| + |  ./arch/PowerPC/PPCInstPrinter.o:PPCInstPrinter.c:(.text+0x16030): first defined here  | ||
| + |  collect2.exe: error: ld returned 1 exit status  | ||
| + |  make: *** [libcapstone.so] Error 1  | ||
| + | (for whatever reason "imaxabs" is included in resulting files as a stand-alone function, rather than inline function)  | ||
| + | |||
| + | The following command line should be used to compile the library on MinGW (with gcc installed)  | ||
| + |  CFLAGS="-llibmingwex" ./make.sh gcc  | ||
| + | Adding libmingwex library for compilation prevents imaxabs to be inserted into .o file (because the function is implemented in mingwex)  | ||
==See Also==  | ==See Also==  | ||
Revision as of 09:25, 31 October 2017
Capstone Engine is an open source library for disassembly.
Compiling with Mingw
The default compilation doesn't work and fails with a linking error:
./arch/Sparc/SparcInstPrinter.o:SparcInstPrinter.c:(.text+0x4e0): multiple definition of `imaxabs' ./arch/PowerPC/PPCInstPrinter.o:PPCInstPrinter.c:(.text+0x16030): first defined here collect2.exe: error: ld returned 1 exit status make: *** [libcapstone.so] Error 1
(for whatever reason "imaxabs" is included in resulting files as a stand-alone function, rather than inline function)
The following command line should be used to compile the library on MinGW (with gcc installed)
CFLAGS="-llibmingwex" ./make.sh gcc
Adding libmingwex library for compilation prevents imaxabs to be inserted into .o file (because the function is implemented in mingwex)
See Also
- duby
 - http://www.capstone-engine.org/ - official Capstone Engine site
 - https://github.com/stievie/TCapstone - Pascal bindings for Capstone Engine library