Author Topic: Compile errors in Slackware 10.2  (Read 7995 times)

nostromo

  • Guest
Compile errors in Slackware 10.2
« on: November 30, 2006, 09:23:47 am »
I read the wiki about installing C::B from source and I also tried to find
some answers searching this forum but I couldn't find any.
I tried to install the the package for Slackware which I found here
(codeblocks-1.0.0.svn.3253-i686-1jsa.tgz) and it worked out of a box,
but when I try to build my own package from source then I get some errors.
I have installed wxGTK-2.6.3-i486-1asz.tgz which I found at linuxpackages
and I downloaded latest SVN build of C::B build 3295.
After 'make' I get these errors:

*****************************************************************************
ccoptionsdlg.cpp: In member function `bool
   CCOptionsDlg::ValidateReplacementToken(wxString&, wxString&)':
ccoptionsdlg.cpp:149: error: `wxRegEx' undeclared (first use this function)
ccoptionsdlg.cpp:149: error: (Each undeclared identifier is reported only once
   for each function it appears in.)
ccoptionsdlg.cpp:149: error: syntax error before `(' token
ccoptionsdlg.cpp:152: error: `re' undeclared (first use this function)
make[4]: *** [ccoptionsdlg.lo] Error 1
make[4]: Leaving directory `/usr/src/rpm/SOURCES/codeblocks-rev3295/src/plugins/codecompletion'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/src/rpm/SOURCES/codeblocks-rev3295/src/plugins/codecompletion'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/src/rpm/SOURCES/codeblocks-rev3295/src/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/rpm/SOURCES/codeblocks-rev3295/src'
make: *** [all-recursive] Error 1
********************************************************************************

Please help me to understand how to compile it. I especially beg those
who are using Slackware to help me.

I must say that C::B is very good software for me because it has such great
features which are very helpfull for people who are trying to learn cpp like me.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Compile errors in Slackware 10.2
« Reply #1 on: November 30, 2006, 09:29:47 am »
this should already been have fixed in a later revision --> update your sources again please

Offline manciuleas

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compile errors in Slackware 10.2
« Reply #2 on: November 30, 2006, 12:01:29 pm »
Hi,

I had similar problems when compiling codeblocks on Slackware 11.0 using the wxGTK package you mentioned. It turned out that the wxGTK package misses some libraries, so I had to compile the whole wxWidgets stuff on my own. Afterwards it compiled without problems. I used the scripts (wxwidget.SlackBuild) found at http://www.slackbuilds.net/forum/viewtopic.php?pid=957 and the sources from http://prdownloads.sourceforge.net/wxwindows/wxWidgets-2.6.3.tar.gz.

Regards

nostromo

  • Guest
Re: Compile errors in Slackware 10.2
« Reply #3 on: November 30, 2006, 01:04:33 pm »
@manciuleas
and how did you implement/use that script?
I tried to run it in unpacked wxwidget dir but it gave me:
impossible d'exécuter ce programme !

I don't speak French so I couldn't understand what do I need to
with it.

Offline manciuleas

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compile errors in Slackware 10.2
« Reply #4 on: November 30, 2006, 01:15:36 pm »
This means that you ran the script as root. Either run it as an ordinary user or comment the following lines in the script:

# ------------------------------
# Action !
# ------------------------------
# est-ce l'utilisateur root ?
# if test $UID -eq 0; then
#     echo "impossible d'exécuter ce programme !"
#     exit
# else

....

#fi (on the last line)

nostromo

  • Guest
Re: Compile errors in Slackware 10.2
« Reply #5 on: November 30, 2006, 05:23:48 pm »
No that didn't help me. I also tried to build wxGTK in the way it
was mentioned in wiki. I installed it and then I tried to build C::B
,without success because in the end I got these errors:

**********************************************************************
macrosmanager.cpp: In member function `void
   MacrosManager::ReplaceMacros(wxString&, ProjectBuildTarget*, bool)':
