Basic command line app for testing


#1

Hi JUCE folks, 

First of all thank you for this beautiful project. I'm trying to build a minimalistic command-line app, just to "kick the tires" of the library. My question: what headers should I include to gracefully compile the app? I don't want to display any GUI, just do some basic tests on the console (with a PluginListComponent, but that's another topic). Thanks in advance!


#2

Just build the Introjucer, run it and get it to create a Console app for you (it'll create the project files for your selected IDEs) - and a little main() .cpp file with everything you need

I think the only Juce modules you need (for a console app) are juce_core (of course!), juce_data_structures and juce_events. Here's my .jucer file

<?xml version="1.0" encoding="UTF-8"?>

<JUCERPROJECT id="NFt0LI" name="NewConsoleProject" projectType="consoleapp"
              version="1.0.0" bundleIdentifier="com.yourcompany.NewConsoleProject"
              includeBinaryInAppConfig="1" jucerVersion="3.1.0">
  <MAINGROUP id="pp8uGf" name="NewConsoleProject">
    <GROUP id="{34A6757B-465B-F250-CBB5-7F032695A44B}" name="Source">
      <FILE id="F1Adxp" name="Main.cpp" compile="1" resource="0" file="Source/Main.cpp"/>
    </GROUP>
  </MAINGROUP>
  <EXPORTFORMATS>
    <VS2013 targetFolder="Builds/VisualStudio2013">
      <CONFIGURATIONS>
        <CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit"
                       isDebug="1" optimisation="1" targetName="NewConsoleProject"/>
        <CONFIGURATION name="Release" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit"
                       isDebug="0" optimisation="2" targetName="NewConsoleProject"/>
      </CONFIGURATIONS>
      <MODULEPATHS>
        <MODULEPATH id="juce_events" path="J:/modules"/>
        <MODULEPATH id="juce_data_structures" path="J:/modules"/>
        <MODULEPATH id="juce_core" path="J:/modules"/>
      </MODULEPATHS>
    </VS2013>
  </EXPORTFORMATS>
  <MODULES>
    <MODULES id="juce_core" showAllCode="1" useLocalCopy="1"/>
    <MODULES id="juce_data_structures" showAllCode="1" useLocalCopy="1"/>
    <MODULES id="juce_events" showAllCode="1" useLocalCopy="1"/>
  </MODULES>
  <JUCEOPTIONS/>
</JUCERPROJECT>

Here's the Main.cpp that Introjucer created for me (does nothing, then finishes!)


/*

This file was auto-generated!

It contains the basic startup code for a Juce application.

==============================================================================
*/

#include “…/JuceLibraryCode/JuceHeader.h”

//==============================================================================
int main (int argc, char* argv[])
{

// ..your code goes here!

return 0;

}


#3

It seams to me that using the IntroJucer to start a new console app just to copy the project into a currently existing solution is a waste of time. There should be a VS project without a solution that you can just copy merge the ready to go console app into your project directory and then you just add that to your current solution. This wouldn't work on Mac with a special app because OS X is stupid and deson't copy merge by default and instead deletes the old folder (without warning you) and replaces it with the copy folder like a meglomaniac on setroids. Maybe there should be an insert console app into project feature.