我在Cmake文件中有以下内容:
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)我通过执行以下操作来生成libstasm.a:
I generated the libstasm.a by doing:
如何使用g ++创建静态库?,第一个答案,将所有的.o文件从。
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.
但是当我在我的项目上运行 make 时,我会得到:
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有没有人有一个cmake项目使用stasm在linux之前?我还必须从stasm_dll.cpp中删除一个包含windows.h和其他Windows特定的代码,没有正确完成允许在linux上工作。
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已经得到了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..
推荐答案似乎原因是Stasm是为了在Windows上执行图像处理而创建可执行文件。 Stasm不像一个库,我目前正在制作我自己的静态和共享库,将像一个库,您可以使用导入到随机项目和指定的参数。
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.
基本上将main.cpp修改为另一个类,并取出测试/不必要的代码并获得精简的处理版本。
Basically modifiying main.cpp to another class and taking out the testing/unecessary code and get a thin processing version.
更多推荐
试图在Ubuntu上工作
发布评论