Can't find file executable in your configured search path for gnc gcc compiler - gcc

My problem is that code::blocks error message tells me that it can't find file executable in the search path for gnc gcc compiler. Although, I don't know what that means. Also I typed out some code:
#include <iostream>
using namespace std;
int main(void) {
cout <<"Hello World" <<endl;
return 0;
}
I can't build it or run in code::blocks. What do I need to do?
I went on line but I got some answers that are way over my head. I was able to use code::blocks once before I installed Visual studios express 2013. Visual studios didn't work right either. It kept asking me to repair or uninstall every time I tried to open it. So I deleted it along with code::blocks. Now that I re-installed code::blocks I still can't get to work right.
This problem with compilers is taking up all my time and I can't practice learning programming because I can't get any compiler to work right. I need some help, please.

I'm guessing you've installed Code::Blocks but not installed or set up GCC yet. I'm assuming you're on Windows, based on your comments about Visual Studio; if you're on a different platform, the steps for setting up GCC should be similar but not identical.
First you'll need to download GCC. There are lots and lots of different builds; personally, I use the 64-bit build of TDM-GCC. The setup for this might be a bit more complex than you'd care for, so you can go for the 32-bit version or just grab a preconfigured Code::Blocks/TDM-GCC setup here.
Once your setup is done, go ahead and launch Code::Blocks. You don't need to create a project or write any code yet; we're just here to set stuff up or double-check your setup, depending on how you opted to install GCC.
Go into the Settings menu, then select Global compiler settings in the sidebar, and select the Toolchain executables tab. Make sure the Compiler's installation directory textbox matches the folder you installed GCC into. For me, this is C:\TDM-GCC-64. Your path will vary, and this is completely fine; just make sure the path in the textbox is the same as the path you installed to. Pay careful attention to the warning note Code::Blocks shows: this folder must have a bin subfolder which will contain all the relevant GCC executables. If you look into the folder the textbox shows and there isn't a bin subfolder there, you probably have the wrong installation folder specified.
Now, in that same Toolchain executables screen, go through the individual Program Files boxes one by one and verify that the filenames shown in each are correct. You'll want some variation of the following:
C compiler: gcc.exe (mine shows x86_64-w64-mingw32-gcc.exe)
C++ compiler: g++.exe (mine shows x86_64-w64-mingw32-g++.exe)
Linker for dynamic libs: g++.exe (mine shows x86_64-w64-mingw32-g++.exe)
Linker for static libs: gcc-ar.exe (mine shows x86_64-w64-mingw32-gcc-ar.exe)
Debugger: GDB/CDB debugger: Default
Resource compiler: windres.exe (mine shows windres.exe)
Make program: make.exe (mine shows mingw32-make.exe)
Again, note that all of these files are in the bin subfolder of the folder shown in the Compiler installation folder box - if you can't find these files, you probably have the wrong folder specified. It's okay if the filenames aren't a perfect match, though; different GCC builds might have differently prefixed filenames, as you can see from my setup.
Once you're done with all that, go ahead and click OK. You can restart Code::Blocks if you'd like, just to confirm the changes will stick even if there's a crash (I've had occasional glitches where Code::Blocks will crash and forget any settings changed since the last launch).
Now, you should be all set. Go ahead and try your little section of code again. You'll want int main(void) to be int main(), but everything else looks good. Try building and running it and see what happens. It should run successfully.

Just open your setting->compiler and click on the reset defaults and it will start work.

* How to Download and install CodeBlocks.* ( I have already downloaded )
***How to solve the CodeBlocks environment error.
Go to "Settings"----"Compiler"----"Selected compiler"( GNU GCC Compiler ).
Then, Selected "Toolchain executables".
Now, "( C:\Program Files (x86)\CodeBlocks\MinGW )"
See Video : https://youtu.be/Tb1VnXs60Lg

I had also found this error but I have solved this problem by easy steps. If you want to solve this problem follow these steps:
Step 1: First start code block
Step 2: Go to menu bar and click on the Setting menu
Step 3: After that click on the Compiler option
Step 4: Now, a pop up window will be opened. In this window, select "GNU GCC COMPILER"
Step 5: Now go to the toolchain executables tab and select the compiler installation directory like (C:\Program Files (x86)\CodeBlocks\MinGW\bin)
Step 6: Click on the Ok.
Now you can remove this error by follow these steps. Sometimes you don't need to select bin folder. You need to select only (C:\Program Files (x86)\CodeBlocks\MinGW) this path but some system doesn't work this path. That's why you have to select path from C:/ to bin folder.
Thank you.

