$ apt-get install libglib2.0-dev
2. write source code to print "hello world!"
#include
int main(int argc, char** argv)
{
g_printf("hello world!\n");
}
3. compile
gcc `pkg-config --libs --cflags glib-2.0` hello.c
$ git config --global user.name "foo"
$ git config --global user.email "foo@gmail.com"
$ cd sur
$ git init
$ git add sur.w %my source code
$ git commit -m "first commit"
$ git remote add origin git@github.com:dsmarkchen/sur.git
$ git push origin master
ssh -v git@github.com
$ cd ~/.ssh
$ ssh-keygen -t rsa
dsp_t* dsp;
dsp_t* dsp_new(comm_t* comm);
/* headers*/
#include < stdio.h>
#include < stdlib.h>
/*
* brief.
*
* input: from: data source of input
* from_size: the number of frames in [from]
* output: to: the pointer to the allocated data.
*
* NOTE: here is the note. [to] should be free by the caller.
*/
static int foo(short* from, int from_size, unsigned char** to);
@echo off
set PRJ_DIR=%PRJ_ROOT%\foo-%PRJ_TSTAMP%
set PRJ_NAME=foo
if "%1"=="-D" goto check_out_tstamp;
echo "check out HEAD of %PRJ_NAME%"
cvs co -d %PRJ_DIR% -P %PRJ_NAME%
goto end;
: check_out_tstamp
echo "check out with time stamp"
cvs co -D %PRJ_TIME% "-d" %PRJ_DIR% -P %PRJ_NAME%
:end
# make compile
/opt/crosstool/i686-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/bin/i686-unknown-linux-gnu-g++ -x c++ -c -Wall -Wno-unknown-pragmas -fno-common -fbounds-check -pipe -g -Wno-deprecated -pipe -o foo.o foo.cpp
/opt/crosstool/i686-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/bin/i686-unknown-linux-gnu-g++ -shared -o libfoo.so foo.o -lc
/opt/crosstool/i686-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/bin/i686-unknown-linux-gnu-ar -rcs libfoo.a foo.o
/opt/crosstool/i686-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/bin/i686-unknown-linux-gnu-g++ -x c++ -c -Wall -Wno-unknown-pragmas -fno-common -fbounds-check -pipe -g -Wno-deprecated -pipe -o test.o test.cpp
/opt/crosstool/i686-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/bin/i686-unknown-linux-gnu-g++ -dynamic -L. -lfoo -o test test.o
/opt/crosstool/i686-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/bin/i686-unknown-linux-gnu-g++ -static -L. -lfoo -o test.static test.o libfoo.a
# ./test
./test: error while loading shared libraries: ./libfoo.so: cannot restore segment prot after reloc: Permission d[...]
# chcon -t textrel_shlib_t ./libfoo.so