I wish to run a make file from the command line in windows. I usually am not using windows but now I have to so how can I run a make command?
I wish to run a make file from the command line in windows. I usually am not using windows but now I have to so how can I run a make command?
I went to this website Make for Windows downloaded Complete package, except sources and tried to add it as a path variable but still does not work. Any help?
Doesn't work how?
It just plain out was not working, but I found out the make command was already included in my compiler named "mingw32-make". I have another question though, I am trying to compile in gtk and it will not work. When run the make file doing mingw32-make it says I have an error "unrecognizable option '-pthread' " I tried taking it out and then it gave me an error saying in the source file of the .c program there was a fatal error gtk/gtk.h: no such file or directory complication terminated.
"unrecognizable option -pthread" sounds like you're trying to use a UNIX makefile on Windows -- that won't work!! Apart from obvious things like 'make clean' calling 'rm' which doesn't exist on Windows, any OS specific predefines passed to the compiler will be wrong, and unsupported stuff like -phreads will be attempted. You *can't* use a UNIX makefile on Windows -- just thought I'd repeat that (unless you use Cygwin, but I haven't had 100% luck with UNIX makefiles on there either).
Either way if you haven't already, get the Windows version:
GTK+ Download: Windows (32-bit)
Maybe they have an example Windows makefile you can steal from.
Missing file error is pretty obvious: you need to set up your include paths ("-I <directory>" ) to point to gtk's include directory and the include dirs of any dependencies it has. You'll also need to fix your link line to link the gtk library. I don't really know how your makefile is laid out so can't suggest specific changes, just make a copy of it and make it Windows friendly I guess.
Are you trying to build gtk for yourself, or just build a gtk program you've written (assuming gtk installed correctly)?
If you've got mingw installed, you should have all the basic tools you need to write makefiles, providing you have PATH setup correctly.
Moved to tech.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
The GTK program is already written by me and I know for a fact it works. The makefile also works. Here is my makefile I am confused at what I should switch.
I believe I have GTK on this computer already.Code:#Makefile to compile and link the GTK+ helloworld program #gcc -Wall -g gtk_hello.c `pkg-config --cflags gtk+-2.0` -o gtk_helloworld `pkg-config --libs gtk+-2.0` GTK_INCLUDE = -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 GTK_LIB = -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0 CC = gcc -g -Wall gtk_calculator: gtk_calculator.c $(CC) gtk_calculator.c $(GTK_INCLUDE) -o gtk_calculator $(GTK_LIB) clean: rm -f *.o *~ helloworld
Seriously. UNIX makefile won't work. Won't work!!!
These paths after the -I are your include paths. They're where the compiler will look for file.h in #include "file.h". They're all UNIX paths though. Below it is a list of libraries to link with that may or may not be right.Code:-I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include
I've never used pkg-config but seems like it's the way to get this right:
freedesktop.org - Software/pkg-config
Instructions to use here:
Compiling Hello World
Maybe you already got it with the gtk installation. Anyway, run that, and replace the GTK_INCLUDE and GTK_LIB lines in the makefile with the stuff it spits out.