title: Building Application Packages with multple packages and references in Mathematica
body: <p>I am building an application package in Mathematica. The application contains multiple packages and refers to other application packages </p>
  
  <p>To set everything up, I have used and followed the application packages instructions of the help section of workbench which is also available at:<a href="http://reference.wolfram.com/workbench/index.jsp?topic=/com.wolfram.eclipse.help/html/tasks/applications/introduction.html" rel="nofollow">http://reference.wolfram.com/workbench/index.jsp?topic=/com.wolfram.eclipse.help/html/tasks/applications/introduction.html</a>  under the <strong>Packages and Applications</strong> subsection but... </p>
  
  <ol>
  <li>I have implemented and tested single package application packages and the all seem to work fine.</li>
  <li>My Multiple packages and application is not working fine at this moment because of the following identified problems:
  a) the main package of the application calls functions implemented in the extra packages, but these function seem not to be recognized there. I have tried even to explicitly call them in the main package using the Needs command at the beginning of the package with no avail. *<em>What am I doing wrong?</em>*The extra packages are all in the application folder as the help directs to do.
  More specifically:</li>
  </ol>
  
  <p>The main package and the application are named OptMainFuncAll` so the main package OptMainFuncAll.m begins with </p>
  
  <pre><code>BeginPackage["OptMainFuncAll`"]
  </code></pre>
  
  <p>The extra packages  IntermFunct.m and VolCandExt.m begin with:</p>
  
  <pre><code>BeginPackage[ "OptMainFuncAll`IntermFunct`"]
  BeginPackage[ "QuadOptMainFuncAll`VolCandExt`"]
  </code></pre>
  
  <p><strong>Yet functions defined in IntermFunct.m and VolCandExt.m are are <em>unknown</em> when called for in 
  OptMainFuncAll.m</strong> -- <strong>What am I doing wrong?</strong></p>
  
  <p>Ihave even tried explicitly declaring</p>
  
  <pre><code>Needs[ "OptMainFuncAll`IntermFunct`"]
  Needs[ "QuadOptMainFuncAll`VolCandExt`"] 
  </code></pre>
  
  <p>at the beginning of OptMainFuncAll.m  and it has not solved my problem</p>
  
  <p>In addition I have made a reference to a second application package (BasicSym )and workbench shows it as referenced, but its functions also seem unknown in OptMainFuncAll.m .</p>
  
  <p>I have also tried beginning OptMainFuncAll.m with</p>
  
  <pre><code>  BeginPackage[{OptMainFuncAll`, BasicSym`}]
  </code></pre>
  
  <p>and it did not work; the console at run times returns the message:</p>
  
  <blockquote>
    <p>BeginPackage::cxt: Invalid context
    specified at position 1 in
    BeginPackage[{OptMainFuncAll<code>,
    BasicSym</code>}]. A context must consist of
    valid symbol names separated by and
    ending with `.   EndPackage::noctx: No
    previous context defined.</p>
  </blockquote>
  
  <p>I am sure I am making some stupid application package developer mistake, but I can't seem to put my hand on it.</p>
  
  <p>If you can just tell me the exact package declarations in BeginPackage[?] for the main package, the extra packages and the referenced packages with the names I provided here for everything to work smoothly, i'd greatly appreciate.</p>