Unable to compile gtk+2.0.

Asked 2 years ago, Updated 2 years ago, 99 views

Unable to compile gtk+2.0.
Operating System: Windows compilers:GCC
Source File:J:\gtk\main.c
We expanded gtk+-bundle_3.10.4-20131202_win32.zip to J:\gtk\gtk.

in batch file
set PATH=gtk\bin\;%PATH%
cmd

Run and at the command prompt

 gcc-ohbf.exe main.c`pkg-config --cflags --libsgtk+-2.0

When I ran

 gcc:error:`pkg-config:No such file or directory
gcc:error:gtk+-2.0:No such file or directory
gcc:error:unrecognized command line option '--cflags'
gcc:error:unrecognized command line option '--libs'

said the error.

How do I compile it?

windows c gtk

2022-09-30 19:39

2 Answers

If you use the FOR command, cmd.exe may not be impossible, but since it's roundabout, it might be better to use UNIX shells such as bash.exe honestly.

 FOR/F ["Option"]% Variable IN('Command') DO Command [Command Parameters]
    For the or usebackq option:
FOR/F ["Option"]% Variable IN(`Command')DO Command [Command Parameters]

Example.

 FOR/F"delims="%i IN('pkg-config --cflags --libsgtk+-2.0')[email protected] main.c%i


2022-09-30 19:39

Windows command prompts do not support backquotes.
Run from the shell using msys or msys2, or write a command in Makefile and run mingw32-make.

add

By the way...

gcc-ohbf.exe main.c`pkg-config --cflags --libs gtk+-2.0

The last backquote is missing.


2022-09-30 19:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.