Programming using OTB is not always easy. However, even if the learning curve is steep at the beginning, it really worths it after you surpassed the initial difficulties.
This also applies when you’re writing a new OTB program. The hardest step is usually to get it to compile and once it compiles, it usually works (as opposed to standard C programs where it is usually easy to compile but hard to find subsequent errors). This is the advantage of using templates. The drawback is that compiler error message can be somewhat cryptic and hard to decipher.
In the wiki, we’ve started a page to help you find out common OTB compilation errors and corresponding solution. Do not hesitate to fill up this page with you experience and help your fellow OTB users.