News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Trying to compile CodeBlocks from source

Started by MathieuA, April 28, 2021, 10:19:50 AM

Previous topic - Next topic

MathieuA

Hello !

I'm trying to compile this plugin for CodeBlocks to use Clang format => https://github.com/danselmi/cbClangFormat

So first i read the wiki to compile a Hello World plugin for test on Windows 10. https://wiki.codeblocks.org/index.php/Creating_a_simple_%22Hello_World%22_plugin
I following steps and i have installed TDM-GCC, mentioned here => https://wiki.codeblocks.org/index.php/MinGW_installation#Development_Tools

One of first step is to building WxWidgets, i read and following wiki step by step and the first command pass without problem
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean

But the second one:
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1

Return this error =>
In file included from ../../src/msw/graphicsd2d.cpp:39:
..\..\include/wx/msw/private/graphicsd2d.h:21:10: fatal error: d2d1.h: No such file or directory
#include <d2d1.h>
          ^~~~~~~~
compilation terminated.
makefile.gcc:8202: recipe for target 'gcc_mswudll\monodll_graphicsd2d.o' failed
mingw32-make: *** [gcc_mswudll\monodll_graphicsd2d.o] Error 1


This file is part of Directx so I tried installing it (maybe) and also tried installing the Windows SDK but none work (maybe a missing link?)
I got the exact same error on another computer also based on Windows 10...
And i didn't find anything that help me...
I trying this with last version of WxWidget (3.1.4)


I also tried under Linux (Debian distribution) and I compiled wxWidgets without any problem but now, it's the Code Blocks that I can't compile  :'(

I have read and following the wiki here => https://wiki.codeblocks.org/index.php/Installing_Code::Blocks_from_source_on_Linux

When i launch the "./bootstrap" command, i get this error =>

root@dae82d75f53f:/debian/Desktop/lab/trunk# ./bootstrap
Using 'svn --xml info' to get the revision
Found revision: '12312' '2021-04-03 05:14:39'
rm: missing operand
Try 'rm --help' for more information.
Note: If you want to build debian packages you have to first run the debian/setup_control.sh script. See the script for details how to use it.
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
aclocal: error: unrecognized option '-T'.
aclocal: Try '/usr/bin/aclocal --help' for more information.


I couldn't find who calls aclocal with this bad argument, and I'm a little frustrated that I couldn't get there by just following the steps ... on 3 different machines.

So any help is welcome !

Thanks  :)

(Btw, sorry for my poor English, i'm french)

BlueHazzard

What wxWidgets download did you used to compile on windows?
i have not tried the latest release, but wx3.1.2 should work.

TDM gcc is not up to date anymore...  I use http://winlibs.com/ and they work fine


For linux, this is quite strange...
Where did you get the code for codeblocks from?

stahta01

From the Linux error message I would suggest trying to run the following command before bootstrap.


./debian/setup_control.sh
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

gd_on

d2d1.h is a header file that should be present in one of the include directory of your compiler. If you have not it, it's because your compiler version is too old or should be updated. It you have it, you can try to add the path of this header in your PATH variable. On Windows, take care also to not mix 32bits and 64 bits builds.
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.2, Msys2 Compilers 16.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

stahta01

#4
Quote from: gd_on on April 28, 2021, 12:20:30 PM
d2d1.h is a header file that should be present in one of the include directory of your compiler. If you have not it, it's because your compiler version is too old or should be updated. It you have it, you can try to add the path of this header in your PATH variable. On Windows, take care also to not mix 32bits and 64 bits builds.

It likely means they have a broken compiler installation if they are using an MinGW64 based MinGW GCC.

Edit: In the past, TDM used MinGW64 for 64 bit and mingw.org for 32 bit.

Tim S.

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]