DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavel Odintsov <pavel.odintsov@gmail.com>
To: dev@dpdk.org
Subject: Re: [dpdk-dev] Issues with rte_hash_crc.h when compiling with C++
Date: Tue, 5 May 2015 11:08:37 +0300	[thread overview]
Message-ID: <CALgsdber6tLi7gepNjwCNBUY9+t-PjnOPSQC9u=401Odgt880g@mail.gmail.com> (raw)
In-Reply-To: <CALgsdbfWTUjhyfL2X6sAU1KDPfLEBAriB2weq_x9KD+qr8HROw@mail.gmail.com>

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
<pavel.odintsov@gmail.com> 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
> <pavel.odintsov@gmail.com> 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_cpuflags.h:50:6:
>> error: use of enum ‘rte_cpu_flag_t’ without previous declaration
>>  enum rte_cpu_flag_t;
>>       ^
>> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpuflags.h:55:6:
>> error: use of enum ‘cpu_register_t’ without previous declaration
>>  enum cpu_register_t;
>>       ^
>> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpuflags.h:79:35:
>> error: uninitialized const ‘cpu_feature_table’ [-fpermissive]
>>  static const struct feature_entry cpu_feature_table[];
>>                                    ^
>> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpuflags.h:64:8:
>> note: ‘const struct feature_entry’ has no user-provided default
>> constructor
>>  struct feature_entry {
>>         ^
>> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpuflags.h:65:11:
>> note: and the implicitly-defined constructor does not initialize
>> ‘uint32_t feature_entry::leaf’
>>   uint32_t leaf;    /**< cpuid leaf */
>>            ^
>> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpuflags.h:79:53:
>> error: storage size of ‘cpu_feature_table’ isn’t known
>>  static const struct feature_entry cpu_feature_table[];
>>                                                      ^
>> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/generic/rte_cpuflags.h:101:31:
>> error: use of enum ‘rte_cpu_flag_t’ without previous declaration
>>  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 ‘int rte_cpu_get_flag_enabled(rte_cpu_flag_t)’:
>> /usr/src/dpdk-2.0.0/x86_64-native-linuxapp-gcc/include/rte_cpuflags.h:278:53:
>> error: conflicting declaration of C function ‘int
>> rte_cpu_get_flag_enabled(rte_cpu_flag_t)’
>>  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_cpuflags.h:101:1:
>> note: previous declaration ‘int rte_cpu_get_flag_enabled(int)’
>>  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



-- 
Sincerely yours, Pavel Odintsov

      reply	other threads:[~2015-05-05  8:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 12:17 Pavel Odintsov
2015-05-05  7:57 ` Pavel Odintsov
2015-05-05  8:08   ` Pavel Odintsov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALgsdber6tLi7gepNjwCNBUY9+t-PjnOPSQC9u=401Odgt880g@mail.gmail.com' \
    --to=pavel.odintsov@gmail.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).