试图在Ubuntu上工作

编程入门 行业动态 更新时间:2024-10-25 18:32:06
本文介绍了试图在Ubuntu上工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在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上工作

本文发布于:2023-10-28 00:47:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535011.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:工作   Ubuntu

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!