From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vb0-x233.google.com (mail-vb0-x233.google.com [IPv6:2607:f8b0:400c:c02::233]) by dpdk.org (Postfix) with ESMTP id A1FC6DE0 for ; Fri, 10 Jan 2014 07:28:59 +0100 (CET) Received: by mail-vb0-f51.google.com with SMTP id 10so1187055vbe.10 for ; Thu, 09 Jan 2014 22:30:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=RwH2Xvgy9kQ4Zmo8uUSqvL9V+2WR0Po2wBgf77WsRzQ=; b=ImY75IKqwp94bjdo4ZNJiV8qd7ps/S0eO3d6wQVaKL7mKU7VRd61DidgUDKMw6dacv 7/pYpib+NPBGIXiP781b3EU6OXhqt+k64/pCDLX7qYm2BO5uaSt62Mxg51KHPpEFWcJa 4J52xa3DUuJMF9lxhDR9uzyoAyC6KstRgKWyYuBGdrshf1ItKnAvY+CVTrnF8HkJWgOT 5ov8PyqWSGGOO+wT49hHRemGOP/OfM0OMWDQAhF+NOLQ1YV1nEmtHqmf7oNpxCczxkAv 3UhWq8fFzM1jVoYe7St4MiAG+1/EsfGTwDEXwjEmUZf/L6eWtFJj9h0SwmWSOW6dlPpP yfRw== MIME-Version: 1.0 X-Received: by 10.58.133.137 with SMTP id pc9mr47526veb.53.1389335411801; Thu, 09 Jan 2014 22:30:11 -0800 (PST) Received: by 10.58.77.173 with HTTP; Thu, 9 Jan 2014 22:30:10 -0800 (PST) Date: Fri, 10 Jan 2014 10:00:10 +0330 Message-ID: From: Hamid Ramazani To: Thomas Monjalon Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Useful: Simple C++ program & Makefile 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: Fri, 10 Jan 2014 06:28:59 -0000 > I don't exactly know what is needed for C++. Please keep us informed. Hey Thomas, I've attached a simple program (main.cpp main.h and Makefile) that has a C++ class and just prints some messages in the output. Despite the fact that it's working fine, I'm sure the Makefile could be written much better; Maybe I made it completer in future. All the Best, --Hamid On 1/3/14, Thomas Monjalon wrote: > Hello, > > 03/01/2014 11:48, Hamid Ramazani : >> eal_timer.c:(.text+0x42c): undefined reference to `clock_gettime' > > From "man clock_gettime": > Link with -lrt (only for glibc versions before 2.17). > >> g++ -m64 -pthread -march=native -DRTE_MACHINE_CPUFLAG_SSE >> -DRTE_MACHINE_CPUFLAG_SSE2 -DRTE_MACHINE_CPUFLAG_SSSE3 >> -DRTE_COMPILE_TIME_CPUFLAGS=RTE_CPUFLAG_SSE,RTE_CPUFLAG_SSE2,RTE_CPUFLAG_SS >> SE3 -I/home/hamid/dpdk/dpdk-1.5.1r1/examples/sample/build/include >> -I/home/hamid/dpdk/dpdk-1.5.1r1/x86_64-default-linuxapp-gcc/include >> -include >> /home/hamid/dpdk/dpdk-1.5.1r1/x86_64-default-linuxapp-gcc/include/rte_conf >> ig.h -O3 -W -Wall -Werror -Wmissing-declarations -Wpointer-arith >> -Wcast-align -Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef >> -Wwrite-strings -Wl,-melf_x86_64 -Wl,-export-dynamic sample.cpp -o >> sample -Wl,-L/home/hamid/dpdk/dpdk-1.5.1r1/examples/sample/build/lib >> -Wl,-L/home/hamid/dpdk/dpdk-1.5.1r1/x86_64-default-linuxapp-gcc/lib >> -Wl,-L/home/hamid/dpdk/dpdk-1.5.1r1/x86_64-default-linuxapp-gcc/lib >> -Wl,-lrte_kni -Wl,-lrte_pmd_e1000 -Wl,-lrte_pmd_ixgbe -Wl,-lrte_mbuf >> -Wl,-lrte_cmdline -Wl,-lrte_timer -Wl,-lrte_hash -Wl,-lrte_lpm >> -Wl,--start-group -Wl,-lethdev -Wl,-lrte_malloc -Wl,-lrte_mempool >> -Wl,-lrte_ring -Wl,-lrte_eal -Wl,-ldl -Wl,--end-group > > Try CONFIG_RTE_BUILD_COMBINE_LIBS=y and -lintel_dpdk instead of all these > libraries. You can also remove the warning options if you want. > > You can also try to build your Makefile by including files like > mk/rte.extapp.mk and defining CC=g++. > I don't exactly know what is needed for C++. Please keep us informed. > > -- > Thomas >