2014-03-17 2 views
1

allegro5 라이브러리를 사용하는 zone.c라는 프로그램이 있습니다.make를 사용하여 allegro5 프로그램 컴파일

나는이 두 줄로 구성된 메이크 파일을 가지고있다.

zone: zone.c 
     gcc zone.c -o zone $(pkg-config --cflags --libs allegro-5.0 allegro_primitives-5.0) 

나는 이러한 오류를 얻을 "확인"입력 :

/tmp/ccyCx3Hy.o :. :( zone.c '기능 main': zone.c:(.text+0x14): undefined reference to al_install_system에서이 텍스트 + 인 0x23) : al_create_display' zone.c:(.text+0x3b): undefined reference to에 정의되지 않은 참조 al_map_rgb ' zone.c :(텍스트 + 0x70). al_clear_to_color' zone.c:(.text+0x84): undefined reference to al_map_rgb에 정의되지 않은 참조'. zone.c :(텍스트 0xd1 +). zone.c 'al_draw_filled_circle' zone.c:(.text+0xe5): undefined reference to al_map_rgb에 정의되지 않은 참조 :(텍스트 + 0x132) 정의되지 않은 참조 al_draw_filled_circle' zone.c:(.text+0x137): undefined reference to al_flip_display ' zone.c :(. 텍스트 + 0x14f) : 정의되지 않음 오류 : collect2 'al_rest' zone.c:(.text+0x15b): undefined reference to al_destroy_display을 참조 신분증 1 개 종료 상태를 반환 메이크업 : * [지역] 오류 1

하지만 난 그냥 ("GCC zone.c -o 영역을 $ 줄을 복사 할 경우 pkg- config --cflags --libs allegro-5.0 allegro_primitives-5.0) "수동으로 실행하면 정상적으로 컴파일되고 프로그램이 작동합니다.

allegro5를 사용하지 않는 프로그램을 컴파일 할 때 유사한 makefile을 사용하면 작동합니다.

누구에게 무슨 일이 일어나는지 실마리가 있습니까? 당신이 당신의 규칙에 문자 $을 원하는 경우에

답변

1

대신 $$를 작성하여 메이크업에서 탈출해야합니다 :

zone: zone.c 
     gcc zone.c -o zone $$(pkg-config --cflags --libs allegro-5.0 allegro_primitives-5.0) 
관련 문제