How to Juce with Code::Blocks in Win 10

Hello there! I wanted to make sort of a “how to” Juce with code::blocks on windows 10, in the same time as looking into my problems.

Windows 10 is a fresh install, with all the new updates (14/9/19).
Code::Blocks is V. 17.12
JUCE is up to date (14/9/19)

  1. I downloaded juce from and unpacked on my desktop
  2. I launched the projucer to create a new code::blocks project
  3. My first issue was the unpacked folder on the desktop, Juce won’t accept it as a valid path, I then moved the folder to C:Juce which fixed this issue
  4. I tryed to compile into code::blocks ( I had mingw32 installed), but code::blocks complained about the compiler
  5. I downloaded mingw64 and installed
  6. In code::blocks/settings/compiler, in the toolchain executables, I changed the compiler’s installation directory to mingw-w64, the C compiler to the equivalent 64,… and so on.
  7. I tryed to compile again, but now I’m getting various errors (this is where my how to stops, and your help is required!!)

My first warning message: multi-character character constant [-Wmultichar]/ should I use this flag to compile?

My first error message: Fatal error: can’t write 342 bytes to section .text of obj\Debug\Users\Administrator\Desktop\pgjuce\JuceLibraryCode\include_juce_gui_basics.o: ‘File too big’

I have no idea how to fix this one.

My second error message:Fatal error: can’t close obj\Debug\Users\Administrator\Desktop\pgjuce\JuceLibraryCode\include_juce_gui_basics.o: File too big

I believe this one is related to the previous one, can anyone help me complete this “how to”/“help me”?

Although this might not be what you want to hear, may I ask why you want to use Code::Blocks at all when you have the option to get Visual Studio – which works out of the box and which is so much better to use – for free?

Afaik the Code::Blocks exporter exists mostly for legacy reasons and is used by nearly no one for serious development

1 Like

I would also recommend using Visual Studio, I have also used CodeBlocks (not for JUCE) before, but it is no where near as reliable, feature-rich & stable as VS.

If yo have never used it, here is a good introduction/setup video: How to Setup C++ on Windows

1 Like

Thank you for your answers! I can’t install VS on my computer for some reason, it’s a fresh install of win10 pro. Each time I try to install VS, it says “can’t update” or “can’t start the installer”, I then try manually, but it stops itself after just some seconds. I downloaded .net, vc++,… but nothing fixed it. I used code:blocks for a while so I thought I might try Juce with it. Arg, it’s been 3 days I couldn’t even write a line of code, that’s frustrating.

Should I try an older version of visual studio, will it work with the latest Juce?

Maybe you guys can help me with the issue I have with VS. It first stops at

unable to acquire updated visual studio installer (this problem occurs when the installer on your machine is the same or lower than the version to update)…

which is weird, since I didn’t have VS before, I then tryed to delete the microsoft VS folder I found, and there was no microsoft VS installed though.

second stop at

Unable to launch the installer. Error: could not load file or assembly 'system runtime serialisation, version =, culture = neutral, … or one of its dependencies…

Which led me to install the .net framework, didn’t work though.

I’d like to know if there’s an answer to the original question.
Since ProJucer supports CodeBlocks, it’d be nice to have it work on Windows.
I have a large project (CSL) that runs on several platforms, but expects a standards-compliant C+±11 compiler, so I can’t use VisualStudio out of the box.
Is there any solution to building JUCE on Windows with CodeBlocks, Cygwin, or any other toolchain that uses a standards-compliant C compiler???

Projucer has a “Code::Blocks (Windows)” exporter, and the JUCE code can be built using MinGW on Windows. So it is possible without any extra “solution”.

If you encounter specific problems, especially compiler/linker errors, let me know and I’ll be happy to help you.

Hey Thanks for the offer!
I managed to get the app to compile and link on CodeBlocks on Windows10; there’s a simple flag to get around the “too big” problem, but the resulting executable doesn’t execute.
First it got all sorts of “DLL not found” start-up errors, and even after I statically linked everything, it crashes on startup.
Can you get the JUCE demo to build and run using CodeBlocks or Cygwin/mingw?

Huh? Visual Studio got full C++11 support 5 years ago. And it now even supports use of Clang as its compiler if you want to.

I guess I have to learn how to install new toolchains in VisualStudio. The standard install gives you the option of using the C++14 or C++17 standards. (I did say I can’t use VisualStudio “out of the box” for the build…)
Is there an experienced VisualStudio developer who can point me to instructions?
I’m currently re-installing it and adding different tools, but I didn’t see C++11 (or POSIX libraries) on the list.

Unfortunately there is no way to select C++11 in Visual Studio. The /std compiler flag was introduced in Visual Studio 2017, but it can’t only be used with c++14, c++17, and c++latest (which is currently a partial implementation of C++20).

Do you really have to use C++11? Wouldn’t it work with C++14?

There are several callback function prototypes of the form,
int (VoidFcnPtr * func, void * args);
which are used like,
VoidFcnPtr * mFunc;
for CSL’s cross-platform thread support.
The MS compiler rejects this.
Any ideas?

Looks like some unusual syntax to me. I found
typedef void * VoidFcnPtr(void * arg); ///< the generic void fcn pointer
in CSL.

Side info first: Just found it when searching for VoidFcnPtr on Google right now, never used it and don’t really know what it does.

However, what does this line do? Typedefing a function pointer to a function that returns void and takes one void* pointer argument? The usual syntax for this as I know it and have seen a lot out in the wild would be

typedef void (*VoidFcnPtr) (void*);

If the syntax found in your codebase is something I just have never seen before but totally valid C and maybe does something different then I assume from the limited context, then please excuse my comment, otherwise, does it help to change the typedef to my proposed version?

Thanks; I got it working under VS19!

1 Like