[QT Creator] Adding Libraries to Projects QT 크리에이터 C/C++ 라이브러리 추가

[QT Creator] Adding Libraries to Projects

In addition to Qt libraries, you can add other libraries to your projects. The way the library is added depends on whether it is a system library or your own library or a 3rd party library located in the build tree of the current project or in another build tree.

qtcreator-add-library-wizard.png

 

Because system libraries do not typically change and are often found by default, you do not need to specify the path to the library or to its includes when you add it.

For your own libraries and 3rd party libraries, you need to specify the paths. Qt Creator tries to quess the include path for an external library, but you need to check it and modify it if necessary. Qt Creator automatically adds the include path for an internal library.

For all libraries, select the target platforms for the application, library, or plugin.

Specify whether the library is statically or dynamically linked. For a statically linked internal library, Qt Creator adds dependencies (PRE_TARGETDEPS) in the project file.

Depending on the development platform, some options might be detected automatically. For example, on Mac OS, the library type (Library or Framework) is detected automatically and the option is hidden. However, if you develop on another platform than Mac OS and want to build your project for the Mac OS, you must specify the library type.

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

The default convention on Windows is that the debug and release versions of a library have the same name, but are placed in different subdirectories, usually called debug and release. If the library path does not contain either of these folders, you cannot select the option to place the libraries in separate folders.

Alternatively, the letter d can be added to the library name for the debug version. For example, if the release version is called example.lib, the debug version is called exampled.lib. You can specify that the letter is added for the debug version and removed for the release version. If the library name ends in d, deselect the Remove "d" suffix for release version option.

Qt Creator supports code completion and syntax highlighting for the added libraries once your project successfully builds and links to them.

To Add Libraries

  1. In the Projects pane, open the project file (.pro).
  2. Right-click in the code editor to open the context menu and select Add Library....
  3. Follow the instructions of the wizard.

For more information about the project file settings, see Declaring Other Libraries.

Example of Adding Internal Libraries

The following example describes how to add a statically linked internal library to your project.

  1. Choose File > New File or Project... > Other Projects > C++ Library to create the library.

    The Introduction and Product Location dialog opens.

    qtcreator-add-library-wizard-ex-1.png

     

  2. In the Type field, select Statically Linked Library.
  3. In the Name field, give a name for the library. For example, mylib.
  4. Follow the instructions of the wizard until you get to the Project Management dialog. In the Add to project list, select a project. For example, myapp.
  5. In the Projects pane, open the project file (.pro). For example, myapp.pro.
  6. Right-click in the code editor to open the context menu and select Add Library... > Internal Library > Next.
  7. In the Library field, select mylib and click Next.
  8. Click Finish to add the following library declaration to the project file:
     win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/release/ -lmylib
     else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../../../projects/mylib/debug/ -lmylib
     else:symbian: LIBS += -lmylib
     else:unix: LIBS += -L$$OUT_PWD/../../../projects/mylib/ -lmylib
    
     INCLUDEPATH += $$PWD/../../../projects/mylib
     DEPENDPATH += $$PWD/../../../projects/mylib
    
     win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/release/mylib.lib
     else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/debug/mylib.lib
     else:unix:!symbian: PRE_TARGETDEPS += $$OUT_PWD/../../../projects/mylib/libmylib.a

 

[출처] http://doc.qt.digia.com/qtcreator-2.3/creator-project-qmake-libraries.html

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
54 리눅스 화면 녹화 : Linux Screen Recoding to make Movie file 졸리운_곰 2015.05.09 567
» [QT Creator] Adding Libraries to Projects QT 크리에이터 C/C++ 라이브러리 추가 file 졸리운_곰 2015.05.07 748
52 리눅스마스터 2015-03-28 발표 secret 졸리운_곰 2015.03.28 0
51 리눅스마스터 2015-03 2급 필기 LMS-1501회_2급2차_B형.pdf file 졸리운_곰 2015.03.17 687
50 리눅스마스터 2015-03 필기 LMF_1급1차(1501회)_B형 file 졸리운_곰 2015.03.17 556
49 리눅스마스터 1급 1차 필기 기출문제 2 file 졸리운_곰 2015.03.04 501
48 리눅스마스터 1급 2차 실기 기출문제 file 졸리운_곰 2015.03.03 811
47 리눅스마스터 1급 1차 필기 기출문제 file 졸리운_곰 2015.03.03 520
46 도커(docker) 리눅스 경량(가벼운)가상화 프로그램 기본 및 설치 사용 file 졸리운_곰 2015.01.28 967
45 Qt Creator + Boost on Ubuntu 졸리운_곰 2014.12.26 477
44 boost lib 라이브러리 On Ubuntu 우분투 졸리운_곰 2014.12.26 570
43 리눅스_부하분산_클러스터_구축_linux_cluster_alang.pdf file 졸리운_곰 2014.11.11 550
42 Qt Application 배포시 고려사항 졸리운_곰 2014.10.28 851
41 system 다른 프로그램 실행 및 대기 졸리운_곰 2014.10.27 756
40 linux 백그라운드 프로세스를 로그아웃시에도 실행하도록 설정 졸리운_곰 2014.10.23 548
39 C/C++ 소스코드를 공개하는 Site 모음 졸리운_곰 2014.10.22 1767
38 Restart VNC Server via SSH 졸리운_곰 2014.10.16 379
37 Ubuntu Qt install (우분투 Qt 설치하기) file 졸리운_곰 2014.10.09 590
36 Linux Qt Creator Installation 졸리운_곰 2014.09.17 515
35 리눅스마스터 1급 2차 실기 기출문제 및 정답 file 졸리운_곰 2014.09.07 1368
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED