Fail to compile juce on Code::Blocks (MinGW)


#1

I am attempting to compile the Dev-Cpp file on Code::Blocks, it goes along way, but I get these error messages:

D:\Development\Code Blocks\include\juce\src\juce_appframework\gui\graphics\colour…\colour\juce_PixelFormats.h:: In member function `juce::PixelARGB* juce::ColourGradient::createLookupTable(int&) const’:
D:\Development\Code Blocks\include\juce\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
D:\Development\Code Blocks\include\juce\src\juce_appframework\gui\graphics\colour\juce_ColourGradient.cpp:161: sorry, unimplemented: called from here
:: === Build finished: 2 errors, 0 warnings ===

Has anyone come accross this? I’d really like to compile this so’s I can get started on figuring this library out.


#2

Just remove the ‘forcedinline’ from ‘forcedinline void tween (const Pixel& src, const uint32 amount)’ in juce_PixelFormats.h at line 120.

I come across this one a while ago. AFAIR this doesn’t happen anymore if you use the latest GCC version 3.4.5 from MinGW.


#3

Ooh, I’ll hafta update, I was using 3.4.2. Hopefully that fixes it. If not then I’ll remove the forcedinline, thanks

Edit: For somereason, I was unable to install 3.4.5 tar.gz, ended up removing all those forcedinline like you instructed, and got it to compile. Thanks


#4

Did you try to install 3.4.5 manually? I used the installer program ( http://downloads.sourceforge.net/mingw/MinGW-5.1.3.exe ) and had no problems installing/updating MinGW to 3.4.5.


#5

The latest technology preview of GCC for mingw is 4.2.1 version.
Soon, it’s gonna be the latest stable release.
Time to think.


#6

I’m getting this forcedinline problem too. commenting out the line seems to work but there are lots of them and its taking forever to comment them out. I’m also woried abotu what will happen if a new version of juce comes out, will I have to go through all this hassle again?

I have tried installing a correct version of minigw. I used a bat script someone provided which checked the version

[code]@echo off
REM credit to Peter Ward work in ReactOS Build Environment RosBE.cmd it gave me a starting point that I edited.
::
:: Display the current version of GCC, ld, make and others.
::

REM %CD% works in Windows XP, not sure when it was added to Windows
REM set MINGWBASEDIR=C:\MinGW
set MINGWBASEDIR=%CD%
ECHO MINGWBASEDIR=%MINGWBASEDIR%
SET PATH=%MINGWBASEDIR%\bin;%SystemRoot%\system32
if exist %MINGWBASEDIR%\bin\gcc.exe (gcc -v 2>&1 | find “gcc version”)
REM if exist %MINGWBASEDIR%\bin\gcc.exe gcc -print-search-dirs
if exist %MINGWBASEDIR%\bin\c++.exe (c++ -v 2>&1 | find “gcc version”)
if exist %MINGWBASEDIR%\bin\gcc-sjlj.exe (gcc-sjlj.exe -v 2>&1 | find “gcc version”)
if exist %MINGWBASEDIR%\bin\gcc-dw2.exe (gcc-dw2.exe -v 2>&1 | find “gcc version”)
if exist %MINGWBASEDIR%\bin\gdb.exe (gdb.exe -v | find “GNU gdb”)
if exist %MINGWBASEDIR%\bin\nasm.exe (nasm -v)
if exist %MINGWBASEDIR%\bin\ld.exe (ld -v)
if exist %MINGWBASEDIR%\bin\windres.exe (windres --version | find “GNU windres”)
if exist %MINGWBASEDIR%\bin\dlltool.exe (dlltool --version | find “GNU dlltool”)
if exist %MINGWBASEDIR%\bin\pexports.exe (pexports | find “PExports” )
if exist %MINGWBASEDIR%\bin\mingw32-make.exe (mingw32-make -v | find “GNU Make”)
if exist %MINGWBASEDIR%\bin\make.exe (ECHO It is not recommended to have make.exe in mingw/bin)
REM ECHO "The minGW runtime version is the same as __MINGW32_VERSION"
if exist “%MINGWBASEDIR%\include_mingw.h” (type “%MINGWBASEDIR%\include_mingw.h” | find “__MINGW32_VERSION” | find “#define”)
if exist “%MINGWBASEDIR%\include\w32api.h” (type “%MINGWBASEDIR%\include\w32api.h” | find “__W32API_VERSION”)

:_end
PAUSE[/code]

which gave me the following results

C:\MinGW>miniGw.bat
MINGWBASEDIR=C:\MinGW
gcc version 3.4.5 (mingw-vista special r3)
gcc version 3.4.5 (mingw-vista special r3)
GNU ld version 2.17.50 20060824
GNU windres 2.17.50 20060824
GNU dlltool 2.17.50 20060824
GNU Make 3.81
#define __MINGW32_VERSION           3.15.1
#define __W32API_VERSION 3.12
Press any key to continue . . .

so this seems to me that I have the version 3.4.5 as suggested in this thread, however I still get the forcedinline errors

any suggestions?


#7

Use visual c++. Or somehow update mingw to use a compiler that was written this century.

I’m obviously a huge friend of open source and gnu stuff, but really, if you’re compiling win32 code on windows, mingw is just masochism.


#8

I fixed it. Go to src\juce_core\basics\juce_PlatformDefs.h, lines 342 to 353, and change…

[code]#else
/** A platform-independent way of forcing an inline function.

  Use the syntax: @code
  forcedinline void myfunction (int x)
  @endcode

*/
#ifndef JUCE_DEBUG
#define forcedinline inline attribute((always_inline))
#else
#define forcedinline inline
#endif
[/code]
to

[code]#else
/** A platform-independent way of forcing an inline function.

  Use the syntax: @code
  forcedinline void myfunction (int x)
  @endcode

*/

#define forcedinline inline
[/code]

This will build properly. However, it does remove any distinction between the Debug version and the Release version for inlining functions outside of MSVC, and does not force inlining in rather crucial processor heavy areas. I’m not too sure if this will make any major impact on the speed of the program, but I do know that it builds properly.


#9

I would just like to point out that Qt Creator is a fully featured (and free!) IDE that knocks the socks right off of Code:Blocks. Qt Creator uses MinGW as its back end so it does everything that Code:Blocks does, only it does it 20 times better.

You do not need to use the Qt libraries to build applications using Qt Creator.

Qt Creator has full support for SVN and other source control systems, a fantastic editor, slick interface, built in system for building projects (qmake/make) and a visual interface for managing files and changing settings.

Qt Creator is as close as you can get to using Microsoft Visual Studio without actually using Microsoft Visual Studio. Its debugger (visual front-end to Gdb) is also extremely usable.


#10

People need to give Eclipse CDT a chance. Its workflow is so much faster than other IDEs, I’ve tried switching to VC++ several times but it’s just too much to lose. Its shortcuts are unmatched outside of NetBeans and they are indispensable.


#11