macrosmanager.cpp:356: error: `LoadBufferRedirectOutput' undeclared (first use
   this function)
macrosmanager.cpp:356: error: (Each undeclared identifier is reported only once
   for each function it appears in.)
make[4]: *** [macrosmanager.lo] Error 1
make[4]: Leaving directory `/usr/src/rpm/SOURCES/Codeblocks-1.0-rev3315/src/sdk'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/src/rpm/SOURCES/Codeblocks-1.0-rev3315/src/sdk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/rpm/SOURCES/Codeblocks-1.0-rev3315/src/sdk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/rpm/SOURCES/Codeblocks-1.0-rev3315/src'
make: *** [all-recursive] Error 1
***********************************************************************

I really don't know what more should I do. Please help me.

@manciuleas
when I tried your script, I managed to build a wxGTK package and I
installed it as it was but in the end after issuing ./bootstrap in C::B dir
I received an error that wxGTK is not installed!?!?!

Offline manciuleas

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compile errors in Slackware 10.2
« Reply #6 on: November 30, 2006, 06:23:55 pm »
You should not build only the wxGTK package, but the whole wxWidgets library. Use the source I pointed you to.
Below is the wxwidgets.SlackBuild script I'm using. You have to replace -mtune with -mcpu because you're using Slack 10.2. Additionally create a file doinst.sh in the same directory where the wxwidgets.SlackBuild script and the source are and insert this command:
( cd usr/bin ; ln -sf /usr/lib/wx/config/gtk2-unicode-release-2.6 wx-config )
Don't forget to hit enter at the end of the line and also to set the execution bits (chmod +x doinst.sh).

wxwidgets.SlackBuild

*************** cut here ****************

#! /bin/bash

# SlackBuild pour construire le paquet 'wxWidgets' .tgz (Slackware).
# $Id: wxwidgets.SlackBuild,v 1.2 2006-08-25 17:51:53+02 olivier Exp $
#
# Certains paramètres sont nécessaires, afin de pouvoir
# installer plus tard wxPython.
# Choix du gui -> GTK+.
# Désactivation du support pour l'OpenGL.
#


# ------------------------------
# Variables  configurer
# ------------------------------
ARCH=${ARCH:-i486} # architecture du processeur
NAME="seb"         # initiales du contributeur (3 lettres)
BUILD=${BUILD:-2}  # version du paquet

SOURCE="wxWidgets-2.6.3.tar.gz"
OPT="--enable-gui --enable-shared --enable-optimise
--disable-debug --enable-compat24 --enable-sockets
--enable-geometry --enable-unicode --enable-display
--with-gtk2 --without-opengl --enable-threads"
#DOC=

CWD="$PWD"
PKG="$CWD/build-wxWidgets"
LOGS="$CWD/logs"


# ------------------------------
# Variables du ./configure
# ------------------------------
if test $ARCH = "i386"; then
    CPUOPT="-O2 -march=$ARCH -mtune=i686"
elif test $ARCH = "i486"; then
    CPUOPT="-O2 -march=$ARCH -mtune=i686"
elif test $ARCH = "i686"; then
    CPUOPT="-O2 -march=$ARCH -mtune=i686"
elif test $ARCH = "x86_64"; then
    CPUOPT="-O2 -march=$ARCH"
fi
PREFIX="/usr"
SYSCONFDIR="/etc"
LOCALSTATEDIR="/var"


# ------------------------------
# Fonctions
# ------------------------------
# renvoie un tableau
function splitUp()
{
    # variable
    declare -a array

    # nb total d'éléments
    n=$(echo $1 | gawk -F . '{print NF;}')

    # est-ce un tarball ?
    if test `echo $1 | cut -d . -f $(( n - 1 ))` = "tar"; then
        # le prfixe
        array=("${array
  • }" $(echo $1 | cut -d . -f 1-$(( n - 2 ))))

        # l'extension
        array=("${array
  • }" $(echo $1 | cut -d . -f $(( n - 1 ))-$n))

    else
        # le préfixe
        array=("${array
  • }" $(echo $1 | cut -d . -f 1-$(( n - 1 ))))

        # l'extension
        array=("${array
  • }" $(echo $1 | cut -d . -f $n))

    fi

    # on retourne le tableau
    echo ${array
  • }

}


