I’ve used Introjucer to create a project “JucePlay” under Linux, selecting my modules from a local JUCE GIT repo (as of yesterday) and configuring “Local JUCE folder” to point to it. All other Introjucer settings as default. But it doesn’t build:
make
Compiling MainComponent.cpp
In file included from ../../Source/MainComponent.h:12:0,
from ../../Source/MainComponent.cpp:9:
../../Source/../JuceLibraryCode/JuceHeader.h:21:18: error: ‘juce’ is not a namespace-name
../../Source/../JuceLibraryCode/JuceHeader.h:21:22: error: expected namespace-name before ‘;’ token
In file included from ../../Source/MainComponent.cpp:9:0:
../../Source/MainComponent.h:21:1: error: expected class-name before ‘{’ token
../../Source/MainComponent.h:27:17: error: ‘Graphics’ has not been declared
../../Source/MainComponent.h:32:71: error: ISO C++ forbids declaration of ‘JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR’ with no type [-fpermissive]
../../Source/MainComponent.h:32:71: error: expected ‘;’ at end of member declaration
../../Source/MainComponent.cpp: In constructor ‘MainContentComponent::MainContentComponent()’:
../../Source/MainComponent.cpp:15:22: error: ‘setSize’ was not declared in this scope
../../Source/MainComponent.cpp: At global scope:
../../Source/MainComponent.cpp:22:35: error: variable or field ‘paint’ declared void
../../Source/MainComponent.cpp:22:35: error: ‘Graphics’ was not declared in this scope
../../Source/MainComponent.cpp:22:45: error: ‘g’ was not declared in this scope
make: *** [build/intermediate/Debug/MainComponent_a6ffb4a5.o] Error 1
The generated Makefile doesn’t have any reference to my JUCE GIT repo or the modules within it and AppConfig.h is empty. I’m sure I could dive in to the Makefile and fix it but that would mean abandoning Introjucer which doesn’t seem right or desirable.
I’m sure this is newbie finger trouble but I can’t find the key bit of config / documentation to get me over this hurdle!
Directory layout (as exists under ~/workspace) attached. Jucer config and Makefile below.
Thanks in advance!
<?xml version="1.0" encoding="UTF-8"?>
<JUCERPROJECT id="oSJazw" name="JucePlay" projectType="guiapp" version="1.0.0"
bundleIdentifier="com.yourcompany.JucePlay" jucerVersion="3.1.0">
<MAINGROUP id="TJE0ql" name="JucePlay">
<GROUP id="{25948AE8-1E0C-BA16-2DDC-7E4016A37F05}" name="Source">
<FILE id="oB5Bpo" name="MainComponent.cpp" compile="1" resource="0"
file="Source/MainComponent.cpp"/>
<FILE id="teWPFI" name="MainComponent.h" compile="0" resource="0" file="Source/MainComponent.h"/>
<FILE id="F53Zu4" name="Main.cpp" compile="1" resource="0" file="Source/Main.cpp"/>
</GROUP>
</MAINGROUP>
<MODULES>
<MODULE id="juce_core" showAllCode="1" useLocalCopy="0"/>
<MODULE id="juce_events" showAllCode="1" useLocalCopy="0"/>
<MODULE id="juce_graphics" showAllCode="1" useLocalCopy="0"/>
<MODULE id="juce_data_structures" showAllCode="1" useLocalCopy="0"/>
<MODULE id="juce_gui_basics" showAllCode="1" useLocalCopy="0"/>
<MODULE id="juce_gui_extra" showAllCode="1" useLocalCopy="0"/>
<MODULE id="juce_gui_audio" showAllCode="1" useLocalCopy="1"/>
<MODULE id="juce_opengl" showAllCode="1" useLocalCopy="0"/>
</MODULES>
<EXPORTFORMATS>
<LINUX_MAKE targetFolder="Builds/Linux" juceFolder="~/workspace/JUCE/modules">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" libraryPath="/usr/X11R6/lib/" isDebug="1" optimisation="1"
targetName="JucePlay"/>
<CONFIGURATION name="Release" libraryPath="/usr/X11R6/lib/" isDebug="0" optimisation="3"
targetName="JucePlay"/>
</CONFIGURATIONS>
</LINUX_MAKE>
</EXPORTFORMATS>
<JUCEOPTIONS/>
</JUCERPROJECT>
# Automatically generated makefile, created by the Introjucer
# Don't edit this file! Your changes will be overwritten when you re-save the Introjucer project!
ifndef CONFIG
CONFIG=Debug
endif
ifeq ($(CONFIG),Debug)
BINDIR := build
LIBDIR := build
OBJDIR := build/intermediate/Debug
OUTDIR := build
ifeq ($(TARGET_ARCH),)
TARGET_ARCH := -march=native
endif
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -g -ggdb -O0
CXXFLAGS += $(CFLAGS)
LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -L/usr/X11R6/lib/
LDDEPS :=
RESFLAGS := -D "LINUX=1" -D "DEBUG=1" -D "_DEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
TARGET := JucePlay
BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
endif
ifeq ($(CONFIG),Release)
BINDIR := build
LIBDIR := build
OBJDIR := build/intermediate/Release
OUTDIR := build
ifeq ($(TARGET_ARCH),)
TARGET_ARCH := -march=native
endif
CPPFLAGS := $(DEPFLAGS) -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
CFLAGS += $(CPPFLAGS) $(TARGET_ARCH) -O3
CXXFLAGS += $(CFLAGS)
LDFLAGS += $(TARGET_ARCH) -L$(BINDIR) -L$(LIBDIR) -fvisibility=hidden -L/usr/X11R6/lib/
LDDEPS :=
RESFLAGS := -D "LINUX=1" -D "NDEBUG=1" -D "JUCER_LINUX_MAKE_7346DA2A=1" -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode
TARGET := JucePlay
BLDCMD = $(CXX) -o $(OUTDIR)/$(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(TARGET_ARCH)
endif
# (this disables dependency generation if multiple architectures are set)
DEPFLAGS := $(if $(word 2, $(TARGET_ARCH)), , -MMD)
OBJECTS := \
$(OBJDIR)/MainComponent_a6ffb4a5.o \
$(OBJDIR)/Main_90ebc5c2.o \
.PHONY: clean
$(OUTDIR)/$(TARGET): $(OBJECTS) $(LDDEPS) $(RESOURCES)
@echo Linking JucePlay
-@mkdir -p $(BINDIR)
-@mkdir -p $(LIBDIR)
-@mkdir -p $(OUTDIR)
@$(BLDCMD)
clean:
@echo Cleaning JucePlay
-@rm -f $(OUTDIR)/$(TARGET)
-@rm -rf $(OBJDIR)/*
-@rm -rf $(OBJDIR)
strip:
@echo Stripping JucePlay
-@strip --strip-unneeded $(OUTDIR)/$(TARGET)
$(OBJDIR)/MainComponent_a6ffb4a5.o: ../../Source/MainComponent.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling MainComponent.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
$(OBJDIR)/Main_90ebc5c2.o: ../../Source/Main.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling Main.cpp"
@$(CXX) $(CXXFLAGS) -o "$@" -c "$<"
-include $(OBJECTS:%.o=%.d)