undefined reference to 에러

익명 사용자의 이미지

FFmpeg를 써서 인코딩을 하고있습니다.
raw 데이터를 인코딩하려고 하는데요.
소스코드를 디버깅하면 undefined reference to 'avcodec_receive_packet'이라든지
undefined reference to 'avcodec_send_frame'같은 오류가 뜹니다. (물론 이게 오류의 전부는 아니구요)
헤더 파일도 include 시켜줬습니다. (avcodec.h)

+ 혹시 av_strerror, av_packet_unref, av_packet_alloc, av_opt_set, av_frame_get_buffer, av_frame_make_writable, av_frame_free, av_packet_free 함수가 선언된 헤더를 아시는 분이 계신가요?

익명 사용자의 이미지

보통 링크할 때 발생하는 에러인데요.
디버그 할 때 발생한 게 맞나요?

https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix

글쓴이의 이미지

사진 첨부합니다. 에러가 이렇게 뜹니다.

댓글 첨부 파일: 
첨부파일 크기
Image icon Screenshot from 2019-02-25 10-47-53.png101.21 KB
익명 사용자의 이미지

1. 아무리 봐도 디버그할 때 나는 에러가 아니라 링크 에러인데요.

위 에러를 발생시킨 명령어까지 보여주세요. 십중팔구 GNU 컴파일러이거나 그걸 실행시키는 빌드 시스템(make 등)이겠지만.

원래 말이라는 게 아 다르고 어 다른 법이고, 컴퓨터를 다룰 땐 더 그렇습니다. 잘 모르겠으면 그냥 다 캡쳐해서 보여주는 게 낫습니다.

2. 외부 라이브러리를 사용할 땐 헤더 파일을 포함하는 걸로 끝이 아닙니다. 헤더에는 대개 선언밖에 없으므로, 링커에게 따로 플래그를 줘서 링크해야 됩니다. 대체로 라이브러리마다 방법이 다른데, ffmpeg에 대해서는 아래 링크를 참조하시면 되겠군요.

https://soledadpenades.com/posts/2009/linking-with-ffmpegs-libav/

번외. video_encoder.c:55:13의 if(argv <= 2)는 매우 이상한 코드이고 프로그래머가 이렇게 의도하고 작성했을 가능성은 거의 없습니다. 한 번 검토해보시길.

글쓴이의 이미지

에러가 이렇게 뜹니다.

댓글 첨부 파일: 
첨부파일 크기
Image icon 35FDB656-256E-4D27-A8BB-A7E73BCC3050.png101.18 KB
ifree의 이미지

헤더만 포함되고 함수 본체를 찾지 못하는 것 같습니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.