# décompresse une archive
function unpack()
{
    # tar.gz
    if test $2 = "tar.gz"; then
        tar -xzf $1

    # tar.bz2
    elif test $2 = "tar.bz2"; then
        tar -xjf $1

    # tous les autres
    else
        # on retourne un code d'erreur
        return 1
    fi
}


# configuration + compilation /!\ SPÉCIFIQUE À CE PAQUET /!\
function compil()
{
    cd $1

    # répertoire des journaux
    mkdir $LOGS

    # configure
    CFLAGS="$CPUOPT" \
    CXXFLAGS="$CPUOPT" \
    ./configure --prefix=$PREFIX \
        --sysconfdir=$SYSCONFDIR \
        --localstatedir=$LOCALSTATEDIR \
        --build=$ARCH-slackware-linux-gnu \
        $OPT 2>&1 | tee > "$LOGS/config-$1.log"

    # le fichier Makefile existe-t-il ?
    if test -e "Makefile"; then
        # compilation
        make \
            2>&1 | tee > "$LOGS/make-$1.log" \
            && make -C contrib/src/animate \
            2>&1 | tee >> "$LOGS/make-$1.log" \
            && make -C contrib/src/gizmos \
            2>&1 | tee >> "$LOGS/make-$1.log" \
            && make -C contrib/src/stc \
            2>&1 | tee >> "$LOGS/make-$1.log" \
            && make -C contrib/src/svg \
            2>&1 | tee >> "$LOGS/make-$1.log" \

        # installation
        make DESTDIR=$PKG install \
            2>&1 | tee > "$LOGS/install-$1.log" \
            && make -C contrib/src/animate DESTDIR=$PKG install \
            2>&1 | tee >> "$LOGS/install-$1.log" \
            && make -C contrib/src/gizmos DESTDIR=$PKG install \
            2>&1 | tee >> "$LOGS/install-$1.log" \
            && make -C contrib/src/stc DESTDIR=$PKG install \
            2>&1 | tee >> "$LOGS/install-$1.log" \
            && make -C contrib/src/svg DESTDIR=$PKG install \
            2>&1 | tee >> "$LOGS/install-$1.log" \

        # nettoyage
        make clean 1> /dev/null \
            && make -C contrib/src/animate clean 1>/dev/null \
            && make -C contrib/src/gizmos clean 1>/dev/null \
            && make -C contrib/src/stc clean 1>/dev/null \
            && make -C contrib/src/svg clean 1>/dev/null
    else
        # on retourne un code d'erreur
        return 1
    fi
}


# rédaction du slack-desc
function slackdesc()
{
    cat > "$1/slack-desc"<<EOF
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
         |------handy-ruler-----------------------------------------------------|
wxwidgets: wxWidgets for GTK+
wxwidgets:
wxwidgets: wxWidgets is a free C++ library for cross-platform GUI development.
wxwidgets: With wxWidgets, you can create applications for differents GUIs
wxwidgets: (GTK+, Motif, MS Windows, MacOS X, Windows CE, GPE) from the same
wxwidgets: source code.
wxwidgets:
wxwidgets:
wxwidgets:
wxwidgets: Package created by $USER
wxwidgets:
EOF
}


