Results 1 to 7 of 7

Thread: compile source code file

  1. #1
    Join Date
    Mar 2009
    Posts
    3
    Platforms
    Windows

    Default compile source code file

    hello everybody. this is my first time in this forum and the first time I use Qt, in fact Qt creator. How can I compile a "library" (source code file) without compiling my program (main function etc.)? the answer in FAQ didn't help me much

    p.s. I'm on windows xp

    p.s.2 sorry for my english
    Last edited by eva; 15th March 2009 at 16:24.

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: compile source code file

    what do you mean saying "library"? You want to compile just 1 file from your project?
    It is unnecessary as it uses make which compiles only changed files since last compile.
    So when you press for example Ctrl+B (build project) for a first time, it will compile and link your project. But editing one file and pressing Ctrl+B again result in compiling and linking just that file. If you really want to compile just one file I think you have to do it from command line.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: compile source code file

    I guess the question is about building a shared library. Assuming you know what qmake is, you have to create a qmake project with such settings:
    qmake Code:
    1. TEMPLATE=lib
    2. CONFIG+=dll
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Mar 2009
    Posts
    3
    Platforms
    Windows

    Default Re: compile source code file

    hmmm. I've got my main function in one file and all the functions that are used by main in another file .cpp and of course the header file

  5. #5
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: compile source code file

    How do you do it in C++ ??
    #include....

    Same is with Qt...Qt is C++ based,,,

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: compile source code file

    Quote Originally Posted by eva View Post
    hmmm. I've got my main function in one file and all the functions that are used by main in another file .cpp and of course the header file
    You need to have a project file (with a .pro extension). Otherwise there is no way in determining what you want to do with your files.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Mar 2009
    Posts
    3
    Platforms
    Windows

    Default Re: compile source code file

    Quote Originally Posted by wysota View Post
    You need to have a project file (with a .pro extension). Otherwise there is no way in determining what you want to do with your files.
    hmmm I see thanks

Similar Threads

  1. QT Project source code
    By darpan in forum Qt Programming
    Replies: 3
    Last Post: 27th December 2012, 17:16
  2. Replies: 3
    Last Post: 8th September 2007, 11:06
  3. Qte source code
    By Gaurav vyas in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 1st July 2007, 15:11
  4. Making source code available
    By vermarajeev in forum General Discussion
    Replies: 1
    Last Post: 29th June 2007, 23:01
  5. Source code in qt-win-eval
    By Max Yaffe in forum Newbie
    Replies: 3
    Last Post: 12th April 2007, 15:17

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.