Basic "starting point" tutorial code

Hi all, first post, looking forward to getting going with Juce but just need a bit of help to get a Juce project compiling.

Following haydxn’s guide, I’ve got to the stage where I’ve got only a handful of seemingly related bugs (7 in total, but they seem to stem from one in particular). I’m using Qt Creator, and have got ApplicationStartup.cpp, MainAppWindow.cpp and juce_amalgamated.h all in the same folder and in the same project (I edited out the references in the .cpp files to the other header files and replaced these with references to the amalgamated header file, got a lot fewer errors by doing this). When building the project Qt Creator references the code on line 57 of ApplicationStartup.cpp (MainAppWindow* theMainWindow;), mentioning the following error:

“F:/C++ Projects/JuceHelloWorld/ApplicationStartup.cpp:57: error: ISO C++ forbids declaration of ‘MainAppWindow’ with no type”

Any ideas on why this is happening? Do I need to compile MainAppWindow.cpp seperately before compiling the whole program? Thanks in advance. :mrgreen:

You’d be much better off starting from the projects in extras/example projects or the demo - haydxn’s tutorial code is way out of date now…

Okay, thanks jules, will follow your advice. The important thing for me is just to get something compiling as a proof of concept, I’d be learning Juce more in depth after this.

Juce Demo would be a good starting point.

You could also give this a try. http://code.google.com/p/juced/.

[quote=“vishvesh”]Juce Demo would be a good starting point.

You could also give this a try. http://code.google.com/p/juced/.[/quote]

Thanks for the advice vishvesh.

I’ll stay away from juced for the time being, want to start as basic as possible before looking into new classes.

Tried to compile the Juce demo, didn’t have any luck getting something working, I’m guessing that I’m doing something basic/fundamental wrong. Hopefully if I talk through the steps I took someone will pick up on what the issues are…

In Qt Creator, started new project (blank Qt project so that no files were included as standard), added following files to this project (note that all files were found in extras\juce demo\src):

Source files:
ApplicationStartup.cpp
BinaryData.cpp
juce_LibrarySource.cpp
MainDemoWindow.cpp

Header files:
BinaryData.h
juce_AppConfig.h
jucedemo_headers.h
MainDemoWindow.h

MM file:
juce_LibrarySource.mm

When I compiled I got 198 warnings and 47 errors.

Firstly, what are .mm files (a quick web search indicates the extension is used with mind map software)? I only tried to include juce_LibrarySource.mm in the project because it was with the rest of the files in extras\juce demo\src but I got the same amount of warnings and errors when I tried to compile without the .mm file, so I’m guessing it’s not needed for compilation?

Example errors included indicating I needed header files like crtdbg.h and comutil.h, which are Windows only header files. If these header files are so key to getting Juce compiling on Windows this would be good to indicate in a readme file.

Some more interesting errors occurred when I tried to included juce_amalgamated.cpp and juce_amalgamated.h in the project, for example the .cpp file contains…
// Auto-links to various win32 libs that are needed by library calls…
#pragma comment(lib, “kernel32.lib”)
#pragma comment(lib, “user32.lib”)

I seem to get errors for all of these statements.

Can someone please help me, this is really doing my nut in! Thanks in advance. :slight_smile:

Have these files been moved elsewhere? It looks like the domain in the links provided has expired. :frowning:

[Edit: Oops, I thought I was replying to the other thread with Hayden’s PDF and zip files. Ignore this post for now while I read thread too and try to catch up on what’s going on these days.]

Thanks

Thanks for taking time to help

Just wondering… is there any particular reason why the iOS/Mac (and Win/Linux, fwiw!) projects use the separate library mm files (JuceLibraryCode1.mm etc.), rather than the juce amalgamated mm/cpp file?

As I say - just wondering. :slight_smile:

Pete

For iOS, the reason is that the compiler crashes if you give it the full-size amalgamated file. For the others, it’s done that way because it makes it easier to debug code in the the library, because they directly include the individual cpp files instead of the amalgamated one.

Good grief! Is that true even for GCC 4.2 …? I shall have to try it. :slight_smile:

beeing a total noob to GUI programming I wonder why the Jucer is not available as a ready to use *.exe (for Win) or *.deb (for Ubuntu) ?

I’ve been reading a lot of pages and postings - but still can’t wrap my head around how to best get it started.

I downloaded the recommended Visual C++ Express and - wow, what a breeze - start it and get to work…
BUT - if to use that one to make some Juce GUI - how to integrate the Juce library - am I totally off ???
Anybody who can provide me a step by step guidance ?

I mean - beforehand of what is outlined in the tutorial regarding how to use Juice / the Juicer it should be stated what steps to take to set it up working - no??
Even better to have a *.exe / *.deb to install !

Best
Michael

Hello,

I am trying to get things working on Windows to be able to develop interfaces with the framework, however I’m getting a bit stuck with just the basic setup things.

The first thing I did was use the Jucer to generate a project for Visual Studio. IT did that smoothly and kept the default options in the jucer. So now I have my project setup in Visual Studio.

Under Juce Library Code I have the files:
AppConfig.h
JuceHeader.h
JuceLibraryCode1.cpp
JuceLibraryCode2.cpp
JuceLibraryCode3.cpp
JuceLibraryCode4.cpp

And under the Source Folder in my solution explorer I have the starting point files of this tutorial. Since a main.cpp starting file was already generated I just adjusted everything accordingly.

So I have in the Source folder:
MainComponent.h
MainAppWindow.h
MainAppWindow.cpp
Main.cpp (the starting file)

I try to compile and I get 1 error which is :
1>LINK : fatal error LNK1104: cannot open file ‘jucelib_static_Win32_debug.lib’

I did all the necessary configuration steps already but I can’t seem to figure out why this error is happening. Please if someone can lend me some guidance it would be deeply appreciated!

Thanks.

If you’re trying to build a plugin with yesterday’s tip, then sorry! There was a blooper in there which I’ve now fixed - grab the latest code and try again!

[quote=“jules”]If you’re trying to build a plugin with yesterday’s tip, then sorry! There was a blooper in there which I’ve now fixed - grab the latest code and try again!

I’m sorry not sure what you mean by grab the latest code. (If this is post was not related to my earlier compiling error, sorry!)
Do you mean download the framework again?

Yes, grab the latest version from GIT or by using the Introjucer.

Is there any recommended steps to take when setting up a project in IntroJucer for Visual Studio ?
I downloaded the latest code and everything and somehow keep getting the same error…

There should be a DONT_AUTOLINK_TO_JUCE_LIBRARY setting at the top of the juce_PluginHeaders.h file. If it’s not there, then you haven’t got the latest version.

…hmm, and this thread contains some extremely out-of-date posts that really shouldn’t be getting bumped, so I’m locking it - please start a more relevant thread if you still have trouble.