win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key cheap Win 7 key win 7 professional Windows 7 key windows-7-ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key store Windows 7 Professional Product Key Windows-7-Ultimate-Product-Key windows-7-home-premium buy Windows 7 key Office-2013-key office-professional-plus-2013 Office-2010-key Office-2016-key windows 8 key windows-8-key-sale windows 8.1 key windows 8.1 product key windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key windows 7 home Windows 7 professional windows 7 pro windows 7 key Windows 7 professional windows 10 product key windows 10 key windows 8 key Windows 8.1 professional windows 8.1 pro office 2013 key office-2010 serial key office 2010 key windows 10 key windows 7 home premium windows 7 ultimate windows 8.1 key windows 8 professional windows 7 ultimate windows 7 key windows 7 home windows 7 activation key win 10 professional office 2010 key Windows 7 Product Key Windows 7 Key Windows 7 iso Windows 7 ultimate

Reflection with Java-style Annotations in C++ on Windows using Cygwin (Part 1 of 3)

Motivation

I wanted to have reflection with Java-style Annotations in my C++ Applications.  I didn’t want to use C++11 or anything fancy like that and I wanted to be able to take my existing, old C++ applications the way they were and to simply add reflection in the same cool way that my Java applications already have the capability to do so.  Additionally, I wanted my friends that exclusively use OS X or cygwin to be able to run my applications with reflection support as well.  So after a lot of time researching and testing on as many Virtual Machines and actual machines that I could get my hands on, here is a set of instructions that are current as of Tuesday, January 7th, 2014, which also happens to be my name day! (My name is John btw)

Part 1 – Windows via Cygwin

For part 1 of this article, I am including the instructions for running a sample application that takes advantage of C++ Reflection (with function Annotations) using the Cygwin 32-bit and 64-bit platforms.  If you are using a different platform you can skip to those instructions by following one of the links here:

  • Part 1: Cygwin (32-bit and 64-bit) (this article)
  • Part 2: Linux (Fedora Core 19, 32-bit and 64-bit)
  • Part 3: Mac OS X (Homebrew with Intel-based processors only)

Step 1

Install Cygwin with at a bare minimum the git and wget packages with all of their dependencies using the setup installer that you can download from www.cygwin.com.  During the installation process, select the following 2 packages:

  • All->Devel->git
  • All->Web->wget

Step 2

Install apt-cyg, a cool, command line based package manager for cygwin:

git clone git://github.com/GiannisRambo/apt-cyg.git
cd apt-cyg
chmod +x apt-cyg
cp apt-cyg /usr/local/bin
cd ..
rm -rf apt-cyg

Step 3

Using apt-cyg, install several required packages.

apt-cyg update
apt-cyg install make automake gcc-core gcc-g++ libtool ncurses util-linux cmake python

Step 4

Install GccXml

If you are running 32-bit Cygwin, you can build it yourself as there is no package available from the default Cygwin repositories, or you can follow the instructions to install it from the Cygwin Ports repository.

For more information about the gccxml project, visit the project homepage at: http://gccxml.github.io

git clone git://github.com/gccxml/gccxml.git
cd gccxml
mkdir gccxml-build
cd gccxml-build
cmake ..
make
make install
cd ../..
rm -rf gccxml

If you are running 64-bit Cygwin, you will have to download it from the Cygwin Ports project:

apt-cyg -m ftp://ftp.cygwinports.org/pub/cygwinports install gccxml

Step 5

Install Reflex (C++ Reflection Library developed at CERN)

git clone git://github.com/GiannisRambo/Reflex.git
cd Reflex
build/autogen
./configure --enable-minimal
make
make install

Step 6

Run Sample Reflection App

Now don’t go ahead and delete the Reflex git repository just yet.  In the forked version of this project which I have created, I have included a sample application that demonstrates reflection in it under the directory called “SampleReflectionApp.”  There is a simple Makefile in that directory, and the sample application checks for all annotated functions that reside in the MyClass class.  This should be enough for you to get started for now.  Good luck and have fun!

cd SampleReflectionApp
make
./SampleReflectionApp.exe

Motivation

I wanted to have reflection with Java-style Annotations in my C++ Applications.  I didn’t want to use C++11 or anything fancy like that and I wanted to be able to take my existing, old C++ applications the way they were and to simply add reflection in the same cool way that my Java applications already have the capability to do so.  Additionally, I wanted my friends that exclusively use OS X or cygwin to be able to run my applications with reflection support as well.  So after a lot of time researching and testing on as many Virtual Machines and actual machines that I could get my hands on, here is a set of instructions that are current as of Tuesday, January 7th, 2014, which also happens to be my name day! (My name is John btw)

Part 1 – Windows via Cygwin

For part 1 of this article, I am including the instructions for running a sample application that takes advantage of C++ Reflection (with function Annotations) using the Cygwin 32-bit and 64-bit platforms.  If you are using a different platform you can skip to those instructions by following one of the links here:

  • Part 1: Cygwin (32-bit and 64-bit) (this article)
  • Part 2: Linux (Fedora Core 19, 32-bit and 64-bit)
  • Part 3: Mac OS X (Homebrew with Intel-based processors only)

Step 1

Install Cygwin with at a bare minimum the git and wget packages with all of their dependencies using the setup installer that you can download from www.cygwin.com.  During the installation process, select the following 2 packages:

  • All->Devel->git
  • All->Web->wget

Step 2

Install apt-cyg, a cool, command line based package manager for cygwin:

git clone git://github.com/GiannisRambo/apt-cyg.git
cd apt-cyg
chmod +x apt-cyg
cp apt-cyg /usr/local/bin
cd ..
rm -rf apt-cyg

Step 3

Using apt-cyg, install several required packages.

apt-cyg update
apt-cyg install make automake gcc-core gcc-g++ libtool ncurses util-linux cmake python

Step 4

Install GccXml

If you are running 32-bit Cygwin, you can build it yourself as there is no package available from the default Cygwin repositories, or you can follow the instructions to install it from the Cygwin Ports repository.

For more information about the gccxml project, visit the project homepage at: http://gccxml.github.io

git clone git://github.com/gccxml/gccxml.git
cd gccxml
mkdir gccxml-build
cd gccxml-build
cmake ..
make
make install
cd ../..
rm -rf gccxml

If you are running 64-bit Cygwin, you will have to download it from the Cygwin Ports project:

apt-cyg -m ftp://ftp.cygwinports.org/pub/cygwinports install gccxml

Step 5

Install Reflex (C++ Reflection Library developed at CERN)

git clone git://github.com/GiannisRambo/Reflex.git
cd Reflex
build/autogen
./configure --enable-minimal
make
make install

Step 6

Run Sample Reflection App

Now don’t go ahead and delete the Reflex git repository just yet.  In the forked version of this project which I have created, I have included a sample application that demonstrates reflection in it under the directory called “SampleReflectionApp.”  There is a simple Makefile in that directory, and the sample application checks for all annotated functions that reside in the MyClass class.  This should be enough for you to get started for now.  Good luck and have fun!

cd SampleReflectionApp
make
./SampleReflectionApp.exe

2 Comments on “Reflection with Java-style Annotations in C++ on Windows using Cygwin (Part 1 of 3)

  1. Pingback: » Reflection with Java-style Annotations in C++ on Linux (Part 2 of 3) Quant Programmer

  2. Pingback: Gregory Smith

Leave a Comment