2012-12-06 4 views
1

에서 작동하도록 stasm를 얻기 위해 시도 :의 모든 복용내가 아래는 A Cmake 파일이 우분투

How to create a static library with g++?, 첫 번째 대답 : 나는 수행하여 libstasm.a를 생성

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) 

.o 파일을 linux 폴더에서 가져 와서 아카이브에 저장하십시오. 난 내 프로젝트에 메이크업을 실행할 때

하지만 내가 얻을 :

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 

는 사람이 전에 리눅스에 stasm 작업 할 cmake 프로젝트를 얻었다? 나는 또한 stasm_dll.cpp에서 n include "windows.h"를 제거해야했고, Linux에서 작업 할 수 있도록 제대로 수행되지 않은 다른 Windows 특정 코드를 제거해야했습니다.

이미 바이너리를 생성하는 리눅스 폴더를 입수했습니다 그들은 지금 난 그냥 내 자신의 프로젝트에이 기능을 통합하는 큰 필요가 작동

..

이유는 Stasm을 만들기 위해 만들어진 것이 었 것으로 보인다

답변

0

이미지 처리를 수행 한 Windows의 실행 파일 Stasm은 라이브러리처럼 작동하지 않습니다. 현재 임의의 프로젝트로 가져 와서 매개 변수를 지정하는 데 사용할 수있는 라이브러리처럼 작동 할 자체 정적 및 공유 라이브러리를 만들고 있습니다.

기본적으로 main.cpp를 다른 클래스로 수정하고 테스트/불필요한 코드를 추출하여 씬 처리 버전을 얻습니다.