From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by dpdk.org (Postfix) with ESMTP id EAF39C6F8 for ; Tue, 5 May 2015 10:08:38 +0200 (CEST) Received: by wizk4 with SMTP id k4so149804303wiz.1 for ; Tue, 05 May 2015 01:08:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=0pn+DMri9wMBwbBWHKKQswMlBqH4Y3pyw5p/99bzs2g=; b=NLiCGp9/A3uzBAVEcPHaptJz226gxS8LmiuJOSHQ0s96U6W+FtbAsPTGraZsqC2wVd Of9P8EniV+6hNiaf8To6VAXccql0qr8rHIP2JB3aD2z9kZAlzc+o2xr4bU4ZAIUGuG5y SyPRuJiqPB6jD6QFD3/BD+1DTJdmBwmAl8bLdbrMVn27A7YBvhv3/WuynSQ4tkecDwzV 0UqjVwsuKU5aiQT92tQedNBSiwenIdozmgWR+or3ts4QKE2PDCy25zLGFs8mOyeRZ1IE vtRzN4fU6sohDCfjbZcc5q5L8jRCtaAJ74K3kwtDxNLVF6fHpJs1sHYGHvn1UO+CFJYi Xx0Q== MIME-Version: 1.0 X-Received: by 10.180.102.74 with SMTP id fm10mr1648919wib.25.1430813317552; Tue, 05 May 2015 01:08:37 -0700 (PDT) Received: by 10.27.136.70 with HTTP; Tue, 5 May 2015 01:08:37 -0700 (PDT) In-Reply-To: References: Date: Tue, 5 May 2015 11:08:37 +0300 Message-ID: From: Pavel Odintsov To: dev@dpdk.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] Issues with rte_hash_crc.h when compiling with C++ X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 08:08:39 -0000 I fixed this issue with very dirty hacks. I commented mentioned here lines in file /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpuflags= .h: //enum rte_cpu_flag_t; //enum cpu_register_t; // static const struct feature_entry cpu_feature_table[]; //static inline int //rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature); And everything compiled OK. But I thought C++ tests and compatibility is should for dpdk. On Tue, May 5, 2015 at 10:57 AM, Pavel Odintsov wrote: > Hello! > > Could anybody help me with this issue? :( > > In this file widely used enum forward declarations which completely > incompatible with C++ and need some rewrite. > > On Wed, Apr 29, 2015 at 3:17 PM, Pavel Odintsov > wrote: >> Hello! >> >> I have C++ application compiles and works nice. But when I include >> rte_hash_crc.h header everything goes away. >> >> CC main.o >> In file included from >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_cpuflags.h:46= :0, >> from >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_hash_crc.h:48= , >> from /root/interceptor/main.cpp:25: >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpufl= ags.h:50:6: >> error: use of enum =E2=80=98rte_cpu_flag_t=E2=80=99 without previous dec= laration >> enum rte_cpu_flag_t; >> ^ >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpufl= ags.h:55:6: >> error: use of enum =E2=80=98cpu_register_t=E2=80=99 without previous dec= laration >> enum cpu_register_t; >> ^ >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpufl= ags.h:79:35: >> error: uninitialized const =E2=80=98cpu_feature_table=E2=80=99 [-fpermis= sive] >> static const struct feature_entry cpu_feature_table[]; >> ^ >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpufl= ags.h:64:8: >> note: =E2=80=98const struct feature_entry=E2=80=99 has no user-provided = default >> constructor >> struct feature_entry { >> ^ >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpufl= ags.h:65:11: >> note: and the implicitly-defined constructor does not initialize >> =E2=80=98uint32_t feature_entry::leaf=E2=80=99 >> uint32_t leaf; /**< cpuid leaf */ >> ^ >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpufl= ags.h:79:53: >> error: storage size of =E2=80=98cpu_feature_table=E2=80=99 isn=E2=80=99t= known >> static const struct feature_entry cpu_feature_table[]; >> ^ >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpufl= ags.h:101:31: >> error: use of enum =E2=80=98rte_cpu_flag_t=E2=80=99 without previous dec= laration >> rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature); >> ^ >> In file included from >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_hash_crc.h:48= :0, >> from /root/interceptor/main.cpp:25: >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_cpuflags.h: >> In function =E2=80=98int rte_cpu_get_flag_enabled(rte_cpu_flag_t)=E2=80= =99: >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_cpuflags.h:27= 8:53: >> error: conflicting declaration of C function =E2=80=98int >> rte_cpu_get_flag_enabled(rte_cpu_flag_t)=E2=80=99 >> rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature) >> ^ >> In file included from >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_cpuflags.h:46= :0, >> from >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_hash_crc.h:48= , >> from /root/interceptor/main.cpp:25: >> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpufl= ags.h:101:1: >> note: previous declaration =E2=80=98int rte_cpu_get_flag_enabled(int)=E2= =80=99 >> rte_cpu_get_flag_enabled(enum rte_cpu_flag_t feature); >> ^ >> /usr/src/dpdk-2.0.0/mk/internal/rte.compile-pre.mk:145: recipe for >> target 'main.o' failed >> make[1]: *** [main.o] Error 1 >> /usr/src/dpdk-2.0.0/mk/rte.extapp.mk:42: recipe for target 'all' failed >> make: *** [all] Error 2 >> >> I prepared my environment with this manual: >> http://www.stableit.ru/2015/04/how-to-code-for-dpdk-with-c.html >> >> Could anybody help me with this header file and C++? >> >> -- >> Sincerely yours, Pavel Odintsov > > > > -- > Sincerely yours, Pavel Odintsov --=20 Sincerely yours, Pavel Odintsov