Results 1 to 4 of 4

Thread: Qt4/C++ - Adding a 'C' program - missing stdarg.h

  1. #1
    Join Date
    Oct 2006
    Posts
    105
    Thanks
    13
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Qt4/C++ - Adding a 'C' program - missing stdarg.h

    Hello,

    I'm trying to add an existing 'C' file to my Qt4 project, and have a header missing - 'stdarg.h'.

    I can find matching file files on my system.

    sudo find -name stdarg.h
    ./usr/include/c++/4.6/tr1/stdarg.h
    ./usr/lib/gcc/arm-linux-gnueabihf/4.8/include/stdarg.h
    ./usr/lib/gcc/arm-linux-gnueabihf/4.6/include/stdarg.h

    I can put the full path in the 'C' file, but would prefer not to change the 'C' file, if possible.
    Would it be reasonable, just to copy the header to my source directory?
    This would still need a change to the 'C' source. <stdarg.h> to "stdarg.h".
    Would it be possible to add it to the .pro file, as a +=include?

    Regards
    Last edited by jimbo; 8th May 2015 at 10:52.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt4/C++ - Adding a 'C' program - missing stdarg.h

    What platform are you building on? A Linux I assume.
    What platform are you building for?

    Does this program:
    Qt Code:
    1. /* test.c */
    2. #include <stdarg.h>
    3.  
    4. int main(int argc, char **argv) { return 0; }
    To copy to clipboard, switch view to plain text mode 
    compile with:
    Qt Code:
    1. gcc -v -c test.c
    To copy to clipboard, switch view to plain text mode 
    or whatever your C compiler is actually called? The verbose output will tell you exactly where it will look for stdarg.h.

  3. #3
    Join Date
    Oct 2006
    Posts
    105
    Thanks
    13
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt4/C++ - Adding a 'C' program - missing stdarg.h

    Hello,

    Thanks for your reply.

    This is on a Raspberry Pi (arm).
    Raspian - Wheezy.
    I'm compiling from within Qt Creator.

    pi@mypi ~ $ uname -a
    Linux mypi 3.18.11-v7+ #781 SMP PREEMPT Tue Apr 21 18:07:59 BST 2015 armv7l GNU/Linux

    Qt Creator 3.2.2

    gcc -v
    gcc version 4.6.3 (Debian 4.6.3-14+rpi1)

    Qt Code:
    1. pi@mypi ~/Desktop/test $ gcc -v -c test.c
    2. Using built-in specs.
    3. COLLECT_GCC=gcc
    4. COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
    5. Target: arm-linux-gnueabihf
    6. Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14+rpi1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
    7. Thread model: posix
    8. gcc version 4.6.3 (Debian 4.6.3-14+rpi1)
    9. COLLECT_GCC_OPTIONS='-v' '-c' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp'
    10. /usr/lib/gcc/arm-linux-gnueabihf/4.6/cc1 -quiet -v -imultilib . -imultiarch arm-linux-gnueabihf test.c -quiet -dumpbase test.c -march=armv6 -mfloat-abi=hard -mfpu=vfp -auxbase test -version -o /tmp/cc0e4Vik.s
    11. GNU C (Debian 4.6.3-14+rpi1) version 4.6.3 (arm-linux-gnueabihf)
    12. compiled by GNU C version 4.6.3, GMP version 5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
    13. GGC heuristics: --param ggc-min-expand=89 --param ggc-min-heapsize=110548
    14. ignoring nonexistent directory "/usr/local/include/arm-linux-gnueabihf"
    15. ignoring nonexistent directory "/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/include"
    16. #include "..." search starts here:
    17. #include <...> search starts here:
    18. /usr/lib/gcc/arm-linux-gnueabihf/4.6/include
    19. /usr/local/include
    20. /usr/lib/gcc/arm-linux-gnueabihf/4.6/include-fixed
    21. /usr/include/arm-linux-gnueabihf
    22. /usr/include
    23. End of search list.
    24. GNU C (Debian 4.6.3-14+rpi1) version 4.6.3 (arm-linux-gnueabihf)
    25. compiled by GNU C version 4.6.3, GMP version 5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
    26. GGC heuristics: --param ggc-min-expand=89 --param ggc-min-heapsize=110548
    27. Compiler executable checksum: cf78bfe2d99d4ca6e0637950db1b4acd
    28. COLLECT_GCC_OPTIONS='-v' '-c' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp'
    29. as -march=armv6 -mfloat-abi=hard -mfpu=vfp -meabi=5 -o test.o /tmp/cc0e4Vik.s
    30. COMPILER_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/
    31. LIBRARY_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../:/lib/arm-linux-gnueabihf/:/lib/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/
    32. COLLECT_GCC_OPTIONS='-v' '-c' '-march=armv6' '-mfloat-abi=hard' '-mfpu=vfp'
    33. pi@mypi ~/Desktop/test $
    To copy to clipboard, switch view to plain text mode 

    It produces a test.o file

    Regards

  4. #4
    Join Date
    Oct 2006
    Posts
    105
    Thanks
    13
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt4/C++ - Adding a 'C' program - missing stdarg.h

    Hello,

    A solution I've found that seems to work is :-

    Add INCLUDEPATH += /usr/lib/gcc/arm-linux-gnueabihf/4.6/include/ to the pro file.

    Regards

Similar Threads

  1. Replies: 1
    Last Post: 23rd April 2014, 10:03
  2. Replies: 7
    Last Post: 19th January 2014, 16:57
  3. Replies: 0
    Last Post: 17th August 2010, 15:35
  4. Background image is missing after adding dlls
    By Lazaruspl in forum Qt Programming
    Replies: 10
    Last Post: 25th June 2010, 21:58
  5. Replies: 1
    Last Post: 30th April 2010, 13:25

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.