juce_1_50 & wx-devcpp Compile Problems

Hi Guys,

I have downloaded JUCE 1.5 source from the repository and am try to build it using wx-devcpp (higher version of Dev CPP). Unfortunately, I am running into errors and not able to build it. When I access the JUCE/BUILD directory, I do not see specific make file for DEV CPP. Using wx-DevpCpp, I imported the VC6 .dsp) file and tried the build, unfortunatly, this also failed. I run Win XP and wx-devcpp for building my C++ application. I would really appritiate if someone could help me build the JUCE application.

You could try actually explaining what happened… Just saying it “failed” doesn’t really help much.

Ok, here is what I did and the errors follow:

  • I import the VC6 file (.\juce\build\win32\vc6\JUCE.dsp)
  • I get this error:
  • I had to change the build type:
  • The files seems to have been added the the project repository:
  • Here is the compile log:

../../../src/juce_appframework/gui/graphics/colour/../colour/juce_PixelFormats.h: In member function `juce::PixelARGB* juce::ColourGradient::createLookupTable(int&) const':
../../../src/juce_appframework/gui/graphics/colour/../colour/juce_PixelFormats.h:120: sorry, unimplemented: inlining failed in call to 'void juce::PixelARGB::tween(const Pixel&, juce::uint32) throw () [with Pixel = juce::PixelARGB]': function body not available
../../../src/juce_appframework/gui/graphics/colour/juce_ColourGradient.cpp:161: sorry, unimplemented: called from here
mingw32-make.exe: *** [Default Profile/juce_ColourGradient.o] Error 1

Execution terminated

The compile problem has been discussed several times before in the forum. Like the error says, mingw doesn’t handle the ‘forcedinline’ directive - just remove it or replace it with ‘inline’.

I go now get away with that error. I did a replace of forcedinline with inline and then could gect away with many. Thanks to you.

Now these errors:

../../../src/juce_appframework/gui/components/keyboard/../keyboard/../../../application/../gui/components/../graphics/effects/../../graphics/contexts/../fonts/juce_Font.h:361: error: type `juce::Typeface' is not derived from type `juce::Font'
../../../src/juce_appframework/gui/components/keyboard/../keyboard/../../../application/../gui/components/../graphics/effects/../../graphics/contexts/../fonts/juce_Font.h:361: error: ISO C++ forbids declaration of `Ptr' with no type
../../../src/juce_appframework/gui/components/keyboard/../keyboard/../../../application/../gui/components/../graphics/effects/../../graphics/contexts/../fonts/juce_Font.h:361: error: expected `;' before "typeface"

mingw32-make.exe: *** [Default Profile/juce_KeyMappingEditorComponent.o] Error 1

Execution terminated

From file juiceFont.h, code:

Try the tip code. I can’t really help unless you can give me references to the same version of juce that I’m using.

