从源

时间:2017-10-20 20:04:43

标签: c++

我想从源代码安装pkgconfig,因为我想让它在我的应用程序访问的特定路径中。但是我遇到了一个问题,这对于非常熟悉C / C ++的人来说似乎很基础。我试图搜索解决方案但没有成功。问题在于end_time的定义是来自下面的make show的摘录

In file included from gthread.c:42:0:
gthread-posix.c: In function 'g_cond_timed_wait_posix_impl':
gthread-posix.c:112:19: error: storage size of 'end_time' isn't known
struct timespec end_time;
gthread-posix.c:112:19: warning: unused variable 'end_time' [-Wunused-variable]
Makefile:285: recipe for target 'gthread.lo' failed

文件" pkgconfig-0.23 / glib-1.2.10 / gthread / gthread-posix.c"中的第112行。在错误的起源(包括之前的一行和之后的几行)是

{
int result;
struct timespec end_time;
 gboolean timed_out;
g_return_val_if_fail (cond != NULL, FALSE);
g_return_val_if_fail (entered_mutex != NULL, FALSE);
if (!abs_time)
{
g_cond_wait (cond, entered_mutex);
return TRUE;
 }
end_time.tv_sec = abs_time->tv_sec;
end_time.tv_nsec = abs_time->tv_usec * (G_NANOSEC / G_MICROSEC);

g_assert (end_time.tv_nsec < G_NANOSEC);
result = pthread_cond_timedwait ((pthread_cond_t *) cond,
                               (pthread_mutex_t *) entered_mutex,
                               &end_time);
#ifdef HAVE_PTHREAD_COND_TIMEDWAIT_POSIX
timed_out = (result == ETIMEDOUT);

#else
timed_out = (result == -1 && errno == EAGAIN);
#endif
  if (!timed_out)
    posix_check_for_error (result);
  return !timed_out;
}

任何帮助将不胜感激

我的操作系统是ubuntu 16.04 输出cat / proc / cpuinfo

cpu cores   : 1
apicid      : 0
initial apicid  : 0
fdiv_bug    : no
f00f_bug    : no
coma_bug    : no
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss nx pdpe1gb rdtscp constant_tsc arch_perfmon pebs bts xtopology tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 fma pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor abm epb fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid xsaveopt dtherm ida arat pln pts
bugs        :
bogomips    : 5202.00
clflush size    : 64
cache_alignment : 64
address sizes   : 42 bits physical, 48 bits virtual
power management:

0 个答案:

没有答案