A good practice for compiling?
This is silly, but I use Mandrake 9.1. I have NEVER been able to compile anything. yes, I've heard of the good old ./configure, make, make install but it NEVER works. There's always some error that comes out of all this and it's really annoying. So as a compiling n00b, can someone refer me to an easy program that can be compiled easily so I can tell myself "YES! I actually compiled something without a problem!!!"
|
Try this:
1) Create a file called "hi.c" containing: Code:
#include <stdio.h> gcc hi.c -o hi 3) Run it: ./hi The chances are that you have some key libraries missing which are causing your other compilation problems. The next time you try to compile something post the last lines of the otuput where the error first occured and somebody should be able to help. Also try googling for the error you receive. |
Cool! I don't know what the programming lingo is, but it worked! Now I want to move onto the "real" stuff. Any other easy software compilations? cheesy 2D games? text based stuff?
|
Why not choose a program that you actually want to run?
I don't really see the point in compiling random software. |
Okay, if you really want to help out a compiling n00b, then my next software to get is XMMS. I'll post my errors when I get home and let's see if you guys can help me out. :eek:
|
No problem. I'm subscribed to the thread so if you get any errors just post them along with the "./configure" string you used and the version of the software you are installing.
side note: I'm not sure what you are intending to use xmms for exactly but most people would probably suggest mplayer over xmms: http://www.linuxquestions.org/questi...hreadid=116684 |
At the end, it says I don't have glib 1.2.2 installed, but when I do URPMI glib, it says I have everything already installed. What do I do?
----------------------------------------------------- [ken@localhost xmms-1.2.10]$ ./configure checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for prefix by checking for xmms... /usr/bin/xmms checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for strerror in -lcposix... no checking whether byte ordering is bigendian... no checking for inline... inline checking for an ANSI C-conforming const... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for glib-config... no checking for GLIB - version >= 1.2.2... no *** The glib-config script installed by GLIB could not be found *** If GLIB was installed in PREFIX, make sure PREFIX/bin is in *** your path, or set the GLIB_CONFIG environment variable to the *** full path to glib-config. configure: error: *** GLIB >= 1.2.2 not installed - please install first *** |
Most of the time, when ./configure reports something missing, it is actually the devel files that are missing. Here, you should probably try something like urpmi glib-devel.
If you want to be sure, do that: # urpmf /glib-config$ <the_good_package>: /usr/.../glib-config # urpmi <the_good_package> Yves. |
Quote:
Code:
[root@localhost ken]# urpmf /glib-config$ [ken@localhost xmms-1.2.10]$ ./configure checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for prefix by checking for xmms... /usr/bin/xmms checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for strerror in -lcposix... no checking whether byte ordering is bigendian... no checking for inline... inline checking for an ANSI C-conforming const... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for glib-config... /usr/bin/glib-config checking for GLIB - version >= 1.2.2... yes checking for gtk-config... no checking for GTK - version >= 1.2.2... no *** The gtk-config script installed by GTK could not be found *** If GTK was installed in PREFIX, make sure PREFIX/bin is in *** your path, or set the GTK_CONFIG environment variable to the *** full path to gtk-config. configure: error: *** GTK+ >= 1.2.2 not installed - please install first ** |
So did you install GTK and GTK-devel
|
Quote:
urpmi GTK and urpmi GTK-devl :confused: |
urpmi gtk brings me this:
[root@localhost ken]# urpmi gtk The following packages contain gtk: libgtk+mdk0.1_6 pygtk2.0-libglade gtkasp2php amaya-gtk libgtkhtml2_0-devel libgtkglarea5-devel php-gtk libgtkmm1.2-devel nautilus-gtkhtml libgtk+extra0-devel pygtk2.0-wrapper libgtkhtml1.1_3 gtk+2.0 rep-gtk ggz-gtk-games libgtkxmhtml1 gtk-doc libgtkspell0-devel libexif-gtk4-devel gtk+mdk libgtkglext1 gtkpod hotplug-gtk libwxgtk2.5-devel pygtk-libglade gtkwave ruby-gtk gtkgep gtk+licq gtktetris libgtk+-x11-2.0_0-devel ocaml-lablgtk gtkgraph gtklp libgtkglarea2.0-devel gtkfind rep-gtk-libglade gtkmotd libgtk+extra0 libgtk+2.0_0 pygtk2.0-glarea gtkhx gtk-theme-switch unixODBC-gui-gtk gtkdialogs gtkam guile-gtk-1.2 ggz-gtk-client gtk-theme-switch2 gnome-python-gtkhtml2 libgtk+mdk0.1_6-devel gtkeyboard fvwm2-gtk gtkhtml gtk+licq-nognome libgtk+1.2-devel gtktalog libwxgtkgl2.4 libwxgtk2.5 pygtk2.0-devel gocr-gtk libwxgtk2.4 pygtk libgtk+-linuxfb-2.0_0-devel mtr-gtk libgtk+1.2 gtk+licq-base gtk-gnutella pygtk-glarea libexif-gtk4 gtk-themes libguile-gtk-1.2_0-devel libgtkhtml1.1_3-devel libgtkglarea5 libgtk+-x11-2.0_0 gtk-engines libgtkspell0 libgtkglarea2.0 pygtk2.0 libguile-gtk-1.2_0 rep-gtk-gnome libgtkmm1.2 gtk-engines2 pygtk-devel libgtkodbcconfig0 libgtkhtml2_0 crossfire-client-gtk alsaplayer-plugin-ui-gtk mt_gtk_client libgtkglext1-devel libgtk+-linuxfb-2.0_0 libwxgtk2.4-devel libgtk+2.0_0-devel Now what?? |
urpmi GTK-devel
|
this is what happened:
Code:
[root@localhost mplayerplug-in]# urpmi GTK-devel (THis isn't looking good) [ken@localhost xmms-1.2.10]$ ./configure checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for prefix by checking for xmms... /usr/bin/xmms checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for strerror in -lcposix... no checking whether byte ordering is bigendian... no checking for inline... inline checking for an ANSI C-conforming const... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for glib-config... /usr/bin/glib-config checking for GLIB - version >= 1.2.2... yes checking for gtk-config... no checking for GTK - version >= 1.2.2... no *** The gtk-config script installed by GTK could not be found *** If GTK was installed in PREFIX, make sure PREFIX/bin is in *** your path, or set the GTK_CONFIG environment variable to the *** full path to gtk-config. configure: error: *** GTK+ >= 1.2.2 not installed - please install first *** Help! :cry: |
do
configure --prefix=/usr |
Quote:
That will end up with exactly the same result. You need the development libraries for GTK1. Do you have a /usr/include/gtk-1.x or /usr/local/include/gtk-1.x directory? If not then you need to install GTK1 development package, libgtk+1.2-devel looks like the one (I don't use mandrake, so can not say 100%). |
Quote:
Code:
[ken@localhost include]$ ls g*.* |
Quote:
nope. the default prefix on most systems is /usr/local for compiled apps. and gtk apps are stubborn about needing the same prefix as gtk. |
Quote:
|
there are going to be many packages that you will need probably. don't get worked up. i was only arguing above about the default installation location. if either of us is right, run
configure --prefix=/usr post the error message at the end, and we'll get the next thing, which is probably libgtk+1.2-devel. |
Quote:
Here we go: [ken@localhost xmms-1.2.10]$ ./configure --prefix=/usr checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for strerror in -lcposix... no checking whether byte ordering is bigendian... no checking for inline... inline checking for an ANSI C-conforming const... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for glib-config... /usr/bin/glib-config checking for GLIB - version >= 1.2.2... yes checking for gtk-config... no checking for GTK - version >= 1.2.2... no *** The gtk-config script installed by GTK could not be found *** If GTK was installed in PREFIX, make sure PREFIX/bin is in *** your path, or set the GTK_CONFIG environment variable to the *** full path to gtk-config. configure: error: *** GTK+ >= 1.2.2 not installed - please install first *** :cry: |
Where is "gtk-config" on your system?
locate gtk-config |
Quote:
Code:
[ken@localhost ken]$ locate gtk-config Code:
[root@localhost ken]# urpmi gtk-config |
maybe your locate database hasn't been updated since you installed gtk-devel. that's what the gtk-config is part of. it should be in /usr/bin/. it's a text file. if you have an older version of gtk installed than that version of xmms wants, you might can try an older version of xmms or you may have to compile a newer version of gtk. 2.0 and up broke compatibility with lower versions, if i remember correctly. the problem is you can mess stuff up on your system trying to do that. i think the glib and gtk versions have to match.
|
Quote:
I just had this thought that I could uninstall xmms 1.2.7 (my current version), and just URPMI xmms for the more recent 1.2.10 version? I think I'm just going to give up on this compiling business. It just was never meant to be. :cry: |
Quote:
I use LFS so have compiled EVERYTHING myself. I use /usr/local for testing and anything I want to keep going in /usr.... I have compiled and run many gtk apps to/from /usr/local with gtk in /usr. I would guess that your PATH, PKG_CONFIG_PATH and/or ld.so.conf is incorrect if you have problems doing this. Anyhoo... Micro420, you have the GTK2 dev stuff, but not GTK1. They are different, i.e. GTK1 apps will not compile or run with GTK2 and v v. They can be installed in parrallel. Install libgtk+1.2-devel like I said in my previous post. |
sometimes they do. sorry i was so dismissive of your first post.
http://www.linuxquestions.org/questi...388#post617388 |
ok what you want to do is go back into the install package thing. In there install the entire development tree. A lot of people skip that because they figure that they won't be developing anything, but it is still needed to compile programs.
|
Quote:
I kind of agree with you, but this is a package thing (rpm, dep etc etc) not a glib/gtk etc thing. If the pkgconfig ({,/usr,/usr/X11R6,/usr/local,/opt}/lib/pkgconfig/*.pc etc) files are available through PKG_CONFIG_PATH, the xxxx-config files are in the PATH, {,/usr,/usr/X11R6,/usr/local,/opt}/lib etc are in ld.so.conf and ldconfig has been executed, then all should be ok. There can be problems when something has been built in say /usr/local and moved to /usr because anything that looks for it's component files in it's .pc file will be looking in /usr/local, not /usr. In other words... if you are compiling anything, I would suggest that you have at least the following in your ~/.profile PATH="/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/opt/bin" PKG_CONFIG_PATH="/usr/lib/pkgconfig:/usr/X11R6/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/lib/pkgconfig" And, at least the following in ld.so.conf (run ldconfig after updating): /lib /usr/lib /usr/X11R6/lib /usr/local/lib /opt/lib Running ldconfig after installing anything cannot hurt, even if it may be unneccesary. And finally, do not move files around unneccesarily. If you want something in /usr, use ./configure --prefix=/usr, do not copy it from /usr/local |
No, the --prefix has nothing to do with where resources are located. --prefix is used for the location of the program you're compiling.
I had a similar problem with avifile, which could not find what was obviously present: qt3! I had to run ./autogen.sh before using ./configure. Maybe this is the solution for you, too... Good luck! Yves. |
All times are GMT -5. The time now is 10:28 PM. |