1

I have the below in a Cmake file:

add_library(stasm STATIC IMPORTED)
set_property(TARGET stasm PROPERTY
            IMPORTED_LOCATION /media/Data/sdks/stasm3.1/linux/libstasm.a)
target_link_libraries( StasmOpencvExample ${OpenCV_LIBS} stasm)

I generated the libstasm.a by doing:

How to create a static library with g++? , the first answer, taking all of the .o files from the linux folder and putting it into an archive.

but when i run make on my project i get:

Scanning dependencies of target StasmOpencvExample
[100%] Building CXX object CMakeFiles/StasmOpencvExample.dir/stasm_opencv_example.cpp.o
Linking CXX executable StasmOpencvExample
CMakeFiles/StasmOpencvExample.dir/stasm_opencv_example.cpp.o: In function `main':
stasm_opencv_example.cpp:(.text+0x9a): undefined reference to `AsmSearchDll(int*, int*,      char const*, char const*, int, int, int, char const*, char const*)'
collect2: ld returned 1 exit status

has anyone gotten a cmake project to work with stasm on linux before? I also had to remove a n include "windows.h" from stasm_dll.cpp, and other windows specific code that wasn't properly done to allow working on linux.

I have already gotten the linux folder to generate the binaries and they work great, now I just need to incorporate this functionality into my own project..

Community
  • 1
  • 1
L7ColWinters
  • 1,342
  • 1
  • 14
  • 31

1 Answers1

0

It seems that the reason was that Stasm was created to make executables on Windows that did Image processing. Stasm DOES NOT act like a library, I'm currently making my own static and shared library that will act like a library that you can use to import into a random project and specify the parameters.

Basically modifiying main.cpp to another class and taking out the testing/unecessary code and get a thin processing version.

L7ColWinters
  • 1,342
  • 1
  • 14
  • 31