[dpdk-dev] Useful: Simple C++ program & Makefile

2014-04-29 Thread Hamid Ramazani
Hi, this post might be a little old, but there is point which might be really important for C++ developers using DPDK: C++, especially C++11, doesn't support "designated initializes" of C, instead of that you can use "memset" and set the instance of a struct/class to 0/NULL/nullptr and then you c

[dpdk-dev] Useful: Simple C++ program & Makefile

2014-01-10 Thread Dan Kan
I forgot to add that you will also need to add -D__STDC_LIMIT_MACROS because C99 standard specifies that limits such as INT8_MAX should only be defined if explicitly requested. Also with g++, you can no longer use non-trivial designated initializers which are used extensively throughout dpdk sample

[dpdk-dev] Useful: Simple C++ program & Makefile

2014-01-10 Thread Dan Kan
Hamid, I'm in the same situation as you in which I would like to write most of the application logic in C++. I was able to use CC=g++ by slightly modifying the makefiles in mk. I replaced all occurrences of "%.c" with "%.cc" using the following command. find . -name "*.mk" -exec sed -i 's/%\.c\([^

[dpdk-dev] Useful: Simple C++ program & Makefile

2014-01-10 Thread Hamid Ramazani
> 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