# Code::Blocks

**URL:** <https://forum.juce.com/t/code-blocks/10206>\
**Category:** General JUCE discussion\
**Created:** [March 28, 2013, 10:03pm UTC](https://forum.juce.com/t/code-blocks/10206 "2013-03-28T22:03:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 28, 2013, 10:03pm UTC](https://forum.juce.com/t/code-blocks/10206/1 "2013-03-28T22:03:13Z")

</div>

To my intense annoyance I’ve wasted several days failing to get the projucer to link with llvm/clang on Windows, due to all sorts of VC++ nastiness. As a result I’ve decided to spend a few hours trying plan B, which is to switch to a MINGW build instead of VC…

So, to make that happen, I’ve quickly thrown together an Code::Blocks export target for the Introjucer. I’ve never been a fan of Code::Blocks, but I know that some people have talked about using it, so I’d really appreciate anyone who’s experienced with it trying this out. I’ve managed to build the juce demo with it, and it all seems to work… Feedback appreciated!

---

<div class="post-metadata">

**Author:** ![Bruce\_Wheaton](https://avatars.discourse-cdn.com/v4/letter/b/71c47a/32.png) [@Bruce\_Wheaton](https://forum.juce.com/u/Bruce_Wheaton)\
**Post date:** [March 29, 2013, 5:40am UTC](https://forum.juce.com/t/code-blocks/10206/2 "2013-03-29T05:40:10Z")

</div>

I’m doing all my Linux work in CodeBlocks, and it’s pretty useful. Remote debugging is fine, and some code completion, and a reasonable debugger once you get used to how stripped down it is.

Not a good time for a juce update, but I’ll try in a few weeks.

Bruce

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 29, 2013, 8:46am UTC](https://forum.juce.com/t/code-blocks/10206/3 "2013-03-29T08:46:56Z")

</div>

I’ve only targeted a Windows build, but it’d be interesting to make it cross-platform… How does a Code::Blocks project work in terms of different platforms needing different libraries and settings?

---

<div class="post-metadata">

**Author:** ![atom](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/atom/32/113_2.png) [@atom](https://forum.juce.com/u/atom)\
**Post date:** [March 31, 2013, 8:29pm UTC](https://forum.juce.com/t/code-blocks/10206/4 "2013-03-31T20:29:51Z")

</div>

Two things that i had to “fix” to get CodeBlocks to work (i need it know since i have a PC with Win7 and no admin right at work).

1. it’s the chicken and the egg thing, there is no Codeblocks project in the GIT so i can’t build Introjucer to get other projects built with CB
2. I had to add winmm to the library list to get the timeGetTime symbol to resolve

so far i got the Introjucer to build (using a Introjucer.exe i copied from a different PC) and I got a test standalone project created in Introjucer to build.

I’m using latest MINGW with gcc 4.7.2 and the latest nightly build of Codeblocks i found on the forums on their website.

Edit.

I get an error when building my own application, i saw this when i was using codelite

```auto
..\..\..\Standalone\JuceLibraryCode\modules\juce_audio_processors\..\..\..\..\..\Juce\modules\juce_audio_processors\..\juce_gui_basics\..\juce_graphics\colour\..\images\..\contexts\juce_GraphicsContext.h|30|fatal error: ../geometry/juce_Rectangle.h: No such file or directory|
```

It’s like GCC is not using relative paths correctly, this is how the file is compiled

```auto
mingw32-g++.exe -Wall -O0 -std=gnu++0x -march=pentium4 -D __MINGW__ =1 -D__MINGW_EXTENSION= -DCTRLR_NIGHTLY=1 -DJucePlugin_Build_Standalone= -DJUCER_CODEBLOCKS_34295A7F=1 -march=prescott -I. -I..\..\..\Standalone\JuceLibraryCode -I..\..\..\..\Boost -I..\..\..\..\Source\Lua\luabind -I..\..\..\..\Source\Misc -I..\..\..\..\Source\MIDI -I..\..\..\..\Source -I..\..\..\..\Source\UIComponents -I..\..\..\..\Source\Core -I..\..\..\..\Source\Plugin -I..\..\..\..\Source\Application -I..\..\..\..\Source\Lua -I..\..\..\..\Source\Lua\lua -Ic:\mingw\lib\gcc\mingw32\4.7.2\include\c++ -Ic:\mingw\lib\gcc\mingw32\4.7.2\include\c++\mingw32 -Ic:\mingw\lib\gcc\mingw32\4.7.2\include -c C:\devel\ctrlr\Source\Core\CtrlrIDManager.cpp -o obj\Debug\Source\Core\CtrlrIDManager.o
In file included from ..\..\..\Standalone\JuceLibraryCode/modules/juce_audio_processors/../../../../../Juce/modules/juce_audio_processors/../juce_gui_basics/../juce_graphics/colour/../images/juce_Image.h:30:0,
                 from ..\..\..\Standalone\JuceLibraryCode/modules/juce_audio_processors/../../../../../Juce/modules/juce_audio_processors/../juce_gui_basics/../juce_graphics/colour/juce_FillType.h:30,
                 from ..\..\..\Standalone\JuceLibraryCode/modules/juce_audio_processors/../../../../../Juce/modules/juce_audio_processors/../juce_gui_basics/../juce_graphics/juce_graphics.h:80,
                 from ..\..\..\Standalone\JuceLibraryCode/modules/juce_audio_processors/../../../../../Juce/modules/juce_audio_processors/../juce_gui_basics/juce_gui_basics.h:29,
                 from ..\..\..\Standalone\JuceLibraryCode/modules/juce_audio_processors/../../../../../Juce/modules/juce_audio_processors/juce_audio_processors.h:29,
                 from ..\..\..\Standalone\JuceLibraryCode/modules/juce_audio_processors/juce_audio_processors.h:4,
                 from ..\..\..\Standalone\JuceLibraryCode/JuceHeader.h:20,
                 from C:\devel\ctrlr\Source\Core\stdafx.h:74,
                 from C:\devel\ctrlr\Source\Core\CtrlrIDManager.cpp:1:
..\..\..\Standalone\JuceLibraryCode/modules/juce_audio_processors/../../../../../Juce/modules/juce_audio_processors/../juce_gui_basics/../juce_graphics/colour/../images/../contexts/juce_GraphicsContext.h:30:40: fatal error: ../geometry/juce_Rectangle.h: No such file or directory
compilation terminated.
Process terminated with status 1 (0 minutes, 3 seconds)
1 errors, 0 warnings (0 minutes, 3 seconds)
```

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 31, 2013, 10:36pm UTC](https://forum.juce.com/t/code-blocks/10206/5 "2013-03-31T22:36:50Z")

</div>

Thanks, I’ll post another version shortly, and will add a C::B project for the introjucer.

I seem to remember there used to be some kind of stupid length limit on the include paths… Maybe that’s what you’re hitting?

---

<div class="post-metadata">

**Author:** ![atom](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/atom/32/113_2.png) [@atom](https://forum.juce.com/u/atom)\
**Post date:** [April 1, 2013, 1:13pm UTC](https://forum.juce.com/t/code-blocks/10206/6 "2013-04-01T13:13:49Z")

</div>

I think it’s too many relative paths the “Local JUCE folder” setting in Introjucer was set to “…/…/Juce”, once i set it to “c:\devel\juce” it works

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 1, 2013, 1:22pm UTC](https://forum.juce.com/t/code-blocks/10206/7 "2013-04-01T13:22:02Z")

</div>

> [@atom](#):
>
> I think it’s too many relative paths the “Local JUCE folder” setting in Introjucer was set to “…/…/Juce”, once i set it to “c:\devel\juce” it works

They’re still using fixed-length strings in 2013!? Unbelievable!

---

<div class="post-metadata">

**Author:** ![ccortiz](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@ccortiz](https://forum.juce.com/u/ccortiz)\
**Post date:** [April 1, 2013, 2:10pm UTC](https://forum.juce.com/t/code-blocks/10206/8 "2013-04-01T14:10:17Z")

</div>

MinGW is a good compiler and C::B is a nice IDE, but lot of people use Eclipse-CDT + MinGW as develop enviroment.  
Would be nice to see an Introjucer exporter for Eclipse.  
Regards

---

<div class="post-metadata">

**Author:** ![atom](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/atom/32/113_2.png) [@atom](https://forum.juce.com/u/atom)\
**Post date:** [April 4, 2013, 8:22am UTC](https://forum.juce.com/t/code-blocks/10206/9 "2013-04-04T08:22:16Z")

</div>

There seems to be an issue in the latest tip:

```auto
inline GUID uuidFromString (const char* const s) noexcept
{
    unsigned long p0;
    unsigned int p1, p2, p3, p4, p5, p6, p7, p8, p9, p10;

    sscanf_s (s, "%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
              &p0, &p1, &p2, &p3, &p4, &p5, &p6, &p7, &p8, &p9, &p10);

    GUID g = { p0, (uint16) p1, (uint16) p2, { (uint8) p3, (uint8) p4, (uint8) p5, (uint8) p6,
                                               (uint8) p7, (uint8) p8, (uint8) p9, (uint8) p10 }};
    return g;
}
```

sscanf\_s() is not in MinGW, you can use sscanf() and it works

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 4, 2013, 10:49am UTC](https://forum.juce.com/t/code-blocks/10206/10 "2013-04-04T10:49:25Z")

</div>

ok, thanks - will check that.

---

<div class="post-metadata">

**Author:** ![myhrman](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@myhrman](https://forum.juce.com/u/myhrman)\
**Post date:** [April 4, 2013, 1:20pm UTC](https://forum.juce.com/t/code-blocks/10206/11 "2013-04-04T13:20:22Z")

</div>

It would be great if we could have a MinGW Makefile export target as well, so you could build from command line in MinGW environment. That would also make it easier to integrated with Eclipse as well (makefile project type in Eclipse).

---

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [April 7, 2013, 9:41am UTC](https://forum.juce.com/t/code-blocks/10206/12 "2013-04-07T09:41:53Z")

</div>

A MinGW Makefile export target would mean a whole load of extra IDEs could be used. This would be really great!

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 7, 2013, 9:47am UTC](https://forum.juce.com/t/code-blocks/10206/13 "2013-04-07T09:47:14Z")

</div>

I shall leave that as an exercise for you lot, no time to do it myself!

---

<div class="post-metadata">

**Author:** ![silveur](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/silveur/32/128_2.png) [@silveur](https://forum.juce.com/u/silveur)\
**Post date:** [April 19, 2013, 9:54am UTC](https://forum.juce.com/t/code-blocks/10206/14 "2013-04-19T09:54:16Z")

</div>

A CodeBlocks exporter for the Introjucer would also make me really happy 🙂

---

<div class="post-metadata">

**Author:** ![sanyaade](https://avatars.discourse-cdn.com/v4/letter/s/c67d28/32.png) [@sanyaade](https://forum.juce.com/u/sanyaade)\
**Post date:** [April 21, 2013, 7:30am UTC](https://forum.juce.com/t/code-blocks/10206/15 "2013-04-21T07:30:00Z")

</div>

Hello Everyone,

I was trying to compile the introjucer in CodeBlocks with the included project file and I having the the following build error:

```auto
||=== The Introjucer, Debug ===|
C:\APPLICATIONS\juce\modules\juce_core\native\juce_win32_Network.cpp||In function 'void juce::MACAddressHelpers::getViaNetBios(juce::Array<juce::MACAddress, juce::DummyCriticalSection, 0>&)':|

C:\APPLICATIONS\juce\modules\juce_core\native\juce_win32_Network.cpp|379|error: no matching function for call to 'zerostruct(juce::MACAddressHelpers::getViaNetBios(juce::Array<juce::MACAddress, juce::DummyCriticalSection, 0>&)::ASTAT&)'|

||=== Build finished: 1 errors, 0 warnings ===|

```

the error: no matching function for call to zerostruct(juce::MACAddressHelpers::getViaNetBios(juce::Array\<juce::MACAddress, juce::DummyCriticalSection, 0\>&)::ASTAT&)

in the file: juce\modules\juce\_core\native\juce\_win32\_Network.cpp

Any help and pointer will be well appreciated. Many thanks!

God blesses!!!

Best regards,  
Sanyaade

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 21, 2013, 8:32am UTC](https://forum.juce.com/t/code-blocks/10206/16 "2013-04-21T08:32:32Z")

</div>

[quote=“sanyaade”]Hello Everyone,

I was trying to compile the introjucer in CodeBlocks with the included project file and I having the the following build error:

```auto
||=== The Introjucer, Debug ===|
C:\APPLICATIONS\juce\modules\juce_core\native\juce_win32_Network.cpp||In function 'void juce::MACAddressHelpers::getViaNetBios(juce::Array<juce::MACAddress, juce::DummyCriticalSection, 0>&)':|

C:\APPLICATIONS\juce\modules\juce_core\native\juce_win32_Network.cpp|379|error: no matching function for call to 'zerostruct(juce::MACAddressHelpers::getViaNetBios(juce::Array<juce::MACAddress, juce::DummyCriticalSection, 0>&)::ASTAT&)'|

||=== Build finished: 1 errors, 0 warnings ===|

```

the error: no matching function for call to zerostruct(juce::MACAddressHelpers::getViaNetBios(juce::Array\<juce::MACAddress, juce::DummyCriticalSection, 0\>&)::ASTAT&)

in the file: juce\modules\juce\_core\native\juce\_win32\_Network.cpp

Any help and pointer will be well appreciated. Many thanks!

God blesses!!!

Best regards,  
Sanyaade[/quote]

What version of GCC? You’d need a recent one, the old versions of mingw were very buggy.

---

<div class="post-metadata">

**Author:** ![atom](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/atom/32/113_2.png) [@atom](https://forum.juce.com/u/atom)\
**Post date:** [April 21, 2013, 12:13pm UTC](https://forum.juce.com/t/code-blocks/10206/17 "2013-04-21T12:13:09Z")

</div>

Actualy that happens to me too, i had explicitly call zeromem instead of the templated JUCE version, for some reason mingw doesn’t like that.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 21, 2013, 1:21pm UTC](https://forum.juce.com/t/code-blocks/10206/18 "2013-04-21T13:21:51Z")

</div>

That code has been in there for ages, and I’ve definitely compiled it with mingw. I can only guess it’s a GCC weirdness in older versions?

---

<div class="post-metadata">

**Author:** ![atom](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/atom/32/113_2.png) [@atom](https://forum.juce.com/u/atom)\
**Post date:** [April 21, 2013, 8:18pm UTC](https://forum.juce.com/t/code-blocks/10206/19 "2013-04-21T20:18:30Z")

</div>

Not possible i used the latest possible windows gcc 4.7.2.1, maybe the new versions screws this up, but i never used anything below 4.6

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [April 22, 2013, 9:22am UTC](https://forum.juce.com/t/code-blocks/10206/20 "2013-04-22T09:22:55Z")

</div>

Well, just to make sure, I compiled the juce demo again with mingw 4.7.2, and yes, it compiles just fine. The code itself is 100% legit.

I really do think you must be accidentally using an old compiler version, there’s no other reason why it’d do that. You should add “–version” to your build flags to double-check,

[Next page](https://forum.juce.com/t/code-blocks/10206.md?page=2)
