Results 1 to 3 of 3

Thread: including

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default including

    hi, hi have 2 app that shared a .cpp; in cpp there is a <qfile.h>; but only one app use this <qfile.h> the other no! is there a way to include/exclude this .h such as "if I'm app1 use qfile"...thanks
    Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: including

    How come if you use that .cpp file in one application it must include qfile.h and if you use it in another application --- it doesn't? What you should include depends on the code itself, not where you use it.

    Anyway you can use #ifdef and #define for this.

  3. #3
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: including

    app1 use a hello.cpp because it use some function(not all); app2 use other function of hello.cpp (but not all). app1 need the function that need (sorry) "myFile.h"; so app2 doesn't use that header but I have to add it in .pro. I don't want to add "myFile.h" line in .pro in the app2.(otherwise don't compile).ok? How can I?
    Regards

Similar Threads

  1. Errors including shellapi.h
    By SkripT in forum Qt Programming
    Replies: 8
    Last Post: 1st May 2006, 18:13

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.