Author Topic: Trying to compile CodeBlocks from source  (Read 1468 times)

Offline MathieuA

  • Single posting newcomer
  • *
  • Posts: 1
Trying to compile CodeBlocks from source
« on: April 28, 2021, 10:19:50 am »
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
Code
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean

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

Return this error =>
Code
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 =>

Code
[email protected]:/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)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2987
Re: Trying to compile CodeBlocks from source
« Reply #1 on: April 28, 2021, 10:45:47 am »
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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7176
    • My Best Post
Re: Trying to compile CodeBlocks from source
« Reply #2 on: April 28, 2021, 11:21:47 am »
From the Linux error message I would suggest trying to run the following command before bootstrap.

Code
./debian/setup_control.sh
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gd_on

  • Lives here!
  • ****
  • Posts: 660
Re: Trying to compile CodeBlocks from source
« Reply #3 on: April 28, 2021, 12:20:30 pm »
Code
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 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7176
    • My Best Post
Re: Trying to compile CodeBlocks from source
« Reply #4 on: April 28, 2021, 07:40:18 pm »
Code
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.

« Last Edit: April 28, 2021, 07:43:31 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org