Code::Blocks Forums

User forums => Help => Topic started by: tuchin on November 24, 2018, 05:03:30 pm

Title: Configure Codeblocks
Post by: tuchin on November 24, 2018, 05:03:30 pm
Windows 10 Home 64bit. Using MSYS, I downloaded the MinGW distribution, as well as everything needed to create GTK programs. In the MSYS directory, I got the mingw64 directory. I transferred this directory to the C drive, then installed Codeblocks using the installer codeblocks-17.12-setup.exe. In the Settings-Compiler-Search Directory I select C:\mingw64\bin - I receive a message that the compiler was not found. Although in this directory there are gcc.exe, g ++. Exe, c ++. Exe, cmake.exe and others. Help, please, correctly configure the codeblocks.
Title: Re: Configure Codeblocks
Post by: oBFusCATed on November 24, 2018, 05:19:44 pm
C:\mingw64\bin - I receive a message that the compiler was not found.
I guess we should add explicit check and popup a message box when people do this.
In the dialog where you've entered this path is explicitly stated that you should omit the bin from the path!!!
Read please.
Title: Re: Configure Codeblocks
Post by: stahta01 on November 24, 2018, 06:42:26 pm
Edit: The below is for MSys2 with 64 bit MinGW GCC!!

Installation directory of
Code
C:\msys64\mingw64
Works for me.

C Compiler: x86_64-w64-mingw32-gcc.exe
C++ Compiler x86_64-w64-mingw32-g++.exe
Linker for Dyn. x86_64-w64-mingw32-g++.exe

Tim S.
Title: Re: Configure Codeblocks
Post by: tuchin on November 24, 2018, 09:14:49 pm
Tim S, thanks for the answer. An error occurred in the console project C++:
Code
#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}
C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.2.0/include/stddef.h:1:15: fatal error: stddef.h: No such file or directory. An error occurs on a line
Code
#include_next <stddef.h>
in file c:\msys64\mingw64\lib\gcc\x86_64-w64-mingw32\8.2.0\include\stddef.h. How to fix it?
Title: Re: Configure Codeblocks
Post by: stahta01 on November 24, 2018, 11:04:59 pm
Post a full rebuild log.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)
Title: Re: Configure Codeblocks
Post by: stahta01 on November 24, 2018, 11:11:40 pm
Are you using MSys2 or MSys?

[If using MSys2,] Did you do the stupid thing you said by moving the files manually instead of using the MSys2 pacman installer?

Tim S.
Title: Re: Configure Codeblocks
Post by: tuchin on November 25, 2018, 09:17:14 am
I already work with a directory MSYS64/mingw64 like yours. I use MSYS2.
Title: Re: Configure Codeblocks
Post by: tuchin on November 25, 2018, 09:22:15 am
I did not move the directory mingw64 in the directory msys64, but simply copied it. After your message, the copied directory c:\mingw64 was deleted and started working with the directory in the directory msys64.
Title: Re: Configure Codeblocks
Post by: stahta01 on November 25, 2018, 09:36:49 am
Do the MSys2 Upgrade command of
Code
pacman -Syuu

To make sure your MSys2 installation is up to date.

After you get that done correctly.
Edit: You might need to kill the pacman.exe process to do the update https://winaero.com/blog/kill-process-windows-10/ (https://winaero.com/blog/kill-process-windows-10/)

Do
Code
pacman -S mingw-w64-x86_64-gcc
to reinstall the GCC Compiler that must be damaged by you copying files around.

And, post a build log if you still have problems after that.

Tim S.
Title: Re: Configure Codeblocks
Post by: tuchin on November 25, 2018, 07:51:43 pm
Thank you very much! Reinstalled msys2, entered the commands that you specified, and everything worked out!
Title: Re: Configure Codeblocks
Post by: tuchin on November 25, 2018, 08:57:07 pm
I have additional questions:
1. Did not find the gdb debugger in msys64\mingw64. How to install it?
2. How can I get information about all the parameters of pacman in msys2?
3. I would like to learn how to make gui using GTK+. When I tried to make a project GTK+, the codeblock requested the location of the files for creating the GTK application ($GTK). I did not find the directory GTK in msys64\mingw64. Tell me, please, how to set up a codeblock to create a project of the GTK?
Title: Re: Configure Codeblocks
Post by: stahta01 on November 25, 2018, 09:32:35 pm
I have additional questions:
1. Did not find the gdb debugger in msys64\mingw64. How to install it?
2. How can I get information about all the parameters of pacman in msys2?
3. I would like to learn how to make gui using GTK+. When I tried to make a project GTK+, the codeblock requested the location of the files for creating the GTK application ($GTK). I did not find the directory GTK in msys64\mingw64. Tell me, please, how to set up a codeblock to create a project of the GTK?

Post a link to the website with the example GTK code you want to run; when I have time will see if I can figure it out once more.
Note: I believe the GTK and MSys2 might have already been answered in this forum. So, I would suggest searching.

To install the normal full MinGW 64 toolchain run
Code
pacman -S --needed mingw-w64-x86_64-toolchain

Code
pacman -S --help
or
Code
pacman --help

Tim S.

Title: Re: Configure Codeblocks
Post by: stahta01 on November 25, 2018, 11:33:25 pm
https://github.com/stahta01/cb_misc/blob/master/Notes/MSys2/Setting%20up%20MSys2%20for%20using%20GTK3%20with%20external%20CodeBlocks%20IDE.txt (https://github.com/stahta01/cb_misc/blob/master/Notes/MSys2/Setting%20up%20MSys2%20for%20using%20GTK3%20with%20external%20CodeBlocks%20IDE.txt)

Link to directions I wrote a while back on this subject.

Tim S.
Title: Re: Configure Codeblocks
Post by: tuchin on November 27, 2018, 07:25:36 am
Thank you very much! Very necessary information!