Quick post about problem which I already solved, but think that could be handy for someone else.
I have following code:
When compiling under Visual studio, everything is ok. But when try the same code snippet under g++, have following error:
This is because compiler doesn’t known FindByType method, because T2 is templated argument. The solution which I found is in adding keyword template before FindByType method name. So updated source code will look like this:
After this update, code will be compiled correctly under both compilers.
Compilation under Windows is possible only using MinGW and with few modifications in TENG code (because there is few glitch which didn't meet c++ standards). If you want more information or updated TENG version, please let me know.
Lots of open source libraries (like libiconv, libintl, ...) doesn't have MSVC project files or makefiles. Only supported way how to compile given library under Window is using MinGW and MSYS compiler tools.
Here is step-by-step guide how to download, install and compile libraries using MinGW.
Run downloaded executable. As install directory leave C:\MinGW. It's recommended not to change this path. On component screen select C compiler, C++compiler, MSYS Basic System and MinGW Developer Toolkit.
After that select next,next,next, finish ;-). After that installer downloads all necessary files. This could take a few minutes.
When installation is done, as next step is necessary to setup PATH variable to c:\MinGW. Installer doesn't modify it automatically. (more info about modifying PATH variable) .
Installing additional gcc compiler and make support
These two packages isn't listed in available components. If you wish to install it, use mingw-get-inst. In c:\MinGW\bin directory run following commands:
Step three compiling
Compiling from windows shell
Launch cmd tool, go to directory with source code and use g++.
Compiling from MinGW console
Launching MinGW console
Laung MinGW from startmenu or msys.bat from %INSTALL_PATH%\MinGW\msys\1.0\msys.bat.