From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas.monjalon@6wind.com>
Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42])
 by dpdk.org (Postfix) with ESMTP id AE05EC168
 for <dev@dpdk.org>; Tue, 16 Feb 2016 17:28:13 +0100 (CET)
Received: by mail-wm0-f42.google.com with SMTP id c200so170427465wme.0
 for <dev@dpdk.org>; Tue, 16 Feb 2016 08:28:13 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=6wind-com.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:organization:user-agent
 :in-reply-to:references:mime-version:content-transfer-encoding
 :content-type; bh=rnw6UJuitAzcYwc/+wLr9CxOdHYf2Ca+O4kI86lm5hs=;
 b=HrmrzZGNtpXm3W5L6ToU4axjSyxQcCrwPxMKu7XkgoLK5aDg7qkbK7gsraeDHjaJZw
 KFlLxYS8CA5mbZH+Aw3AC7let1feA2e2hwSNTEk+hBhaEtKrxu8Ld5OpGQxwZlU3Dyrm
 5j3giLYj1y9m75u7PI4PicCzdrSVTqw9ovnsHzO7b10fDSizrDRji9P6ZdmL+IGsebB/
 lj8lh0JKNlZ56IRHKoVIRJlP896LivCgQZKuX9VGzlW0t3beUgHtAxjzf7p0quPPj7x8
 yuBa+8Vr9r/xDO90zgXFkQ5a3SBVpXydhB62AUHN/dHFOIIX4Y5PHywmVmAoreYHsQQQ
 RRnA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:organization
 :user-agent:in-reply-to:references:mime-version
 :content-transfer-encoding:content-type;
 bh=rnw6UJuitAzcYwc/+wLr9CxOdHYf2Ca+O4kI86lm5hs=;
 b=Qe78ym2pNOTCsS/ciVqpb1xWWq6O1O1gca3yNku+zfVqWJanlA9L88GB7MchlmvqNO
 a/hVVyFmWo3Stm5B8i+MufdL+l0/rbZRwNKr7oZfeb3ymciJl51M84fL+tXNPoMR8B2d
 z3N173jYcSTh+vDoFr6Cf6JbdgxXKxfIxq7Ng7H8359RfsPstMOfB4VfGVVal0dRa1qu
 1o33vACwa3g8DVNliFL/DbUcvqHhEuarrAxuEYtDf4jwBZOifaMKIQlptEZNTPIlKuAx
 12VZTg8ha9MtKksv5TZ1Ph27Wui7o2fntIwJLwK6ykXtTVwfL5bWANHBGpxUGuJtzb9V
 6NhA==
X-Gm-Message-State: AG10YOSLgV2KdX0CI5EqpWtuIgU+3yHCziMBFYnYxG50jowWBLApcQLNhdRCYky2ILdriKtf
X-Received: by 10.194.63.242 with SMTP id j18mr27140572wjs.114.1455640093484; 
 Tue, 16 Feb 2016 08:28:13 -0800 (PST)
Received: from xps13.localnet (guy78-3-82-239-227-177.fbx.proxad.net.
 [82.239.227.177])
 by smtp.gmail.com with ESMTPSA id h132sm21254553wmf.9.2016.02.16.08.28.12
 (version=TLSv1/SSLv3 cipher=OTHER);
 Tue, 16 Feb 2016 08:28:12 -0800 (PST)
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Date: Tue, 16 Feb 2016 17:26:41 +0100
Message-ID: <3258026.sKzRUcIKf8@xps13>
Organization: 6WIND
User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; )
In-Reply-To: <20160216162134.GA30782@sivlogin002.ir.intel.com>
References: <1454691969-25734-1-git-send-email-thomas.monjalon@6wind.com>
 <1455606865-22680-1-git-send-email-thomas.monjalon@6wind.com>
 <20160216162134.GA30782@sivlogin002.ir.intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2 0/3] fix C++ includes
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 16 Feb 2016 16:28:13 -0000

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;
}