For that you need to install binary of GNU GCC compiler, which comes with MinGW package. You can download MinGW( and put it under C:/ ) and later you have to download gnu -c, c++ related Binaries, so select required package and install them(in the MinGW ). Then in the Code::Blocks, go to Setting, Compiler, ToolChain Executable. In that you will find Path, there set C:/MinGW.
Then mentioned error will be vanished.

Uninstall/Remove your current codeblocks compiler.
Install codeblocks using this link that contains GCC compiler files: http://sourceforge.net/projects/codeblocks/files/Binaries/13.12/Windows/codeblocks-13.12mingw-setup-TDM-GCC-481.exe.
Now go to : Settings > Compiler.... > ToolChain Executables Tab
CLICK on Auto-detect button and then click OK button. Now just restart CodeBlocks and start writing your codes and use the Build and run option. It will RUN normally.

Fistly, Code Blocks is not a compiler. It is just an integrated development environment.
So, you must show the path of your compiler at first, (if you dont have a compiler you have to download an install, it is not difficult to find. f.e. GCC is good one.)
If code blocks could not find automatically the path of compiler it is an obligation to show it yourself.
But when you install, probably Code Blocks automatically find your compiler.
Enjoy.

This simple in below solution worked for me.
http://forums.codeblocks.org/index.php?topic=17336.0
I had a similar problem. Please note I'm a total n00b in C++ and IDE's but heres what I did (after some research)
So of course I downloaded the version that came with the compiler and it didn't work. Heres what I did:
1) go to settings in the upper part
2) click compiler
3) choose reset to defaults.
Hopefully this works

