News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Problem building on Linux

Started by lesnewell, March 20, 2021, 02:53:34 PM

Previous topic - Next topic

lesnewell

I just tried building from source in Ubuntu 18.04.

svn checkout svn://svn.code.sf.net/p/codeblocks/code/trunk
cd trunk
./bootstrap
./update-revision.sh
./configure --with-contrib=all
make
sudo make install

No errors were reported in make but when I try to run it I get:
codeblocks: symbol lookup error: codeblocks: undefined symbol: _ZTI32IncrementalSelectIteratorIndexed

Does anyone have any idea what went wrong?

Suryavarman

Here my script for mageia:

I build wxWidgets and C::B


# \see https://github.com/wxWidgets/wxWidgets.git
export WX_TAG="v3.1.4"

function install_dependencies()
{
    su
    urpmi autoconf libtool automake lib64squirrel-devel hunspell hunspell-fr hunspell-en lib64hunspell-devel lib64wxgtku3.0-devel lib64tinyxml-devel lib64gamin-devel
    exit
}

# A lancer avant pour être certain d'avoir le nécessaire pour construire le projet.
# install_dependencies

# Absolute path to this script, e.g. /home/user/bin/foo.sh
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
cd "$SCRIPTPATH"

export CXX=g++
export CC=gcc

export OUT_WX="$SCRIPTPATH/bin/wxwidgets"
export OUT_CB="$SCRIPTPATH/bin/codeblocks"

function wxwidgets_build()
{
    cd wxwidgets-code
    git reset --hard
    git clean -f -d
    git pull
    git checkout "tags/$WX_TAG"
    git submodule update --recursive

    cd "$SCRIPTPATH"
    if [ ! -d ./bin ]; then
        mkdir bin
    fi
    cd bin
    if [ -d "$OUT_WX" ]; then
        rm -r -v -f "$OUT_WX"
    fi
    mkdir wxwidgets
    cd wxwidgets

    "$SCRIPTPATH/wxwidgets-code/configure" --disable-debug --disable-debug-flag --enable-unicode --enable-cxx11 --with-opengl --with-expat=builtin --with-libjpeg=builtin --with-libpng=builtin --with-regex=builtin --with-libtiff=builtin --with-zlib=builtin
   
    nice make -j $(($(nproc) -1))
}

function codeblocks_build()
{
    cd "$SCRIPTPATH"
    if [ ! -d ./bin ]; then
        mkdir bin
    fi
    cd bin
    if [ -d "$OUT_CB" ]; then
        rm -r -v -f "$OUT_CB"
    fi
    mkdir codeblocks
   
    cd "$SCRIPTPATH"
    cd codeblocks-code
   
    read -r -p 'Souhaitez vous reconstruire Codeblocks ou repartir de la précédente compilation? ( taper "o" pour oui ou "n" pour non ): '
    if [ "${REPLY}" == 'o' ]; then
        svn cleanup
        svn revert --recursive .
        svn update
       
        # vous pouvez faire : «cd codeblock-code | svn cleanup --remove-unversioned avant de
        # lancer le script pour tre sžre de re-partir zŽro.
        if [ -f ./configure ]; then
            make clean
            make distclean
            make clean-bin
            make clean-zipfiles
        else
            ./bootstrap
        fi

        ./configure --disable-pch --with-wx-config="$OUT_WX/wx-config" --prefix=$OUT_CB --with-contrib-plugins=all
    fi
   
    make -j $(($(nproc) -1))
    make install
}

if [ ! -d ./wxwidgets-code ]; then
    git clone https://github.com/wxWidgets/wxWidgets.git wxwidgets-code
    cd wxwidgets-code
    git submodule update --init --recursive
    wxwidgets_build
else
    read -r -p 'Souhaitez vous re-compiler wxWidgets? ( taper "o" pour oui ou "n" pour non ): '
    if [ "${REPLY}" == 'o' ]; then
        wxwidgets_build
    fi
fi

if [ ! -d ./codeblocks_code ]; then
    svn checkout http://svn.code.sf.net/p/codeblocks/code/trunk codeblocks-code
fi
codeblocks_build
   

oBFusCATed

Quote from: lesnewell on March 20, 2021, 02:53:34 PM
Does anyone have any idea what went wrong?
Yes, most probably you're mixing libcodeblocks.so from different versions.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

lesnewell

Quote from: oBFusCATed on March 20, 2021, 06:02:32 PM
Yes, most probably you're mixing libcodeblocks.so from different versions.
Thanks. As far as I know there isn't any other copy of codeblocks installed on the system. I did have the Ubuntu packaged version of CodeBlocks installed but I uninstalled it before building this copy.

lesnewell

OK, apt remove codeblocks leaves libcodeblocks behind. I needed to apt remove libcodeblocks.

Next issue. When I run codeblocks I get codeblocks: error while loading shared libraries: libcodeblocks.so.0: cannot open shared object file: No such file or directory
libcodeblocks.so exists in /usr/local/lib

Oddly if I install to a non-standard prefix e.g /home/myhome/whatever and run it from there, it finds libcodeblocks from /home/myhome/whatever/lib/ and runs correctly.

oBFusCATed

Read the manual of your distro how you're supposed to tell the linker to update libraries. It should be something related to ldconfig.
Generelly I think it is really bad idea to use the default path. I suppose we have to change it to be somewhere else.
Also if you're on ubuntu you can easily build packages and use those.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

lesnewell

Dangit. I should have known that. Thanks.