After upgrading juce to the latest, my application is no longer launching Juce GUI anymore. The C application was previously calling Juce from a pthread, and it worked. After upgrading, I received a compile error, until I implemented the new member for JUCEApplication::main. But now the GUI doesn’t launch.
Code:
//START_JUCE_APPLICATION (JUCEUCSniffApplication)
void *startUCSniffJUCEGUI(void *){
startJUCE();
return NULL;
}
int startJUCE ()
{
const char *argv[] = {"ucsniff.exe"};
//return JUCE_NAMESPACE::JUCEApplication::main (1, argv, new JUCEUCSniffApplication());
return JUCE_NAMESPACE::JUCEApplication::main (1, argv);
}
This line here:
return JUCE_NAMESPACE::JUCEApplication::main (1, argv, new JUCEUCSniffApplication());
Used to successfully launch Juce GUI because it was implemented in juce_amalgamated as:
int JUCEApplication::main (int argc, char* argv[],
JUCEApplication* const newApp)
{
The new juce_amalgamated only includes two implementations for main:
1)
int JUCEApplication::main (int argc, const char* argv[])
int JUCEApplication::main (const String& commandLine)
Is there any new implementation member that can still return the JUCEApplication* const newApp, so that a thread can successfully call Juce?
Using “START_JUCE_APPLICATION (JUCEUCSniffApplication)” isn’t an option because the C application already uses main() and there will be duplicate mains.