Installed Msys2, compiler and GTK+:pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-x86_64-gdb
pacman -S make
pacman -S mingw-w64-x86_64-cmake
pacman -S mingw-w64-x86_64-toolchain base-devel
pacman -S mingw-w64-x86_64-gtk3
pacman -S mingw-w64-x86_64-glade
Installed Code Blocks, specified the compiler:Set up the project like this:Search directories Compiler
C:\msys64\mingw64\include
C:\msys64\mingw64\include\atk-1.0
C:\msys64\mingw64\include\cairo
C:\msys64\mingw64\include\glib-2.0
C:\msys64\mingw64\include\gtk-3.0
C:\msys64\mingw64\include\gtk-3.0\gtk
C:\msys64\mingw64\include\gtk-3.0\gdk
C:\msys64\mingw64\include\gdk-pixbuf-2.0
C:\msys64\mingw64\include\harfbuzz
C:\msys64\mingw64\include\pango-1.0
C:\msys64\mingw64\lib\glib-2.0\include
Search directories Linker
C:\msys64\mingw64\lib
In a simple program:int main(int argc, char *argv[])
{
gtk_init (&argc, &argv);
GtkWidget *win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (win);
gtk_main ();
return 0;
}
I get errors:||=== Build: Debug in cbTestGTK (compiler: GNU GCC Compiler) ===|
C:\msys64\mingw64\bin\..\lib\gcc\x86_64-w64-mingw32\12.2.0\..\..\..\..\x86_64-w64-mingw32\bin\ld.exe: obj\Debug\main.o||in function `main':|
D:\MyProgramming\cbTestGTK\main.cpp|5|undefined reference to `gtk_init_abi_check'|
C:\msys64\mingw64\bin\..\lib\gcc\x86_64-w64-mingw32\12.2.0\..\..\..\..\x86_64-w64-mingw32\bin\ld.exe: D:\MyProgramming\cbTestGTK\main.cpp|6|undefined reference to `gtk_window_new'|
C:\msys64\mingw64\bin\..\lib\gcc\x86_64-w64-mingw32\12.2.0\..\..\..\..\x86_64-w64-mingw32\bin\ld.exe: D:\MyProgramming\cbTestGTK\main.cpp|7|undefined reference to `gtk_widget_show'|
C:\msys64\mingw64\bin\..\lib\gcc\x86_64-w64-mingw32\12.2.0\..\..\..\..\x86_64-w64-mingw32\bin\ld.exe: D:\MyProgramming\cbTestGTK\main.cpp|8|undefined reference to `gtk_main'|
||error: ld returned 1 exit status|
||=== Build failed: 5 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
Please help me set up the project correctly.
-------------- Build: Debug in minimal GTK3 (compiler: GNU GCC Compiler)---------------
g++.exe -Wall -g -IC:\msys64\mingw64\include\gtk-3.0 -IC:\msys64\mingw64\include\glib-2.0 -IC:\msys64\mingw64\lib\glib-2.0\include -IC:\msys64\mingw64\include\pango-1.0 -IC:\msys64\mingw64\include\cairo -IC:\msys64\mingw64\include\gdk-pixbuf-2.0 -IC:\msys64\mingw64\include\atk-1.0 -IC:\msys64\mingw64\include\harfbuzz -c H:\repos\git\devel\IDE_git_repos\MSys2_CodeBlocks_Projects\gtk\main.cpp -o obj\Debug\main.o
g++.exe -o bin\Debug\gtk3_msys2.exe obj\Debug\main.o -lgtk-3 -lgobject-2.0 -lglib-2.0
Output file is bin\Debug\gtk3_msys2.exe with size 125.40 KB
Process terminated with status 0 (0 minute(s), 5 second(s))
0 error(s), 0 warning(s) (0 minute(s), 5 second(s))