I'm a total noob but I reinstalled over the codeblocks giving me these "Can't find file executable in your configured search path for gnc gcc compiler" errors by downloading:
codeblocks-20.03mingw-setup.exe
(IMPORTANT: make sure it has the "mingw" in the file download name, that has the compiler build that is required to compile the code which doesn't automatically comes with the main codeblocks editor software download because codeblocks already assumes you already have another compiler installed on your computer {visual studio 2019 or such}).
Then when I created a new project (console application) and used the defaults to quickly test it out.
It gave me errors.
So I went to Settings > Compiler > Selected Compiler set to: GNU GCC Compiler > Click on the "Tooolchain executables" tab > Click on Auto-Detect > Should say "C:\Progam Files\CodeBlocks\MinGW" > Click OK.
Build and run a simple hello world code.
Should work! If not, look for the "MingGW" in the C:\Program Files\CodeBlocks and select it.

Here's an easy way for Windows users.
Uninstall the existing codeblocks from your system.
Restart system.
Go to http://www.codeblocks.org/downloads/26
Download the codeblocks-16.01mingw-setup.exe file. It includes the GCC/G++ compiler and GDB debugger from TDM-GCC (version 4.9.2, 32 bit, SJLJ).

Related

CodeBlocks not finding wxWidgets

I'm on PopOS and installed wxWidgets via the terminal when I first got the error error: wx/wxprec.h: No such file or directory as said by the user "oBFusCATed". I did not manually compile from source.
wx-config --version outputs 3.0.5
wx-config --cxxflags outputs:
-I/usr/lib/x86_64-linux-gnu/wx/include/gtk3-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
wx-config --libs outputs:
-L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk3u_xrc-3.0 -lwx_gtk3u_html-3.0 -lwx_gtk3u_qa-3.0 -lwx_gtk3u_adv-3.0 -lwx_gtk3u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
I created my project via the wizard and made sure I selected the same version (wxWidgets 3.0.x).
In the step that says "Please select your favorite GUI Builder to use.", I chose wxSmith and Frame based options.
In the next step, which prompts me to choose a compiler, I left it as it was (see image below).
In the next step, which prompts me to select the wxWidgets configuration I selected the following options:
Though, I also tried using the Use default wxWidgets configuration and without any Other Options selected.
And last, I clicked Finish.
In Code::Blocks I've added the `wx-config --cxxflags` and `wx-config --libs` (even two additional ones but with the full path which the commands above return in the terminal), as you can see in the image below.
In the Other compiler options, I have these two lines (which I did not add myself - must've been the wizard):
-Winvalid-pch
-include wx_pch.h
I even added the output of wx-config --cxxflags to Other resource compiler options.
I also added a Global Variable wx with this base path /usr/lib/x86_64-linux-gnu/wx (copy/pasted), as mentioned in step #7 here. If I put the name of the variable exactly as $(#wx), it appears as set___wx__ instead of just wx, as seen in some other instructions I've found here and on other forums/guides.
Interestingly enough, if I click the button on the right to navigate to it, there is no wx folder. Like, it's nowhere to be found. If I were to use my normal file manager, I can navigate to it (terminal works as well). Could this have something to do with it?
In the Linker Settings tab, I've added these two libraries:
At the end of it all, I still get the error mentioned at the beginning. If I were to comment out that line, I get the same error but for wx/app.h and wx/frame.h, which made me think that it's just not finding the wxWidgets, but I can't figure out why.
This is the first time I'm using C++/Code::Blocks/wxWidgets, so if you give me any instructions where I need to put stuff, please, try to be specific.
P.S. Many of the guides on how to set this up seem to be for Windows and the only one I found for Ubuntu (since PopOS is based on it) is this one. Where he even gets the same error, but his solution did not work (add the output of wx-config --cxxflags to Other resource compiler options - which I've already tried - though, he does build from source).
P.S.2. I found this setup build which uses the binary download option, but it's for Windows. Would something mess up if I were to attempt it?
P.S.3. I know a lot of people have similar issues, but the stuff I've already tried seem to have solved their problem and since for me it didn't, I figured I'd ask.
Son of a motherless goat >_<
The moment I ask, an idea popped into my head from another issue I had recently.
I had installed Code::Blocks via the PopShop (i.e. flatpak) and that flatpak had no access to the wx folder, which is why it wouldn't show up when trying to navigate to it via Code::Blocks.
I uninstalled it and installed it again via sudo apt install codeblocks. I created a new project via the wizard (it wouldn't let me select wxSmith because it doesn't seem to come with it - wxSmith plugin is not loaded can not continue) with the same wizard settings mentioned in my original post.
Then I only added the wx-config --cxxflags and wx-config --libs compiler flags and it built!
Darn it, Flatpak...
Anyway, for people that are interested in adding wxSmith plugin, the person in this video shows how.
Run sudo apt install codeblocks-contrib in your terminal and if you had Code::Blocks open, make sure to restart it - and perhaps give the dude a like if the video is still up! :3

setting up GCC and Make for Jekyll

I'm trying to preview my GitHub Pages locally (to edit the CSS), or create a Jekyll website, from Windows. Following the Jekyll insruction, I installed Ruby and Gems, including Jekyll itself. The instruction points me also to GCC and Make as other requirements, but I'm confused. The GCC page is a list of non-link names of many packages that I don't know how to install, and the Make page leads to a series of tar.lz.sig that also I don't know how to use on Windows. A search for "GCC" led me to CodeBlocks, and I downloaded codeblocks-20.03mingw-setup.exe that supposedly contains the GCC. I ran this exe, it installed CodeBlocks. Then, upon getting launched, CodeBlocks "can't find compiler executable". Some solution online says to fix the path by locating the mingw folder in Program Files, but my Program Files doesn't have a mingw folder. I did a search for "mingw" over my entire C:, and nothing came up. I re-installed codeblocks-20.03mingw-setup.exe and also tried codeblocks-20.03-setup.exe, and I still don't have the mingw folder, CodeBlocks still isn't detecting the GCC.
(By the way, when I was previously setting up GitHub Desktop, I used Git Bash, and in it I might have seen something like "mingw", but after that the app won't launch again when I click on "Open" or "Run as adminstrator" from Windows Start menu.)

VSCode C/C++ Intellisense with Clang/MinGW

I am trying to get Clang to work with VSCode. I've hit success on the terminal, but VSCode is still refusing to cooperate.
Clang on Windows by default targets x86_64-pc-windows-msvc, but the reason I'm using VSCode is I'm avoiding VS in the first place. The solution to this is to pass a target flag: --target=x86_64-w64-windows-gnu. This allows Clang to work with MinGW headers - on the terminal at least.
VSCode detects the presence of both Clang and MinGW-w64, and changing the Intellisense mode to windows-gcc-x64 allows it to work properly. However, changing the compiler path to Clang breaks Intellisense entirely - I've changed the Intellisense mode to windows-clang-x64 and windows-clang-x86, added a hard link at C:\MinGW and C:\mingw64 pointing at the MinGW installation, all to no avail. In all cases $PATH contains the MinGW bin directory, LLVM bin directory, and the MinGW hard link.
Any other ideas on what else I can try to get VSCode to recognize Clang?
Thank you for your time.
There is an easier why to install Clang on Windows without MSVC and it works with intellisense without problems.
go to https://www.msys2.org/ and install mysys2
then open mysys2 terminal and copy those commands to install Clang:
pacman -S mingw-w64-x86_64-clang
pacman -S mingw-w64-x86_64-clang-tools-extra
dont forget to add msys64\mingw64\bin to the SYSTEM PATH variable
Now Intellisense should work
I have also made a video about it if you want to check it : https://youtu.be/5OSO8IRlyXc

MinGW / gcc: The application was unable to start correctly (0xc000007b)

I have been using MinGW and the GNU Fortran compiler for a while in order to compile Fortran programs on Windows, which has always been a successful method. However, I have been getting the following error for the past 4 days:
The application was unable to start correctly (0xc000007b). Click OK to close the application.
The error only happens when running applications that I wrote myself, and that I compiled using the MinGW/gfortran combo. When compiling using Visual Studio and iFort, I have no problem running the applications. The error seems retroactive: applications that were compiled using gfortran a long time ago and ran perfectly until now also break, even though I didn't recompile them. This leads me to think that it is a dynamic library problem. Online searches show that it probably is a compatibility problem between a 64-bit dll and a 32-bit application
I am using Windows 7. One of the latest things I remember doing before starting to get the problem was trying to update MinGW ; I used the mingw-get update and mingw-get upgrade command lines.
After looking around online, I have tried the following fixes:
- reinstalled the Visual C++ Runtime Environment
- reinstalled the .NET framework
- downloaded and replaced a bunch of .dlls like mscvr100.dll, mscvr100d.dll, etc...
- uninstalled and reinstalled MinGW in order to make sure I had the latest gcc version
- run Dependency Walker on a simple application ("Hello World!" type program)
Dependency Walker tells me that a number of .dlls cannot be found (full list: API-MS-WIN-APPMODEL-RUNTIME-L1-1-0.DLL, API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL, API-MS-WIN-CORE-WINRT-L1-1-0.DLL, API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL, API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL, API-MS-WIN-SHCORE-SCALING-L1-1-1.DLL, DCOMP.DLL, GPSVC.DLL, IESHIMS.DLL).
It also highlights in red the libquadmath-0.dll (on which libgfortran-3.dll seems to depend). Indeed, it seems that libquadmath-0.dll is a 64-bit DLL in the middle of a 32-bit program. When opening said .dll with Dependency Walker, I can see that all the modules in this library are x86 except the library itself which is x64 (CPU column of DW). I am not exactly sure how this is possible / how to fix it. The library is found in the Python/Anaconda folder (I installed Python and Anaconda a few weeks ago, the problem did NOT appear at that time).
If anybody has an idea of how to get my environment to work again without reinstalling Windows, I would greatly appreciate it! Thanks!!
I had a similar problem. Looking at Dependency Walker I wasn't loading API-MS-WIN-CORE entries. However, when I went to edit my path it turned out that by bin folder wasn't on the path. Adding, in my case the mingw64 bin folder to the path fixed this issue for me. I only mention the API-MS-WIN-CORE entries since I thought it might be the problem, but in reality it wasn't causing my issue.
I was getting this same error code, and used Dependency Walker to discover that, in my case, the 64-bit version of libwinpthread-1.dll was not being found. This helped me resolve my issue.
So, the solution is to determine the missing dll, track it down on your system and reference its location in your path variable, or find out how to install it if you don't have it.
That said, I also came across the following caveat that's important to know about when using Dependency Walker. It's currently out of date and will actually show false results for WIN-CORE dlls: https://stackoverflow.com/a/36244483/4438237
To work around this, there's a newer program called Dependencies by lucasg, that properly interprets these and won't mistakenly tell you about these falsely missing dlls.
I was getting same Error, as mentioned in above answers the problem is "path not being set" aside from setting path you can alternatively Do this; if u don't want to set the path for some reason:
Open CMD
cd C:\MinGW\bin to navigate to the bin directory of mingw
now u can compile the code as following Gcc (dir of ur .c file) -o (ur output dir) for ex : gcc I:\dir\Hello.c -o I:\dir\output.exe
alternatively if u want to automate the process u can make a batch file to automatically do it for you.
here's the batch file if anyone needs it
#echo off
C:
cd \MinGW\bin\
gcc I:\dir\*.c -o "I:\dir\Output.exe" Rem Replace "dir" with your own directory and * with ur own FileName!
pause
I had a similar error but over came it by editing my environment variables.
I had g77 as part of my path variables and by removing it and leaving gfortran alone, the error disappeared
I was on Windows 10 using cmake-gui to generate a MinGW-w64 project and meet same problem.
My solution: go to start windows, search and open MinGW-w64 terminal, then in terminal call cmake with specifiying cmake options.
Yes the old posts got it right. It is the environmental parameters messed up. I got the same error. It is solved by putting the msys64 path to the first:
Path=c:\msys64\mingw64\bin;%PATH%
The msys64 path was the last, now it is the first. Type it once at the command line after Windows started, or edit the Path environmental parameter if you have the admin right.

How to configure gtk on Visual studio 2010

I have tried configuring gtk+ on visual studio but doesn't work properly.,
Can anyone suggest me with a proper solution, as how to install gtk on Visual studio 2010
I got GTK+ working with VS2010, so if you want to get it working too, get ready for some fun, because this will take a few minutes.
First of all, download the latest Windows All-In-One bundle. Optional direct download link for the GTK 2.24 bundle that I used here. The direct link is to the 32bit version. I have not tested the 64bit version because it is still listed as experimental.
Once you have the bundle downloaded, unzip it into something like C:\gtk or in my case D:\gtk
Next we will create a System Environment Variable for the GTK folder. Open up a command prompt and write: setx GTKDIR {Path to your GTK folder} /m which in my case would be setx GTKDIR D:\gtk /m
We are also going to add the .dll files required for GTK+ built applications to run on Windows into our system PATH. To make things very easy, I suggest you edit your system PATH with PathEditor. Now add the path to the GDK binaries folder which in my case is D:\gtk\bin to the system PATH. Confirm the GTK bin folder has been added to the PATH by typing PATH into your command prompt.
Now we move on to Visual Studio 2010 and create a new project.
File
->New
->Project
Visual C++
->Win32
->Win32 Console Application
Then the Application Wizard Appears.
Click to select:
Windows Application
Empty Project
click Finish to proceed.
Before we add any source files, right click on the project name in the Solution Explorer and click on Properties. Now go to Configuration Properties and then VC++ Directories. We now need to add the include and library files from GTK to the Include Directories and Library Directories.
You should have the following in your Include Directories
$(GTKDIR)\lib\gtk-2.0\include
$(GTKDIR)\lib\glib-2.0\include
$(GTKDIR)\include
and Library Directories:
$(GTKDIR)\lib
While we are still in the view of the Project Properties, click on Linker and then System. Look for SubSystem on the right and click the drop down box. Select Windows /SUBSYSTEM:WINDOWS
Next up, we have to generate the flags for the compiler and the linker. Luckily, GTK+ comes with a nice little tool called pkg-config that we will use to automatically generate these flags for us. The pkg-config tool can be found in the bin folder of GTK. In my case this is D:\gtk\bin or %GTKDIR%\bin using our system variable that we defined earlier. Simply navigate to the bin folder(the created text files will be output there) using the command prompt and run the following:
pkg-config --cflags gtk+-2.0 --msvc-syntax > compilerflags.txt
This will create the compiler flags we need and store them in a text file.
My Result for compiler flags (I have removed the flag -mms-bitfields, this is a gcc only flag that we don't need):
-ID:/gtk/include/gtk-2.0 -ID:/gtk/lib/gtk-2.0/include -ID:/gtk/include/atk-1.0 -ID:/gtk/include/cairo -ID:/gtk/include/gdk-pixbuf-2.0 -ID:/gtk/include/pango-1.0 -ID:/gtk/include/glib-2.0 -ID:/gtk/lib/glib-2.0/include -ID:/gtk/include -ID:/gtk/include/freetype2 -ID:/gtk/include/libpng14
We will do the same for the linker flags:
pkg-config --libs gtk+-2.0 --msvc-syntax > linkerflags.txt
My Result for linker flags:
/libpath:D:/gtk/lib gtk-win32-2.0.lib gdk-win32-2.0.lib atk-1.0.lib gio-2.0.lib pangowin32-1.0.lib gdi32.lib pangocairo-1.0.lib gdk_pixbuf-2.0.lib pango-1.0.lib cairo.lib gobject-2.0.lib gmodule-2.0.lib gthread-2.0.lib glib-2.0.lib intl.lib
With all the needed flags generated, we need to add them to our project. Once again, right click on the project name and click on Properties. Now go to C/C++ and click on Command Line. To the right you should see an empty box called Additional Options. Copy and paste the compilerflags.txt content into this box.
After finishing the above, click on Linker and then Command Line. Once again, simply copy and paste the contents of the linkerflags.txt file into the Additional Options box. While we are here, add one last linker flag /ENTRY:mainCRTStartup This flag tells Visual Studio that we want to use the standard main() rather than Microsoft's _tmain() as our main program entry point.
Finally, in the Source Files folder, create and add a new .cpp file with the following:
#include <gtk-2.0\gtk\gtk.h>
int main(int argc, char* argv[])
{
gtk_init(&argc, &argv);
GtkWidget* window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_set_usize(window, 300, 200);
g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL);
gtk_window_set_title(GTK_WINDOW(window), "GTK+ with VS2010");
gtk_widget_show(window);
gtk_main();
return 0;
}
Everything should now be ready to compile, link and run. If all went well, you should be greeted by the following:
Well that was fun, right? :)
If you're building GTK+ stack on Windows with the help of a guide like this, then the luxuries of using a precompiled binary will not be at your disposal.
In this case I would suggest the following approach.
Download the precompiled binaries - This has two advantages.
This ships with the pkg-config.exe utility which you could use for the compiled source.
This also contains the pkgconfig folder with a wealth of .pc files which can be adapted for the compiled source.
Compile the packages in the debug/release mode - well this is the main advantage of compiling it yourself - and systematically arrange the headers, libs and dlls/exe in include, lib and bin folder respectively.
Copy the pkgconfig folder from the precompiled_gtk_source\bin to compiler_gtk_source\bin and set the path of the PKG_CONFIG_PATH variable
to add the compiler_gtk_source\bin\pkgconfig to it.
Now, considering the fact the names of the libraries produced on compiling gtk yourself and the corresponding library names in the precompiled package may be different, you might have to make the necessary changes in compiler_gtk_source\bin\pkgconfig*.pc files. I would go for a top-to-bottom approach here( We will see the advantages shortly). By top-to-bottom, I simply
mean that the end product will be the one to be edited first.
For example in this case the gtk+ is the end product and I will go for
configuring the .pc of this package first. The procedure is as follows:
First look at the name of the dll created. In my case it is gtk-3.0. If the .pc file that was shipped with the precompiled binaries have another name, then change the name appropriately - in my case it is gtk-3.0.pc. (This should be the case with all the other .pc files.)
Open the gtk-3.0.pc in a text editor and you will see stuff like below.
gtk-3.0.pc file:
prefix=c:/gtk_compilation/vs12/win32
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
targets=win32
Name: GTK+
Description: GTK+ Graphical UI Library
Version: 3.18.2
Requires: gdk-3.0 atk-1.0 cairo cairo-gobject gdk_pixbuf-2.0 gio-2.0
Requires.private: atk
Libs: -L${libdir} -lgtk-3
Cflags: -I${includedir}/gtk-3.0 -mms-bitfields
The one above is my customized file. If you don't know what each line does,
you could have a look at pkg-config help. The Require option,
however, needs a special mention. It is the place where you put the
dependancy dlls - again make sure that the name of the dlls exactly
matches what you have in your bin folder.
We need to recursively change the .pc files for the dlls which are included after the Require statement and if any .pcs are missing or if there is a name mismatch, you could make the appropriate changes. By now, you should already have understood the advantage of top-to-bottom approach. It helps us to sort out dependency .pc files systematically until we sort out all of them.
Now, run the below command to see if things are working.
Finally run the pkg-config command like below :
pkg-config --cflags gtk-3.0 --msvc-syntax > compilerflags.txt
pkg-config --libs gtk+-2.0 --msvc-syntax > linkerflags.txt
I just redirected the results to a text file named compilerflags.txt & linkerflags.txt so that you could use them any time you want by cut,copy & paste. Ofcourse, you should retain only the compiler specific flags.
Hope this helps somebody, sometime.
Give a look at this GTK+ with Visual Studio 2008 tutorial.

Resources