리눅스의 라이브러리 사용법이 궁금합니다.

mgu1206의 이미지

안녕하세요 리눅스로 개발하게된 초보입니다. ㅜㅜ

Qt embedded에서 키보드 입력이 필요한데 Qt 가상키보드는 상용 라이센스라..

사용을 못하고 영문/한글 정도 입력을 넣으려고 합니다.

키보드 레이아웃쪽은 작업이 끝났구요..

한글 입력은 libhangul로 일단 개발은 해둔 상태인데,

package로 설치를 했을땐 괜찮았습니다.

배포를 위해서 libhangul.a와 include파일만 별도로 빼서 빌드를 하니

/usr/local/lib/libhangul.a(libhangul_la-hangulkeyboard.o): In function `hangul_keyboard_parse_file':
/home/odroid/libhangul/hangul/hangulkeyboard.c:738: undefined reference to `XML_ParserCreate'
/home/odroid/libhangul/hangul/hangulkeyboard.c:740: undefined reference to `XML_SetUserData'
/home/odroid/libhangul/hangul/hangulkeyboard.c:741: undefined reference to `XML_SetElementHandler'
/home/odroid/libhangul/hangul/hangulkeyboard.c:742: undefined reference to `XML_SetCharacterDataHandler'
/home/odroid/libhangul/hangul/hangulkeyboard.c:754: undefined reference to `XML_Parse'
/home/odroid/libhangul/hangul/hangulkeyboard.c:765: undefined reference to `XML_ParserFree'
collect2: error: ld returned 1 exit status

라고 나오고 빌드에러가 나네요..

좀 기본적인 내요일꺼 같은데..

잘 모르겠네요.. ㅜ

빌드 경로에 libhangul.a 파일을 복사했고 별도의 include/libhangul 경로에 헤더를 복사했습니다.

.pro 파일에 추가한 내용은 아래와 같이 추가했습니다.

LIB += libhangul.a

INCLUDEPATH += ./include/libhangul

김정균의 이미지

일단 libhangul.a 는 배포하지 않아도 상관 없습니다. ".a" 파일로 링크를 하겠다는 의미는 생성할 object 에 포함시킨다는 의미이므로, .a 파일은 빌드를 할 때만 필요 합니다.

그리고, 실제로 libhangul.a 를 link 할 때 발생하는 이슈는 libhangul.a 를 생성할 때 필요한 XML 관련 library 들이 dynanic 하게 link 가 된 것이 문제 입니다. 즉 libhangul.a 안에 필요한 library 들이 들어 있지 않다는 의미 입니다. 그러므로 빌드시에 위의 api 를 가지고 있는 library 를 link 해 주어야 합니다. static build 할 때의 불편함이죠.

mgu1206의 이미지

감사합니다 어떤게 잘못됐는지 알것 같네요.
libhangul이 의존성을 가지는 나머지 라이브러리들도 같이 링크해줘야하는군요..

아마 말쓴대로 라면 .a가 정적, .so파일이 동적 라이브러리 라 보면 될것같네요..
리눅스에서 동적/정적 라이브러리 차이를 좀 더 공부해야겠습니다.

감사합니다

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.