[dpdk-dev] [PATCH v2 0/3] fix C++ includes

Thomas Monjalon thomas.monjalon at 6wind.com
Tue Feb 16 17:26:41 CET 2016


2016-02-16 16:21, Ferruh Yigit:
> On Tue, Feb 16, 2016 at 08:14:22AM +0100, Thomas Monjalon wrote:
> > When trying to build a C++ application, some errors appear from DPDK headers.
> > 2 libraries are not fixed in this series:
> > - cmdline
> > - vhost which includes some not compliant Linux virtio headers
> 
> Out of curiosity, how can we detect C++ compilation problems, do we have a C++ sample application?
> Or how can we compile any existing application with c++, I tried "EXTRA_CFLAGS="-x c++" or "CC=g++" but both failed to compile.

I will submit a test.
At the moment, I use CC=g++ with this file:

#ifdef RTE_LIBRTE_EAL
#include <rte_alarm.h>
#include <rte_atomic.h>
#include <rte_branch_prediction.h>
#include <rte_byteorder.h>
#include <rte_common.h>
#include <rte_cpuflags.h>
#include <rte_cycles.h>
#include <rte_debug.h>
#include <rte_devargs.h>
#include <rte_dev.h>
#include <rte_dev_info.h>
#include <rte_eal.h>
#include <rte_eal_memconfig.h>
#include <rte_errno.h>
#include <rte_hexdump.h>
#include <rte_interrupts.h>
#include <rte_keepalive.h>
#include <rte_launch.h>
#include <rte_lcore.h>
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_malloc_heap.h>
#include <rte_memcpy.h>
#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_pci.h>
#include <rte_pci_dev_feature_defs.h>
#include <rte_pci_dev_features.h>
#include <rte_pci_dev_ids.h>
#include <rte_per_lcore.h>
#include <rte_prefetch.h>
#include <rte_random.h>
#ifdef RTE_ARCH_X86
#include <rte_rtm.h>
#endif
#include <rte_rwlock.h>
#include <rte_spinlock.h>
#include <rte_string_fns.h>
#include <rte_tailq.h>
#include <rte_time.h>
#include <rte_timer.h>
#include <rte_vect.h>
#include <rte_version.h>
#endif
#ifdef RTE_LIBRTE_CMDLINE
/* TODO: C++ support
#include <cmdline.h>
#include <cmdline_cirbuf.h>
#include <cmdline_parse_etheraddr.h>
*/
#include <cmdline_parse.h>
#include <cmdline_parse_ipaddr.h>
#include <cmdline_parse_num.h>
#include <cmdline_parse_portlist.h>
#include <cmdline_parse_string.h>
#include <cmdline_rdline.h>
#include <cmdline_socket.h>
#include <cmdline_vt100.h>
#endif
#ifdef RTE_LIBRTE_ACL
#include <rte_acl.h>
#endif
#ifdef RTE_LIBRTE_SCHED
#include <rte_approx.h>
#include <rte_bitmap.h>
#include <rte_red.h>
#include <rte_sched_common.h>
#include <rte_sched.h>
#endif
#ifdef RTE_LIBRTE_NET
#include <rte_arp.h>
#include <rte_icmp.h>
#include <rte_ip.h>
#include <rte_sctp.h>
#include <rte_tcp.h>
#include <rte_udp.h>
#endif
#ifdef RTE_LIBRTE_CFGFILE
#include <rte_cfgfile.h>
#endif
#include <rte_compat.h>
#include <rte_config.h>
#ifdef RTE_LIBRTE_CRYPTODEV
#include <rte_crypto.h>
#include <rte_cryptodev.h>
#include <rte_cryptodev_pmd.h>
#endif
#ifdef RTE_LIBRTE_DISTRIBUTOR
#include <rte_distributor.h>
#endif
#ifdef RTE_LIBRTE_PMD_AF_PACKET
#include <rte_eth_af_packet.h>
#endif
#ifdef RTE_LIBRTE_PMD_BOND
#include <rte_eth_bond.h>
#include <rte_eth_bond_8023ad.h>
#endif
#ifdef RTE_LIBRTE_ETHER
#include <rte_eth_ctrl.h>
#include <rte_ethdev.h>
#include <rte_ether.h>
#endif
#ifdef RTE_LIBRTE_PMD_NULL
#include <rte_eth_null.h>
#endif
#ifdef RTE_LIBRTE_PMD_RING
#include <rte_eth_ring.h>
#endif
#ifdef RTE_LIBRTE_HASH
#include <rte_fbk_hash.h>
#include <rte_hash_crc.h>
#include <rte_hash.h>
#include <rte_jhash.h>
#include <rte_thash.h>
#endif
#ifdef RTE_LIBRTE_IP_FRAG
#include <rte_ip_frag.h>
#endif
#ifdef RTE_LIBRTE_JOBSTATS
#include <rte_jobstats.h>
#endif
#ifdef RTE_LIBRTE_KNI
#include <rte_kni.h>
#endif
#ifdef RTE_LIBRTE_KVARGS
#include <rte_kvargs.h>
#endif
#ifdef RTE_LIBRTE_LPM
#include <rte_lpm.h>
#include <rte_lpm6.h>
#endif
#ifdef RTE_LIBRTE_MBUF
#include <rte_mbuf.h>
#endif
#ifdef RTE_LIBRTE_MBUF_OFFLOAD
#include <rte_mbuf_offload.h>
#endif
#ifdef RTE_LIBRTE_MEMPOOL
#include <rte_mempool.h>
#endif
#ifdef RTE_LIBRTE_METER
#include <rte_meter.h>
#endif
#ifdef RTE_LIBRTE_PIPELINE
#include <rte_pipeline.h>
#endif
#ifdef RTE_LIBRTE_PORT
#include <rte_port.h>
#include <rte_port_ethdev.h>
#include <rte_port_frag.h>
#include <rte_port_ras.h>
#include <rte_port_ring.h>
#include <rte_port_sched.h>
#include <rte_port_source_sink.h>
#endif
#ifdef RTE_LIBRTE_POWER
#include <rte_power.h>
#endif
#ifdef RTE_LIBRTE_REORDER
#include <rte_reorder.h>
#endif
#ifdef RTE_LIBRTE_RING
#include <rte_ring.h>
#endif
#ifdef RTE_LIBRTE_TABLE
#include <rte_lru.h>
#include <rte_table.h>
#include <rte_table_acl.h>
#include <rte_table_array.h>
#include <rte_table_hash.h>
#include <rte_table_lpm.h>
#include <rte_table_lpm_ipv6.h>
#include <rte_table_stub.h>
#endif
#ifdef RTE_LIBRTE_VHOST
/* TODO: fix vhost header for C++
#include <rte_virtio_net.h>
*/
#endif

int
main(int argc, char **argv)
{
        RTE_LOG(NOTICE, USER1, "function %s\n", __func__);
        return 0;
}



More information about the dev mailing list