кросс-компиляция qt для raspberry pi stdlib.h ошибка - PullRequest
0 голосов
/ 13 июня 2019

Я кросс-компиляция qt на Raspberry Pi. Он был настроен правильно, без проблем. Тогда я сказал написать свой самый первый код. Я использовал пустой шаблон при создании нового проекта. Затем я нажал кнопку запуска и получил следующие ошибки:

/home/molinux/raspi/sysroot/usr/include/stdlib.h:471: error: expected initializer before ‘__attribute_alloc_size__’
      __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
                                   ^~~~~~~~~~~~~~~~~~~~~~~~
/home/molinux/raspi/sysroot/usr/include/time.h:123: error: ‘__syscall_slong_t’ does not name a type
     __syscall_slong_t tv_nsec; /* Nanoseconds.  */
     ^~~~~~~~~~~~~~~~~

/home/molinux/raspi/sysroot/usr/include/pthread.h:236: error: expected initializer before ‘__THROWNL’
       void *__restrict __arg) __THROWNL __nonnull ((1, 3));
                               ^~~~~~~~~

Вот часть файла stdlib.h:

#ifdef __USE_MISC
#include <alloca.h>
#endif /* Use misc.  */

#if (defined __USE_XOPEN_EXTENDED && !defined __USE_XOPEN2K) \
    || defined __USE_MISC
/* Allocate SIZE bytes on a page boundary.  The storage cannot be freed.  */
extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
#endif

#ifdef __USE_XOPEN2K
/* Allocate memory of SIZE bytes with an alignment of ALIGNMENT.  */
extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
     __THROW __nonnull ((1)) __wur;
#endif

#ifdef __USE_ISOC11
/* ISO C variant of aligned allocation.  */
extern void *aligned_alloc (size_t __alignment, size_t __size)
     __THROW __attribute_malloc__ __attribute_alloc_size__ ((2)) __wur;
#endif

__BEGIN_NAMESPACE_STD
/* Abort execution and generate a core-dump.  */
extern void abort (void) __THROW __attribute__ ((__noreturn__));


/* Register a function to be called when `exit' is called.  */
extern int atexit (void (*__func) (void)) __THROW __nonnull ((1));

#if defined __USE_ISOC11 || defined __USE_ISOCXX11
/* Register a function to be called when `quick_exit' is called.  */
# ifdef __cplusplus
extern "C++" int at_quick_exit (void (*__func) (void))
     __THROW __asm ("at_quick_exit") __nonnull ((1));
# else
extern int at_quick_exit (void (*__func) (void)) __THROW __nonnull ((1));
# endif
#endif

Вот main.qml:

import QtQuick 2.12
import QtQuick.Window 2.12

Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")
}

Вот часть pthread.h


/* Create a new thread, starting with execution of START-ROUTINE
   getting passed ARG.  Creation attributed come from ATTR.  The new
   handle is stored in *NEWTHREAD.  */
extern int pthread_create (pthread_t *__restrict __newthread,
               const pthread_attr_t *__restrict __attr,
               void *(*__start_routine) (void *),
               void *__restrict __arg) __THROWNL __nonnull ((1, 3));

/* Terminate calling thread.

   The registered cleanup handlers are called via exception handling
   so we cannot mark this function with __THROW.*/
extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));

/* Make calling thread wait for termination of the thread TH.  The
   exit status of the thread is stored in *THREAD_RETURN, if THREAD_RETURN
   is not NULL.

   This function is a cancellation point and therefore not marked with
   __THROW.  */
extern int pthread_join (pthread_t __th, void **__thread_return);

...