Juce_application example: where's main()?


where’s the main function where do i write/add my code???

do i just add my stuff in HelloWorldContentComponent??
and if so, what about functions i have from another API written in C?
can i add these into the class? how?


i’m gonna stick to your audio plugin framework for now(although i must admit that i thought that Juce 1_40 was for that as well as stand alone apps :lol: :lol: )


ok here’s a new one:

totaly dont understand this…


nevermind i see the difference in paths. and if i’m not mistaken, there’s even a difference in file names!! :?: :?: :?:

so i tried fixing this in a text editor and it loads up now but i seem to be having a problem with my vst sdk and i already included it… [quote]fatal error C1083: Cannot open include file: ‘public.sdk/source/vst2.x/audioeffectx.h’: No such file or directory[/quote]

i put this path in my my Include and Source paths in MSVS’s options[quote]C:\Source\vst_sdk2_4_rev1\vstsdk2.4\public.sdk\source\vst2.x[/quote]


ok got it to build(vst) i should give myself more credit :lol:

but if someone could please tell me where i would stick my code in the regular juce i might want to use that in the future.


“where you would stick your code in the regular juce”?? Sorry, I don’t understand the question!


i mean if i wanted to keep the component there and have it do something besides display hello world. wuld, could i use that componint as “main()”


i mean if i wanted to keep the component there and have it do something besides display hello world. wuld, could i use that componint as “main()”


JUCE takes care of creating a main() for you. And in event driven UIs there’s no real concept of a main() in the way that you think of it in say a command line app.

main() basically creates the user interface and starts the event loop. After that the app just sits idle until some kind of event happens, for example the user clicking on something. or a timer triggering.

To create your app, just do what the hello world app does, but in the ctor of the top level component container[1] component just create the other controls that will be displayed to the user, and set their event handlers to do something useful.

For example, in helloworld, try adding a text button that when clicked changes the text from hello world to something else.

That’s the basis of your UI, and as such, of your whole application.

(things are a little different with audio plugs).

[1] the subtlety is important here as in many cases the top level container component will be your window, but some JUCE window classes require you to create a special container component that serves as your top level component.


very interesting. man i’m really wishing haydxn’s tutorial was working right about now. but i’m making plugins anyway so i dont even know if it’s the same thing. anyway. i’ll try and look deeper. and read all the comments thanks :slight_smile:


Someone has temporarily hosted the tutorial on their uni webspace (sorry, i forget who posted about it earlier - bookmarked!) It can be found here at the moment;



yup i got it thanks. but i think the files in messages.zip are outdated cause i get errors when i try to build it.