# ------------------------------
# Action !
# ------------------------------
# est-ce l'utilisateur root ?
# if test $UID -eq 0; then
#     echo "impossible d'exécuter ce programme !"
#     exit
# else
    # l'archive existe-t-elle ?
    if test -e $SOURCE; then
        # variable
        declare -a array
        array=(`splitUp $SOURCE`)

        # on décompresse l'archive
        unpack $SOURCE ${array[1]}

        # est-ce que tout semble ok ?
        if test $? -eq 0; then
            # création du répertoire du futur paquet
            mkdir $PKG

            # compilation
            compil ${array[0]}

            # est-ce que tout semble ok ?
            if test $? -eq 0; then
                cd $CWD

                # documentation
                mkdir -p "$PKG/usr/doc/${array[0]}"
                for i in `ls $CWD/${array[0]}/docs/*.txt`; do
                    cp -a "$i" "$PKG/usr/doc/${array[0]}"
                done
                cp -aR "$CWD/${array[0]}/docs/gtk/" \
                    "$PKG/usr/doc/${array[0]}"

                # slack-desc
                mkdir -p "$PKG/install"
                slackdesc "$PKG/install"

                # suppression du lien symbolique
                if test -f "$PKG/usr/bin/wx-config"; then
                    rm "$PKG/usr/bin/wx-config"
                    cp -a "$CWD/doinst.sh" "$PKG/install"
                fi


                # création du paquet
                PACKAGE="cd $PKG; chown -R root:root .;
                chown -R root:root ./usr/bin;
                /sbin/makepkg -l y -c n $CWD/${array[0]}-$ARCH-$NAME$BUILD.tgz;
                cd ..; rm -Rf $PKG"

                # root
                su -c "$PACKAGE"
            else
                printf "Erreur: vérifiez les journaux dans %s\n" $LOGS
            fi

            cd $CWD

            # nettoyage
            rm -Rf ${array[0]}
        else
            echo "Le programme s'est arrêté prématurément !"
            exit
        fi
    else
        echo "L'archive est introuvable !"
        exit
    fi
#fi

*************** cut here ****************

nostromo

  • Guest
Re: Compile errors in Slackware 10.2
« Reply #7 on: November 30, 2006, 09:26:00 pm »
 :oops:have a problem with this:
Erreur: vérifiez les journaux dans /home/user/Download/build/logs

Offline manciuleas

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compile errors in Slackware 10.2
« Reply #8 on: November 30, 2006, 10:24:06 pm »
This means that you have an error. Look into the log files. Have you replaced -mtune with -mcpu?

Offline manciuleas

  • Multiple posting newcomer
  • *
  • Posts: 20
Re: Compile errors in Slackware 10.2
« Reply #9 on: November 30, 2006, 10:26:29 pm »
And you should *not* unpack the sources. Just run wxwidgets.SlackBuild in the directory where you downloaded wxWidgets-2.6.3.tar.gz. And, don't forget to have doinst.sh present in the same directory.

nostromo

  • Guest
Re: Compile errors in Slackware 10.2
« Reply #10 on: November 30, 2006, 11:06:13 pm »
The config-.log said:
./wxwidgets.SlackBuild.sh: line 107: ./configure: No such file or directory

nostromo

  • Guest
Re: Compile errors in Slackware 10.2
« Reply #11 on: December 01, 2006, 11:39:41 am »
I managed to build wxWidgets package, I installed it, did ldconfig.
After that, I tried to build C::B and it gave me these errors:

************************************************************************
macrosmanager.cpp: In member function `void
   MacrosManager::ReplaceMacros(wxString&, ProjectBuildTarget*, bool)':
macrosmanager.cpp:356: error: `LoadBufferRedirectOutput' undeclared (first use
   this function)
macrosmanager.cpp:356: error: (Each undeclared identifier is reported only once
   for each function it appears in.)
make[4]: *** [macrosmanager.lo] Error 1
make[4]: Leaving directory `/usr/src/rpm/SOURCES/Codeblocks-1.0-rev3315/src/sdk'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/src/rpm/SOURCES/Codeblocks-1.0-rev3315/src/sdk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/rpm/SOURCES/Codeblocks-1.0-rev3315/src/sdk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/rpm/SOURCES/Codeblocks-1.0-rev3315/src'
make: *** [all-recursive] Error 1
**************************************************************************

and that's it. :?
I'm appealing the developers to make this little bit easier.
I spent hours and hours (more like days) trying to build this
package without any decent result.

nostromo

  • Guest
Re: Compile errors in Slackware 10.2
« Reply #12 on: December 01, 2006, 05:13:26 pm »
There is some problem with the 'make', after I issued it I got those
errors that you can see in previous post. So I looked around and noticed
that there is no macrosmanager.lo, instead there was macrosmanager.loT.

nostromo

  • Guest
Re: Compile errors in Slackware 10.2
« Reply #13 on: December 03, 2006, 01:58:41 pm »
Anyone, please???