I need some more clue :(. I am using Juce 1.5 , latest download version.
Ok, am not clear as to what ‘Tip Code’ you are refering to. Neverthelss, the error points here:

File: juce_Font.h:
mutable Typeface::Ptr typeface;

I checked the juce_Typeface.h and found this line:
typedef ReferenceCountedObjectPtr Ptr;

ERROR:
"361 C:\Dev-Cpp\examples\juce\src\juce_appframework\gui\graphics\fonts\juce_Font.h type juce::Typeface' is not derived from type juce::Font’ "

So the type ‘Ptr’ is avaiable, not sure as to why the compiler is stopping here. The error shows is:
ISO C++ forbids declaration of Ptr' with no type expected ;’ before “typeface”

Complete Error:

I mean the GIT tip from sourceforge. There are plenty of links about how to get it on the website and in the forum.

Please do NOT bother posting code or bug reports from a version that’s more than a few days old. It’s a waste of everybody’s time, because the bug may no longer exist.

Hi jules ,

I am very suprised by your statement! I though ‘Forum’ was supposted to be a place where I can post my queries and get answers for the same. Probably this is the only ‘Forum’ in the whole of internet that suggest not to discuss problems :(.

I am very very disapointed!

Jules, if not you, is there anyone else who can help me? Btw, I have rectified all the errors, I had posted! Now I am having very few errors, the build went up to 90%+, so may be thse minor fixes, if resolved, will build my lib.

I cant find crtdbg.h and comutil.h, amonst the standard INCLUDES. I am using DevCPP verison compiler (MingW). Any help?

dj,

Jules is not asking you not to post problems, but not to post problems for anything but the latest version of the code. ie. IF you have a problem, make sure you are using the latest version of JUCE before posting a question about it.

[quote=“cpr”]dj,

Jules is not asking you not to post problems, but not to post problems for anything but the latest version of the code. ie. IF you have a problem, make sure you are using the latest version of JUCE before posting a question about it.[/quote]

Hmm, my subject does mention that I am using Juce 1.5 and my previous post: Dev CPP on Win XP! What mor can I say? Plus, sourceforge shows Juce 1.5 to be the latest. Is there any newer version?

try to use this version of mingw (gcc 4.4.1), cause i think your version of devcpp uses gcc 3.4.6 (which is a lot outdated):

http://www.tdragon.net/recentgcc/

with some minor changes i’m able to compile juce straight away. i’ve already sent the changes to Julian so i hope he will update the trunk with those (and let us compile on mingw straight away with no changes on the library).

Read this:
http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=4172

Hello,

I have a similar problem with MinGW (gcc 4.4.1) and the latest GIT version as from yesterday. I’m trying to compile the library using CodeBlocks. I had to fix the C::B project included in the library (\build\win32\codeblocks\juce.cbp) as it was not referencing the files properly (the file locations changed since version 1.50).

Everything compiles perfectly except the file native\windows\juce_win32_WebBrowserComponent.cpp, which is included from native\juce_win32_NativeCode.cpp. Here’s the build log:

[code]-------------- Build: Debug in Juce Library ---------------

Compiling: …\src\native\juce_win32_NativeCode.cpp
In file included from E:\Djs2010\juce\src\native\juce_win32_NativeCode.cpp:90:
E:\Djs2010\juce\src\native\windows/juce_win32_Files.cpp: In member function ‘const juce::String juce::File::getVersion() const’:
E:\Djs2010\juce\src\native\windows/juce_win32_Files.cpp:541: warning: deprecated conversion from string constant to 'WCHAR*'
In file included from E:\Djs2010\juce\src\native\juce_win32_NativeCode.cpp:92:
E:\Djs2010\juce\src\native\windows/juce_win32_PlatformUtils.cpp: In function ‘HKEY__* juce::findKeyForPath(juce::String, bool, juce::String&)’:
E:\Djs2010\juce\src\native\windows/juce_win32_PlatformUtils.cpp:59: warning: deprecated conversion from string constant to 'WCHAR*'
In file included from E:\Djs2010\juce\src\native\juce_win32_NativeCode.cpp:102:
E:\Djs2010\juce\src\native\windows/juce_win32_WebBrowserComponent.cpp: In member function ‘void juce::WebBrowserComponentInternal::goToURL(const juce::String&, const juce::StringArray*, const juce::MemoryBlock*)’:
E:\Djs2010\juce\src\native\windows/juce_win32_WebBrowserComponent.cpp:82: error: ‘_variant_t’ was not declared in this scope
E:\Djs2010\juce\src\native\windows/juce_win32_WebBrowserComponent.cpp:82: error: expected ‘;’ before 'flags’
E:\Djs2010\juce\src\native\windows/juce_win32_WebBrowserComponent.cpp:85: error: ‘headersVar’ was not declared in this scope
E:\Djs2010\juce\src\native\windows/juce_win32_WebBrowserComponent.cpp:107: error: ‘postDataVar’ was not declared in this scope
E:\Djs2010\juce\src\native…/application/…/gui/components/juce_Component.h:2056: error: ‘juce::Component::ComponentFlags juce::Component::::flags’ is private
E:\Djs2010\juce\src\native\windows/juce_win32_WebBrowserComponent.cpp:113: error: within this context
E:\Djs2010\juce\src\native\windows/juce_win32_WebBrowserComponent.cpp:113: error: ‘frame’ was not declared in this scope
E:\Djs2010\juce\src\native\windows/juce_win32_WebBrowserComponent.cpp:114: error: ‘postDataVar’ was not declared in this scope
E:\Djs2010\juce\src\native\windows/juce_win32_WebBrowserComponent.cpp:114: error: ‘headersVar’ was not declared in this scope
Process terminated with status 1 (0 minutes, 3 seconds)
9 errors, 2 warnings
[/code]
If I comment out the reference to juce_win32_WebBrowserComponent.cpp in juce_win32_NativeCode.cpp (line 102), then the entire library compiles and builds properly.

Any ideas? Maybe these minor changes made by kraken would fix the problem?
Thank you!

no you connot build the WebBrowserComponent with mingw at the time (i don’t even know if it can be fixed somehow).

just disable it by defining:

before including the amalgama.

Well… the fact is that actually I’ve been able to compile the WebBrowserComponent with MinGW!

The problem was the _variant_t type, which is a MS-specific wrapper class for managing the VARIANT type. The entire _variant_t class is implemented inline in VC’s comutil.h file. So all I had to do is changing _variant_t with VARIANT and adding the appropiate function calls to manage the VARIANT variables to reproduce the behavior of the _variant_t class.

File juce_win32_WebBrowserComponent.cpp, method WebBrowserComponentInternal::goToURL

Original code:

            _variant_t flags, frame, postDataVar, headersVar;

            if (headers != 0)
                headersVar = (const tchar*) headers->joinIntoString ("\r\n");

New code:

            VARIANT flags, frame, postDataVar, headersVar;

            VariantInit (&flags);
            VariantInit (&frame);
            VariantInit (&postDataVar);
            VariantInit (&headersVar);

            if (headers != 0)
            {
                V_VT (&headersVar) = VT_BSTR;
                V_BSTR (&headersVar) = SysAllocString ((const tchar*)headers->joinIntoString ("\r\n"));
            }

...(rest of the method)....

            VariantClear (&flags);
            VariantClear (&frame);
            VariantClear (&postDataVar);
            VariantClear (&headersVar);

With this change the entire library builds like a charm in both Debug and Release targets. I’ve made a couple of minor additional changes in other win32 files in order to remove two warnings. Now the I have a completely clean build of the latest JUCE with MinGW in CodeBlocks.

Note: I’m not using the amalgamated version because I want to easily move around the source code when debugging applications.

I also have the updated juce.cbp project file for building the library in CodeBlocks. If you’d like to add it to the JUCE trunk (it’s outdated there), please let me know how to contribute :slight_smile:

Ok, thanks for that, that seems like a sensible change to add!

You don’t have to use the library version to be able to debug, you know? Just include the template rather than the big amalg file - see the comments in the juce_LibrarySource.cpp files.

aahhh, good point! I was thinking on the big file from the version 1.50.
BTW, I’ve compiled the JUCE demo also with MinGW / C::B and the browser component seems to work perfect.

good catch ! i was so lazy to try to fix it :smiley: