質問編集履歴

4

gtkmmからgtk+に変更

2021/07/31 15:52

投稿

AIUE-kun
AIUE-kun

スコア9

test CHANGED
File without changes
test CHANGED
@@ -50,9 +50,9 @@
50
50
 
51
51
  ```console
52
52
 
53
- $ pkg-config --cflags --libs gtk+-3.0
53
+ $ pkg-config --cflags --libs gtkmm-3.0
54
54
 
55
- -IC:/msys64/mingw64/bin/../include/gtk-3.0 -IC:/msys64/mingw64/bin/../include/pango-1.0 -IC:/msys64/mingw64/bin/../include -IC:/msys64/mingw64/bin/../include/glib-2.0 -IC:/msys64/mingw64/bin/../lib/glib-2.0/include -IC:/msys64/mingw64/bin/../include/harfbuzz -IC:/msys64/mingw64/bin/../include/freetype2 -IC:/msys64/mingw64/bin/../include/libpng16 -mms-bitfields -IC:/msys64/mingw64/bin/../include/fribidi -IC:/msys64/mingw64/bin/../include/cairo -IC:/msys64/mingw64/bin/../include/lzo -IC:/msys64/mingw64/bin/../include/pixman-1 -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -IC:/msys64/mingw64/bin/../include/gdk-pixbuf-2.0 -mms-bitfields -mms-bitfields -mms-bitfields -IC:/msys64/mingw64/bin/../include/atk-1.0 -mms-bitfields -mms-bitfields -mms-bitfields -pthread -mms-bitfields -LC:/msys64/mingw64/bin/../lib -lgtk-3 -lgdk-3 -lz -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi -lsetupapi -lcfgmgr32 -lpangowin32-1.0 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
55
+ -IC:/msys64/mingw64/bin/../include/gtkmm-3.0 -IC:/msys64/mingw64/bin/../lib/gtkmm-3.0/include -IC:/msys64/mingw64/bin/../include/giomm-2.4 -IC:/msys64/mingw64/bin/../lib/giomm-2.4/include -IC:/msys64/mingw64/bin/../include -IC:/msys64/mingw64/bin/../include/glib-2.0 -IC:/msys64/mingw64/bin/../lib/glib-2.0/include -mms-bitfields -IC:/msys64/mingw64/bin/../include/glibmm-2.4 -IC:/msys64/mingw64/bin/../lib/glibmm-2.4/include -IC:/msys64/mingw64/bin/../include/sigc++-2.0 -IC:/msys64/mingw64/bin/../lib/sigc++-2.0/include -IC:/msys64/mingw64/bin/../include/gtk-3.0 -IC:/msys64/mingw64/bin/../include/pango-1.0 -IC:/msys64/mingw64/bin/../include/harfbuzz -IC:/msys64/mingw64/bin/../include/freetype2 -IC:/msys64/mingw64/bin/../include/libpng16 -mms-bitfields -IC:/msys64/mingw64/bin/../include/fribidi -IC:/msys64/mingw64/bin/../include/cairo -IC:/msys64/mingw64/bin/../include/lzo -IC:/msys64/mingw64/bin/../include/pixman-1 -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -IC:/msys64/mingw64/bin/../include/gdk-pixbuf-2.0 -mms-bitfields -mms-bitfields -mms-bitfields -IC:/msys64/mingw64/bin/../include/atk-1.0 -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -IC:/msys64/mingw64/bin/../include/cairomm-1.0 -IC:/msys64/mingw64/bin/../lib/cairomm-1.0/include -IC:/msys64/mingw64/bin/../include/pangomm-1.4 -IC:/msys64/mingw64/bin/../lib/pangomm-1.4/include -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -IC:/msys64/mingw64/bin/../include/atkmm-1.6 -IC:/msys64/mingw64/bin/../lib/atkmm-1.6/include -IC:/msys64/mingw64/bin/../include/gdkmm-3.0 -IC:/msys64/mingw64/bin/../lib/gdkmm-3.0/include -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -pthread -mms-bitfields -LC:/msys64/mingw64/bin/../lib -lgtkmm-3.0 -latkmm-1.6 -lgdkmm-3.0 -lgiomm-2.4 -lgtk-3 -lgdk-3 -lz -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi -lsetupapi -lcfgmgr32 -lpangowin32-1.0 -latk-1.0 -lcairo-gobject -lgio-2.0 -lpangomm-1.4 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -lcairo -lgdk_pixbuf-2.0 -lgobject-2.0 -lglib-2.0 -lintl
56
56
 
57
57
  ```
58
58
 

3

改善部分更新

2021/07/31 15:52

投稿

AIUE-kun
AIUE-kun

スコア9

test CHANGED
File without changes
test CHANGED
@@ -16,23 +16,47 @@
16
16
 
17
17
  ```
18
18
 
19
+ (追記)
20
+
21
+ この部分が解決できていない。
22
+
23
+ また、Visual Studio Codeを利用しているが「#includeエラーが検出されました。includePathを更新してください。」と「ソースファイルを開けません"glibconfig.h"(dependency of "gtk/gtk.h")」の2つのエラーが出ています。そのためc_cpp_ptoprtyird.jsonを
24
+
25
+ ```
26
+
27
+ "includePath": [
28
+
29
+ "${workspaceFolder}/**",
30
+
31
+ "C:/msys64/mingw64/include/gtk-3.0",
32
+
33
+ "C:/msys64/mingw64/include/glib-2.0"
34
+
35
+ ],
36
+
37
+ ```
38
+
39
+ に変更したが改善は見られなかった。
40
+
41
+ ("C:/msys64/mingw64/include/glib-2.0"に関しては「ソースファイルを開けません"glib.h"(dependency of "gtk/gtk.h")」とエラーがでたため追記したが)
42
+
43
+
44
+
45
+ (追記)
46
+
47
+ この部分は"C:\MinGW\bin"から"C:\msys64\mingw64\bin"に変更した後、以下のようになってエラーはでなくなった。
48
+
19
- そのため、MSYS2にて'pkg-config --cflags --libs gtkmm-3.0'を確認しようとしたところ
49
+ MSYS2にて'pkg-config --cflags --libs gtkmm-3.0'を確認しようとした結果は
20
50
 
21
51
  ```console
22
52
 
23
53
  $ pkg-config --cflags --libs gtk+-3.0
24
54
 
25
- Package gtk+-3.0 was not found in the pkg-config search path.
26
-
27
- Perhaps you should add the directory containing `gtk+-3.0.pc'
28
-
29
- to the PKG_CONFIG_PATH environment variable
30
-
31
- Package 'gtk+-3.0', required by 'virtual:world', not found
55
+ -IC:/msys64/mingw64/bin/../include/gtk-3.0 -IC:/msys64/mingw64/bin/../include/pango-1.0 -IC:/msys64/mingw64/bin/../include -IC:/msys64/mingw64/bin/../include/glib-2.0 -IC:/msys64/mingw64/bin/../lib/glib-2.0/include -IC:/msys64/mingw64/bin/../include/harfbuzz -IC:/msys64/mingw64/bin/../include/freetype2 -IC:/msys64/mingw64/bin/../include/libpng16 -mms-bitfields -IC:/msys64/mingw64/bin/../include/fribidi -IC:/msys64/mingw64/bin/../include/cairo -IC:/msys64/mingw64/bin/../include/lzo -IC:/msys64/mingw64/bin/../include/pixman-1 -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -mms-bitfields -IC:/msys64/mingw64/bin/../include/gdk-pixbuf-2.0 -mms-bitfields -mms-bitfields -mms-bitfields -IC:/msys64/mingw64/bin/../include/atk-1.0 -mms-bitfields -mms-bitfields -mms-bitfields -pthread -mms-bitfields -LC:/msys64/mingw64/bin/../lib -lgtk-3 -lgdk-3 -lz -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi -lsetupapi -lcfgmgr32 -lpangowin32-1.0 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
32
56
 
33
57
  ```
34
58
 
35
- がGTKをインストールしたつもりにも関わらずエラーが出てしまい困っている
59
+ なった。
36
60
 
37
61
 
38
62
 
@@ -100,6 +124,32 @@
100
124
 
101
125
  エラーは直らず変化が見られなかった。
102
126
 
127
+ (追記)
128
+
129
+ Windowsの環境変数の設定でgccのコンパイラは"C:\MinGW\bin"から"C:\msys64\mingw64\bin"に変更
130
+
131
+ ```console
132
+
133
+ $ gcc -v
134
+
135
+ Using built-in specs.
136
+
137
+ COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
138
+
139
+ COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/lto-wrapper.exe
140
+
141
+ Target: x86_64-w64-mingw32
142
+
143
+ Configured with: ../gcc-10.3.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --enable-checking=release --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++,jit --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-lto --enable-libgomp --disable-multilib --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev5, Built by MSYS2 project' --with-bugurl=https://github.com/msys2/MINGW-packages/issues --with-gnu-as --with-gnu-ld --with-boot-ldflags='-pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high -Wl,--disable-dynamicbase -static-libstdc++ -static-libgcc' 'LDFLAGS_FOR_TARGET=-pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high' --enable-linker-plugin-flags='LDFLAGS=-static-libstdc++\ -static-libgcc\ -pipe\ -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high\ -Wl,--stack,12582912'
144
+
145
+ Thread model: posix
146
+
147
+ Supported LTO compression algorithms: zlib zstd
148
+
149
+ gcc version 10.3.0 (Rev5, Built by MSYS2 project)
150
+
151
+ ```
152
+
103
153
  ### 補足情報(FW/ツールのバージョンなど)
104
154
 
105
155
 

2

ファイル名にミスがあった

2021/07/31 15:46

投稿

AIUE-kun
AIUE-kun

スコア9

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
1
  ### 前提・実現したいこと
2
2
 
3
- C言語/GTKを公式サイトのサンプルコード("gtk_hello.c"で保存した)をコンパイル・実行ができるようにしたい。
3
+ C言語/GTKを公式サイトのサンプルコード("gtk_test.c"で保存した)をコンパイル・実行ができるようにしたい。
4
4
 
5
5
 
6
6
 

1

質問がGTK(フレームワーク)をコンパイルと書いてしまったのでC言語のコンパイルと修正した。

2021/07/16 06:59

投稿

AIUE-kun
AIUE-kun

スコア9

test CHANGED
@@ -1 +1 @@
1
- GTKをgccでコンパイルをしようとしたが"No such file or directory"エラーが起こり困っている
1
+ C言語/GTKをgccでコンパイルをしようとしたが"No such file or directory"エラーが起こり困っている
test CHANGED
File without changes