Compiling CCV in Ubuntu

25 Sep

Tutorial kindly sent by Dino Magri (See his blog)

Installing CCV from source code

If you do not have subversion (svn) do:

sudo apt-get install subversion
Now you can get the source, create a new directory for that.
mkdir /home/user/CCV
cd /home/user/CCV
Type:
svn checkout http://nuicode.svnrepository.com/svn/tbeta/trunk/tbeta/Linux Linux-ccv

Now go the script directory under the CCV source.

cd Linux-ccv/scripts/ubuntu/

Give +x permission to the script “install_codeblocks.sh” and execute it.

chmod +x install_codeblocks.sh
sudo ./install_codeblocks.sh
This will add two new repositories in the source.lst and will install Code::Blocks (a cross-platform IDE):

Repeat the process for the  “install_dependencies.sh” script:

chmod +x install_dependencies.sh
sudo ./install_dependencies.sh
This will ultimately install the needed packages to build and run CCV.

Now start Code::Blocks (either from start menu or by command line)

Open the project that its located at: “apps/addonsExamples/Codeblocks_8_linux/Community Core Vision.cbp”

Then hit Build and Run,

This error is bound to appear:

Linking console executable: bin/Community_Core_Vision
../../../libs/fmodex/lib/libfmodex.so: file not recognized: File format not recognized

collect2: ld returned 1 exit status
(it means the linker is not finding a library that is required by the executable/source)

Organizing the files and links should fix it, do as follows:
cd /home/user</CCV/Linux-ccv/libs/fmodex/lib/
mv libfmodex.so libfmodex.so.bkp
mv libfmodexp.so libfmodexp.so.bkp
ln -s libfmodex-4.22.00.so libfmodex.so
ln -s libfmodexp-4.22.00.so libfmodexp.so
Now before compiling and running the CCV again, lets alter the config.xmlç
(it is held in “../../Codeblocks_8_linux/bin/data”)
cd /home/user/CCV/Linux-ccv/apps/addonsExamples/Codeblocks_8_linux/bin/data/
gedit config.xml (or favorite IDE, mine is vim)
<CAMERA_0>
        <USECAMERA>1</USECAMERA>
        <DEVICE>1</DEVICE>
        <WIDTH>640</WIDTH>
        <HEIGHT>480</HEIGHT>
        <FRAMERATE>60</FRAMERATE>
</CAMERA_0>

Now, hit build and run. It works.

If you want to execute CCV without launching it from Code::Blocks you have to modify the libs that are in bin/libs, do the following:

cd /home/user/CCV/Linux-ccv/apps/addonsExamples/Codeblocks_8_linux/bin/libs
mv libfmodex.so libfmodex.so.bkp
mv libfmodexp.so libfmodexp.so.bkp
ln -s libfmodex-4.22.00.so libfmodex.so
ln -s libfmodexp-4.22.00.so libfmodexp.so
Now you can use the script “clickToLaunchApp.sh” to open CCV.
Advertisements

One Response to “Compiling CCV in Ubuntu”

  1. menno December 10, 2010 at 5:16 pm #

    hi,

    thanks for the tutorial! this worked, though I had to place the libfmodex files from the Linux 64bit branch of CCV to the directory and apply ln -s. running ubuntu 10.04 64bit here.

    then, the error for libfmodex was gone. however, I get a different error now:

    Linking console executable: bin/Community_Core_Vision
    /usr/bin/ld: skipping incompatible ../../../libs/poco/lib/libPocoFoundation.a when searching for -lPocoFoundation
    /usr/bin/ld: skipping incompatible ../../../libs/unicap/lib/libunicap.a when searching for -lunicap
    /usr/bin/ld: cannot find -lunicap
    collect2: ld returned 1 exit status

    any ideas how resolve this? thanks! menno.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: