未知类型名称'__uint64_t'

问题描述 投票:0回答:1

我已经恢复了旧的开发,(包含proC),在移植后(oracle 11g到12c)不再编译。

注意:数据已匿名化。

旧环境:

Linux <NOMDELAMACHINE> 2.6.32-642.el6.x86_64 #1 SMP Wed Apr 13 00:51:26 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
Oracle 11g 
gcc : 
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright © 2010 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de copie.  Il n'y a PAS GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

新环境:

Linux <NOMDELAMACHINE> 3.10.0-693.17.1.el7.x86_64 #1 SMP Sun Jan 14 10:36:03 EST 2018 x86_64 x86_64 x86_64 GNU/Linux
Oracle 12c
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
Copyright © 2015 Free Software Foundation, Inc.
Ce logiciel est libre; voir les sources pour les conditions de copie.  Il n'y a PAS GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

在旧环境中,编译时没有问题。

另一方面,在新环境上编译时,出现以下问题:

In file included from /usr/include/signal.h:340:0, 
                 from /usr/include/sys/wait.h:30, 
                 from /tmp/compilC/inc/LIBPERSO.h:39, 
                 from FichierC.c:27:

/usr/include/bits/sigcontext.h:33:3: erreur: unknown type name ‘__uint64_t’
   __uint64_t xstate_bv; 
   ^ 
/usr/include/bits/sigcontext.h:177:3: erreur: unknown type name ‘__uint64_t’ 
   __uint64_t xstate_bv; 
   ^ 
/usr/include/bits/sigcontext.h:178:3: erreur: unknown type name ‘__uint64_t’ 
   __uint64_t reserved1[2]; 
   ^ 
/usr/include/bits/sigcontext.h:179:3: erreur: unknown type name ‘__uint64_t’ 
   __uint64_t reserved2[5];    ^

make: *** [FichierC] Erreur 1

我比较了两种环境的sigcontext,实际上,我没有安装相同的内容:

旧环境sigcontext:

struct sigcontext

{

  unsigned short gs, __gsh;

  unsigned short fs, __fsh;

  unsigned short es, __esh;

  unsigned short ds, __dsh;

  unsigned long edi;

  unsigned long esi;

  unsigned long ebp;

  unsigned long esp;

  unsigned long ebx;

  unsigned long edx;

  unsigned long ecx;

  unsigned long eax;

  unsigned long trapno;

  unsigned long err;

  unsigned long eip;

  unsigned short cs, __csh;

  unsigned long eflags;

  unsigned long esp_at_signal;

  unsigned short ss, __ssh;

  struct _fpstate * fpstate;

  unsigned long oldmask;

  unsigned long cr2;

};

sigcontext新环境:

struct sigcontext

{

  __uint64_t r8;

  __uint64_t r9;

  __uint64_t r10;

  __uint64_t r11;

  __uint64_t r12;

  __uint64_t r13;

  __uint64_t r14;

  __uint64_t r15;

  __uint64_t rdi;

  __uint64_t rsi;

  __uint64_t rbp;

  __uint64_t rbx;

  __uint64_t rdx;

  __uint64_t rax;

  __uint64_t rcx;

  __uint64_t rsp;

  __uint64_t rip;

  __uint64_t eflags;

  unsigned short cs;

  unsigned short gs;

  unsigned short fs;

  unsigned short __pad0;

  __uint64_t err;

  __uint64_t trapno;

  __uint64_t oldmask;

  __uint64_t cr2;

  __extension__ union

    {

      struct _fpstate * fpstate;

      __uint64_t __fpstate_word;

    };

  __uint64_t __reserved1 [8];

};

用于编译的make文件:

CC=gcc    

# Repertoire des fichiers include ".h"     
# ------------------------------------

INCDIR=/tmp/compilC/inc     
INCDIRBADS=/tmp/compilC/inc     
SRCDIR=/tmp/compilC     
OBJDIR=$(SRCDIR)/obj    

ECHO=$(ORACLE_HOME)/bin/echodo

CFLAGS=-I$(INCDIR) -I$(INCDIRBADS) -I$(ORACLE_HOME)/precomp/public -DPRECOMP -Dextension -undef -O3 -Wall -v 


# Fichiers de declarations ".h" a inclure     
# ---------------------------------------     
INC=\

 $(INCDIR)/header1.h\     
 $(INCDIR)/header2.h\     
 $(INCDIR)/header3.h\     
 $(INCDIR)/header4.h\     
 $(INCDIR)/header5.h\     
 $(INCDIR)/header6.h\     
 $(INCDIR)/header7.h\     
 $(INCDIR)/header8.h\     
 $(INCDIR)/header9.h

all: FichierC

# FichierC.o     
# ---------

$(OBJDIR)/FichierC.o:\     
   $(SRCDIR)/FichierC.c $(INC)     
    @$(ECHO) $(CC) $(CFLAGS) -o $@ -c $(SRCDIR)/FichierC.c

当前,我不知道如何确定我的研究方向。

我会说问题出在库的版本安装不正确,但是我不确定并且作为环境的主用户(root帐户),我无法执行我要测试的操作。

您有什么线索/想法可以解锁我吗?

我可以恢复库“ sigcontext.h”并将其嵌入到项目中我的INCDIR地址吗?

更新==我将代码更新为更匿名,因此我可以给您更多:

Make:

In file included from /usr/include/signal.h:340:0,
                 from /usr/include/sys/wait.h:30,
                 from FichierC.c:8:
/usr/include/bits/sigcontext.h:33:3: erreur: unknown type name ‘__uint64_t’
   __uint64_t xstate_bv;   ^
/usr/include/bits/sigcontext.h:177:3: erreur: unknown type name ‘__uint64_t’
   __uint64_t xstate_bv;   ^
/usr/include/bits/sigcontext.h:178:3: erreur: unknown type name ‘__uint64_t’
   __uint64_t reserved1[2];   ^
/usr/include/bits/sigcontext.h:179:3: erreur: unknown type name ‘__uint64_t’
   __uint64_t reserved2[5];   ^
FichierC.c: In function ‘test’:
FichierC.c:20:4: attention : cette fonction retourne l'adresse d'une variable locale [-Wreturn-local-addr]
    return(ach_DateHeure);    ^
make: *** [FichierC] Erreur 1

FichierC:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <signal.h>
#include <inttypes.h>
#include <stdint.h>

char ach_DateHeure[500] = {' '};

char *test(void)
{ 
    char ach_DateHeure[500] = {'0'};

   return(ach_DateHeure);
}

所以问题出在网上

#include <sys/wait.h>
c linux gcc makefile
1个回答
0
投票

因此,在我的计算机上,__uint64_t(带下划线)仅在/usr/include/x86_64-linux-gnu/bits/types.h

并且仅用于/ usr / include / x86_64-linux-gnu / bits / *(包括sigcontext.h)和/ usr / include / x86_64-linux-gnu / sys / *

/ usr / include / signal.h包括:

#include <bits/types.h>
#include <bits/signum.h>

然后很久以后:

/* Get machine-dependent `struct sigcontext' and signal subcodes.  */
# include <bits/sigcontext.h>

这些是我建议检查库不一致的地方。

还检查您的代码是否不直接包含?

© www.soinside.com 2019 - 2024. All rights reserved.