Hi all, i’m currently into a little app to pass messages from a usb serial device to a virtual Alsa midi port. While choosing the gui libs, i discovered Juce, and fell in love
I’m not a C++ programmer, but i would like to do it with Juce. I installed Juce, and made a sweet gui with The Jucer, very simple, just one .cpp and one .h. Then i took some software made with Juce from internet, and prepared a main.cpp to launch the gui. But i’m not able to compile, i searched some tutorial on how to start, but no success (just some readings from the chm manual).
If anyone could help, i’ll put my main.cpp here:
[code]//// File Ini ////
#include <juce/juce.h>
#include “MidiBang_ui.h”
using namespace std;
class mainWindow : public DocumentWindow
{
private:
MidiBang_ui* m_Mbang;
public:
mainWindow() : DocumentWindow (T("MidiBang"),
Colours::lightgrey,
DocumentWindow::minimiseButton | DocumentWindow::closeButton,
true)
{
m_Mbang = new MidiBang_ui();
setContentComponent(m_Mbang);
setVisible (true);
centreWithSize (600, 200);
DBG("Ventana principal mostrada");
}
void closeButtonPressed()
{
JUCEApplication::quit();
}
};
// Esta es la clase de la aplicación JUCE
class MidiBangApplication : public JUCEApplication
{
private:
mainWindow* m_MainWindow;
public:
void initialise (const String& commandLine)
{
m_MainWindow = new mainWindow();
}
void shutdown()
{
// código de limpieza (como destrutor)..
if (m_MainWindow != 0)
delete m_MainWindow;
}
const String getApplicationName()
{
return T("Virtual MIDI Keyboard");
}
const String getApplicationVersion()
{
return T("0.1");
}
bool moreThanOneInstanceAllowed()
{
return true;
}
};
START_JUCE_APPLICATION (MidiBangApplication)
//// File End ////[/code]
I try to compile with:
g++ main.cpp -o ./mb -DLINUX -ljuce -lX11 -lpthread -lfreetype -lasound -lXinerama -Wall
but so errors regarding GL appear (even when i’m not using openGL at all).
So i try to compile with:
g++ main.cpp -o ./mb -DLINUX -ljuce -lX11 -lpthread -lfreetype -lasound -lXinerama -lGL -Wall
and then the error is shorter, and it’s:
/tmp/ccjzm1iU.o: In function mainWindow::mainWindow()': main.cpp:(.text._ZN10mainWindowC1Ev[mainWindow::mainWindow()]+0xa1): undefined reference to
MidiBang_ui::MidiBang_ui()'
collect2: ld returned 1 exit status
So i run, just to see:
g++ -c MidiBang_ui.cpp -o MidiBang_ui.o
and then a large number of error appears, beginning with:
In file included from /usr/include/juce/src/juce_core/basics/juce_StandardHeader.h:68,
from /usr/include/juce/juce.h:43,
from MidiBang_ui.h:27,
from MidiBang_ui.cpp:25:
/usr/include/juce/src/juce_core/basics/juce_PlatformDefs.h:88:41: error: CoreServices/CoreServices.h: No existe el fichero o el directorio
(seems that CoreServices.h is not found, and it really doesn’t exist in my filesystem). I don’t post it all because it’s quite long.
I know this is not even a newbie question, more like C++, but i don’t know who to ask, and maybe any c++ samurai can help.
Thank you, bye!
Juan.
ps - i’m running a debian lenny