SVM-Struct에서 sqrt에 대한 정의되지 않은 참조(-lm 사용)

족시

사실 저는 Ubuntu 16.04 에서 잘 알려진 SVM-struct 프로젝트( http://www.cs.cornell.edu/people/tj/svm_light/svm_struct.html )로 작업하고 있습니다. http://www.cs.cornell.edu/people/tj/svm_light/svm_multiclass.html 의 지침에 따라 SVM-multiclass를 사용하고 소스 코드를 다운로드하고 make. 그러나 프로젝트를 빌드할 때 몇 가지 오류가 발생했습니다.

$ make
cd svm_light; make svm_learn_hideo_noexe
make[1]: Entering directory '/home/parallels/CLionProjects/svm_multiclass/svm_light'
make[1]: Nothing to be done for 'svm_learn_hideo_noexe'.
make[1]: Leaving directory '/home/parallels/CLionProjects/svm_multiclass/svm_light'
cd svm_struct; make svm_struct_noexe
make[1]: Entering directory '/home/parallels/CLionProjects/svm_multiclass/svm_struct'
make[1]: Nothing to be done for 'svm_struct_noexe'.
make[1]: Leaving directory '/home/parallels/CLionProjects/svm_multiclass/svm_struct'
gcc  -O3 -lm -Wall svm_struct/svm_struct_learn.o svm_struct_learn_custom.o svm_struct_api.o svm_light/svm_hideo.o svm_light/svm_learn.o svm_light/svm_common.o svm_struct/svm_struct_common.o svm_struct/svm_struct_main.o -o svm_multiclass_learn 
svm_light/svm_learn.o: In function `estimate_sphere':
svm_learn.c:(.text+0x6e88): undefined reference to `sqrt'
svm_light/svm_learn.o: In function `estimate_r_delta':
svm_learn.c:(.text+0x7053): undefined reference to `sqrt'
svm_light/svm_learn.o: In function `estimate_r_delta_average':
svm_learn.c:(.text+0x7b04): undefined reference to `sqrt'
svm_light/svm_learn.o: In function `length_of_longest_document_vector':
svm_learn.c:(.text+0x7b86): undefined reference to `sqrt'
svm_light/svm_learn.o: In function `incorporate_unlabeled_examples':
svm_learn.c:(.text+0x89eb): undefined reference to `sqrt'
svm_light/svm_learn.o:svm_learn.c:(.text+0xc952): more undefined references to `sqrt' follow
svm_light/svm_common.o: In function `classify_example':
svm_common.c:(.text+0x38f): undefined reference to `tanh'
svm_common.c:(.text+0x42d): undefined reference to `exp'
svm_common.c:(.text+0x4a7): undefined reference to `pow'
svm_light/svm_common.o: In function `kernel':
svm_common.c:(.text+0x870): undefined reference to `tanh'
svm_common.c:(.text+0x90d): undefined reference to `exp'
svm_common.c:(.text+0x988): undefined reference to `pow'
svm_light/svm_common.o: In function `model_length_s':
svm_common.c:(.text+0x2c8d): undefined reference to `sqrt'
svm_light/svm_common.o: In function `model_length_n':
svm_common.c:(.text+0x2f5c): undefined reference to `sqrt'
svm_light/svm_common.o: In function `cholesky_matrix':
svm_common.c:(.text+0x3c6f): undefined reference to `sqrt'
svm_light/svm_common.o: In function `find_indep_subset_of_matrix':
svm_common.c:(.text+0x3f41): undefined reference to `sqrt'
svm_light/svm_common.o: In function `single_kernel':
svm_common.c:(.text+0xc0c): undefined reference to `tanh'
svm_common.c:(.text+0xc84): undefined reference to `pow'
svm_common.c:(.text+0xcfb): undefined reference to `exp'
collect2: error: ld returned 1 exit status
Makefile:48: recipe for target 'svm_multiclass_learn' failed
make: *** [svm_multiclass_learn] Error 1

Makefile이 이미 포함되어 있다고 생각합니다 -lm.

# Makefile for SVM-multiclass, 03.07.04

#Use the following to compile under unix or cygwin
CC = gcc
LD = gcc

#Call 'make' using the following line to make CYGWIN produce stand-alone Windows executables
#       make 'SFLAGS=-mno-cygwin'

CFLAGS =   $(SFLAGS) -O3 -fomit-frame-pointer -ffast-math -Wall
LDFLAGS =  $(SFLAGS) -O3 -lm -Wall
#CFLAGS =  $(SFLAGS) -pg -Wall
#LDFLAGS = $(SFLAGS) -pg -lm -Wall 

all: svm_multiclass_learn svm_multiclass_classify

.PHONY: clean
clean: svm_light_clean svm_struct_clean
    rm -f *.o *.tcov *.d core gmon.out *.stackdump 

#-----------------------#
#----   SVM-light   ----#
#-----------------------#
svm_light_hideo_noexe: 
    cd svm_light; make svm_learn_hideo_noexe

svm_light_clean: 
    cd svm_light; make clean

#----------------------#
#----  STRUCT SVM  ----#
#----------------------#

svm_struct_noexe: 
    cd svm_struct; make svm_struct_noexe

svm_struct_clean: 
    cd svm_struct; make clean

#-------------------------#
#----  SVM MULTICLASS ----#
#-------------------------#

svm_multiclass_classify: svm_light_hideo_noexe svm_struct_noexe svm_struct_api.o svm_struct/svm_struct_classify.o svm_struct/svm_struct_common.o svm_struct/svm_struct_main.o 
    $(LD) $(LDFLAGS) svm_struct_api.o svm_struct/svm_struct_classify.o svm_light/svm_common.o svm_struct/svm_struct_common.o -o svm_multiclass_classify $(LIBS)

svm_multiclass_learn: svm_light_hideo_noexe svm_struct_noexe svm_struct_api.o svm_struct_learn_custom.o svm_struct/svm_struct_learn.o svm_struct/svm_struct_common.o svm_struct/svm_struct_main.o
    $(LD) $(LDFLAGS) svm_struct/svm_struct_learn.o svm_struct_learn_custom.o svm_struct_api.o svm_light/svm_hideo.o svm_light/svm_learn.o svm_light/svm_common.o svm_struct/svm_struct_common.o svm_struct/svm_struct_main.o -o svm_multiclass_learn $(LIBS)


svm_struct_api.o: svm_struct_api.c svm_struct_api.h svm_struct_api_types.h svm_struct/svm_struct_common.h
    $(CC) -c $(CFLAGS) svm_struct_api.c -o svm_struct_api.o

svm_struct_learn_custom.o: svm_struct_learn_custom.c svm_struct_api.h svm_light/svm_common.h svm_struct_api_types.h svm_struct/svm_struct_common.h
    $(CC) -c $(CFLAGS) svm_struct_learn_custom.c -o svm_struct_learn_custom.o

링커는 먼저 종속성을 수집 svm_light/svm_learn.o하고( -lm) 정의를 볼 때 채웁니다( ).

호출 $(LIBS)끝에 이미 있는 것 ld같으므로 다음을 수행하십시오.

LIBS += -lm

그것을 수정해야합니다.

기타 팁:

  • 당신은 패턴 cd X; make TARGET바꿀 수 있습니다make -C X TARGET
  • 대상을 로 참조 $@하고 종속성 목록의 첫 번째 전제 조건을 로 참조할 수 $<있으므로 마지막 규칙은 다음과 같이 작성할 수 있습니다.
svm_struct_learn_custom.o: svm_struct_learn_custom.c svm_struct_api.h svm_light/svm_common.h svm_struct_api_types.h svm_struct/svm_struct_common.h
    $(CC) -c $(CFLAGS) $< -o $@

여기서 .c 파일을 컴파일하기 위한 내장 레시피의 레시피 재정의는 헤더를 (추가) 전제 조건으로 나열하는 것으로 충분합니다.

svm_struct_learn_custom.o: svm_struct_api.h svm_light/svm_common.h svm_struct_api_types.h svm_struct/svm_struct_common.h

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

C- '-lm'을 사용해도 "sqrt"에 대한 정의되지 않은 참조

sqrt (geany)에 대한 정의되지 않은 참조

sqrt (geany)에 대한 정의되지 않은 참조

rtems에서 powf 함수 사용 (powf에 대한 정의되지 않은 참조)

C에서 sqrtf () 사용하기 : "`sqrtf '에 대한 정의되지 않은 참조"

Fortran에서 모듈 사용 :`parse_ '에 대한 정의되지 않은 참조

math.h 및 라이브러리 링크 -lm을 사용하여 " 'pow'에 대한 정의되지 않은 참조"

ctor 및 ctor 복사에 대한 정의되지 않은 참조

C Cmake 설정-pow ()에 대한 정의되지 않은 참조 (-lm에도 불구하고)

ifort / icc를 사용할 때 'main'에 대한 정의되지 않은 참조

OpenCV : cmake를 사용할 때`cv :: imread에 대한 정의되지 않은 참조

"<class>에 대한 typeinfo"에 대한 정의되지 않은 참조

Number에 대한 vtable에 대한 정의되지 않은 참조

Eclipse의 OpenSSl 앱용 함수에 대한 정의되지 않은 참조

sprintf ()를 사용할 때 __mulhi3에 대한 정의되지 않은 참조-Windows의 Code :: Blocks에서 AVR GCC

make에서`main '에 대한 정의되지 않은 참조

C에서 (FUNCTIONNAME)에 대한 정의되지 않은 참조

`yylex '에 대한 정의되지 않은 참조 &&`yyin'에 대한 정의되지 않은 참조

C ++ Code :: morsecode ()에 대한 정의되지 않은 참조 및 Code :: alphacode ()에 대한 정의되지 않은 참조

안드로이드에서 JNI를 사용하는 '곱하기'에 대한 정의되지 않은 참조

Qt Quick + CMake + 사용자 정의 QObject는 `vtable'에 대한 정의되지 않은 참조를 생성합니다.

CMake를 사용하여 lib .a로 생성 된 메서드에 대한 정의되지 않은 참조

`vtable에 대한 이상한 정의되지 않은 참조

정적 constexpr에 대한 정의되지 않은 참조

정적 constexpr char []에 대한 정의되지 않은 참조

정적 constexpr char [] []에 대한 정의되지 않은 참조

정적 함수에 대한 정의되지 않은 참조

정적 함수에 대한 정의되지 않은 참조

C를 사용한 Windows API 프로그래밍 : OpenJobObject에 대한 정의되지 않은 참조

TOP 리스트

  1. 1

    셀레늄의 모델 대화 상자에서 텍스트를 추출하는 방법은 무엇입니까?

  2. 2

    Blazor 0.9.0 및 ASP.NET Core 3 미리보기 4를 사용한 JWT 인증

  3. 3

    openCV python을 사용하여 텍스트 문서에서 워터 마크를 제거하는 방법은 무엇입니까?

  4. 4

    C # 16 진수 값 0x12는 잘못된 문자입니다.

  5. 5

    Excel : 합계가 N보다 크거나 같은 상위 값 찾기

  6. 6

    오류 : MSB4803 : MSBuild의 .NET Core 버전에서 "ResolveComReference"작업이 지원되지 않습니다.

  7. 7

    R에서 Excel로 내보낼 때 CET / CEST 시간 이동이 삭제됨

  8. 8

    node.js + postgres : "$ 1"또는 그 근처에서 구문 오류

  9. 9

    확대 후 하이 차트에서 Y 축이 잘못 정렬 됨

  10. 10

    EPPlus에서 행 높이를 설정할 때 이상한 동작

  11. 11

    Ionic 2 로더가 적시에 표시되지 않음

  12. 12

    MS Access 부분 일치 2 테이블

  13. 13

    EPPlus에서 병합 된 셀의 행 높이 자동 맞춤

  14. 14

    ExecuteNonQuery- 연결 속성이 초기화되지 않았습니다.

  15. 15

    ResponseEntity를 사용하고 InputStream이 닫히는 지 확인하는 적절한 스트리밍 방법

  16. 16

    PrematureCloseException : 연결이 너무 일찍 닫혔습니다.

  17. 17

    오류 : "const wchar_t *"유형의 인수가 "WCHAR *"유형의 매개 변수와 호환되지 않습니다.

  18. 18

    Java에서 이미지를 2 색으로 변환

  19. 19

    overflow-y를 사용할 때 스크롤 버벅 거림 줄이기 : scroll;

  20. 20

    Java에서 Apache POI를 사용하여 테이블 크기 및 간격을 단어로 설정하는 방법

  21. 21

    Android Kotlin은 다른 활동에서 함수를 호출합니다.

뜨겁다태그

보관