簡體   English   中英

未知類型名稱 '__uint64_t'

[英]unknown type name '__uint64_t'

我已經恢復了在遷移(oracle 11g 到 12c)后不再編譯的舊開發(嵌入 proC)。

注:數據已匿名。

舊環境:

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地址嗎?

更新 == 我將我的代碼更新為更匿名的,所以我可以給你更多:

制作 :

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

費希爾C:

#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>

所以在我的機器上,__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>

這些是我建議檢查庫不一致的地方。

還檢查你的代碼是不是直接包括在內?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM