2013-03-03 2 views
2

this 입문서 (Linux 용 오디오 서버) 입문서를 따르려고합니다. 튜토리얼에서, 저자는 당신이 만드는 잭의 cflagslibs을 찾기 위해 pkg-config를 사용해야한다고 설명과 같이 gcc 명령을'jack_client_close`에 대한 정의되지 않은 참조,

/tmp/ccyuOC0u.o: In function `signal_handler': 
simple_client.c:(.text+0x16): undefined reference to `jack_client_close' 
/tmp/ccyuOC0u.o: In function `process': 
simple_client.c:(.text+0x6f): undefined reference to `jack_port_get_buffer' 
simple_client.c:(.text+0x87): undefined reference to `jack_port_get_buffer' 
/tmp/ccyuOC0u.o: In function `main': 
simple_client.c:(.text+0x25b): undefined reference to `sin' 
simple_client.c:(.text+0x2c1): undefined reference to `jack_client_open' 
simple_client.c:(.text+0x372): undefined reference to `jack_get_client_name' 
simple_client.c:(.text+0x3b1): undefined reference to `jack_set_process_callback' 
simple_client.c:(.text+0x3ca): undefined reference to `jack_on_shutdown' 
simple_client.c:(.text+0x3ee): undefined reference to `jack_port_register' 
simple_client.c:(.text+0x419): undefined reference to `jack_port_register' 
simple_client.c:(.text+0x475): undefined reference to `jack_activate' 
simple_client.c:(.text+0x4c5): undefined reference to `jack_get_ports' 
simple_client.c:(.text+0x514): undefined reference to `jack_port_name' 
simple_client.c:(.text+0x52c): undefined reference to `jack_connect' 
simple_client.c:(.text+0x56e): undefined reference to `jack_port_name' 
simple_client.c:(.text+0x586): undefined reference to `jack_connect' 
simple_client.c:(.text+0x5ba): undefined reference to `jack_free' 
collect2: ld returned 1 exit status 

난 : 출력을 제공

gcc -o simple_client `pkg-config --cflags --libs jack` simple_client.c 

gcc를 사용하거나 C 프로그램을 작성하는 데별로 경험이 없었습니다 (대부분의 경험은 javascript, clojure, java, python 및 php로 수행되었습니다). 내가 수집 한 내용과 그에 대한 연구는 일부 라이브러리가 누락되거나 잘못 연결되어 있습니다 (확실하지 않음).

위에서 언급 한 튜토리얼에서는
-ljack 

은, 저자가 잭에 연결되는 libs와 이삭 줍기에 대해 동일한 방법을 보여줍니다, 그러나 그의 출력은 다음과 같습니다

그래서 그냥 내 컴퓨터에 pkg-config --cflags --libs jack을 실행, 내가 얻을 :

-ljack -lpthread -ldl -lrt 

확실하지 무엇 pthread에,하지만 난 DL은 DSP 로더라고 생각하고, RT 실시간으로 함께 할 수있는 뭔가가. /lib이라는 여러 디렉토리를 검색했으며 이러한 다른 라이브러리에 대해 아무 것도 알지 못해서 내 컴퓨터에 존재하지 않는다고 생각합니다. 그러나 pkg-config에 전화를 걸면 아무 것도 언급하지 않는다는 것이 이상한 것 같습니다. 이 라이브러리를 찾는 방법은 무엇입니까? 아니면 내가 잘못 추적하고 있는가?

+0

이 명령이 작동합니까?'gcc -o simple_client $ (pkg-config --cflags --libs jack) -ljack -lpthread -ldl -lrt simple_client.c'? – Tuxdude

+0

불행히도 – tjb1982

+0

위의 gcc 명령을 실행할 때 나타나는 오류로 게시를 편집 하시겠습니까? 잘못된 정보를 디버깅하는 것이 유용한 정보입니다. – Tuxdude

답변

4

귀하의 링크 명령 줄 잘못, 대신 하나를 수행하십시오

gcc -o simple_client simple_client.c `pkg-config --cflags --libs jack` 

명령 줄 matters에 아카이브 라이브러리의 순서.

관련 문제