超越自我

mingw编译zlib

Filed under: 应用软件 ; Tags: — freeyun @ 2011-11-22 23:42:25

在安常规编译在报的错误“please use win32/makefile.gcc instead”
下面的方法即可解决
mingw编译最新版的zlib,这个是简要的操作说明:
cp win32/makefile.gcc makefile.gcc
make -fmakefile.gcc
export “INCLUDE_PATH=G:/mingw/zlib-1.25/include”
export “LIBRARY_PATH=G:/mingw/zlib-1.25/lib”
make install -fmakefile.gcc
cp zlib1.dll G:/mingw/zlib-1.25//bin

未命名
参考:http://www.gaia-gis.it/spatialite-2.4.0/mingw_how_to.html

c++ 虚函数的简单例子

Filed under: 应用软件 ; Tags: — freeyun @ 2011-11-16 11:46:03

#include
#include
using namespace std;
class Test
{
public:
Test(){}
virtual~Test(){}
virtual void hello()=0;
};

class Test1 :public Test
{
public:
Test1(){}
virtual ~Test1(){}
virtual void hello(){
cout<<"hello i ~ m test1" < }
};

class Test2 :public Test
{
public:
Test2(){}
virtual ~Test2(){}
virtual void hello(){
cout<<"hello i ~ m test2" < }
};

class Showclass
{
public:
Showclass(){}
~Showclass(){}
void addobject( Test * object)
{
test_.push_back( object);
}
void hello( )
{
for( Test_::iterator it =test_.begin(); it != test_.end();++it )
{
(*it)->hello();
}
}
private:
typedef std::vector< Test* > Test_;
Test_ test_;
};

int main()
{
Showclass showclass_;
Test1 test1_object;
Test2 test2_object;
showclass_.addobject( &test1_object );
showclass_.addobject( &test2_object );
showclass_.hello();
}

笔记本除尘

Filed under: 生活情感 ; freeyun @ 2011-09-11 01:52:43

只图片简单说明下把!主要部分特写!

第一张是:拆掉键盘:

IMAG0018

(more…)

gcc: error: unrecognized option ‘-mtune=generic’

Filed under: 操作系统 ; Tags: — freeyun @ 2011-07-03 10:38:05

III. Building the LFS System

6. Installing Basic System Software

6.9. Glibc-2.14

执行 :cd glibc-2.14 case `uname -m` in i?86) echo "CFLAGS += -march=i486 -mtune=native -O3 -pipe" > configparms ;; esac

configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES config.log

Filed under: 操作系统 ; Tags: — freeyun @ 2011-07-01 23:54:49

给我参考用的:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.64.  Invocation command line was

$ ../gcc-4.6.0/configure –target= –prefix=/tools –disable-nls –disable-shared –disable-multilib –disable-decimal-float –disable-threads –disable-libmudflap –disable-libssp –disable-libgomp –disable-libquadmath –disable-target-libiberty –disable-target-zlib –enable-languages=c –without-ppl –without-cloog

## ——— ##
## Platform. ##
## ——— ##

hostname = heary-Inspiron-1464
uname -m = x86_64
uname -r = 2.6.38-8-generic
uname -s = Linux
uname -v = #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/local/games
PATH: /usr/games

## ———– ##
## Core tests. ##
## ———– ##

(more…)

gcc 4.6.0 error

Filed under: 操作系统 ; Tags: — freeyun @ 2011-06-29 09:52:20

make[4]: Entering directory `/mnt/lfs/sources/gcc-build/prev-gcc’
make[4]: *** No rule to make target `real-install-headers-tar’.  Stop.
make[4]: Leaving directory `/mnt/lfs/sources/gcc-build/prev-gcc’
make[3]: *** [stmp-fixinc] Error 2
rm gcc.pod
make[3]: Leaving directory `/mnt/lfs/sources/gcc-build/gcc’
make[2]: *** [all-stage1-gcc] Error 2
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build’
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build’
make: *** [all] Error 2

gcc-4.6.0-cross_compile-1.patch

Filed under: 操作系统 ; Tags: — freeyun @ 2011-06-29 09:08:48

$ patch -Np1 -i gcc-4.6.0-cross_compile-1.patch
patching file configure
Hunk #1 FAILED at 2801.
1 out of 1 hunk FAILED — saving rejects to file configure.rej
patching file configure.ac
Hunk #1 FAILED at 262.
1 out of 1 hunk FAILED — saving rejects to file configure.ac.rej

配置错误引起的,lfs需要进入到gcc-4.6.0目录,再执行补丁

patch -Np1 -i ../gcc-4.6.0-cross_compile-1.patch

config.log

Filed under: 操作系统 ; Tags: — freeyun @ 2011-06-28 23:43:53

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.64.  Invocation command line was

$ ../gcc-4.6.0/configure –target= –prefix=/tools –disable-nls –disable-shared –disable-multilib –disable-decimal-float –disable-threads –disable-libmudflap –disable-libssp –disable-libgomp –disable-libquadmath –disable-target-libiberty –disable-target-zlib –enable-languages=c –without-ppl –without-cloog

(more…)

GCC-4.6.0 – Pass 1 error hase Solve

Filed under: 操作系统 ; Tags: — freeyun @ 2011-06-28 13:48:58

checking whether  /mnt/lfs/sources/gcc-build/./prev-gcc/xgcc -B/mnt/lfs/sources/gcc-build/./prev-gcc/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/lib/ -isystem /tools/x86_64-unknown-linux-gnu/include -isystem /tools/x86_64-unknown-linux-gnu/sys-include    supports -Wstrict-prototypes…
configure: error: in `/mnt/lfs/sources/gcc-build/lto-plugin’:
configure: error: C compiler cannot create executables
See `config.log’ for more details.
yes
make[2]: *** [configure-stage2-lto-plugin] Error 77
checking whether  /mnt/lfs/sources/gcc-build/./prev-gcc/xgcc -B/mnt/lfs/sources/gcc-build/./prev-gcc/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/lib/ -isystem /tools/x86_64-unknown-linux-gnu/include -isystem /tools/x86_64-unknown-linux-gnu/sys-include    supports -pedantic … yes
checking whether  /mnt/lfs/sources/gcc-build/./prev-gcc/xgcc -B/mnt/lfs/sources/gcc-build/./prev-gcc/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/bin/ -B/tools/x86_64-unknown-linux-gnu/lib/ -isystem /tools/x86_64-unknown-linux-gnu/include -isystem /tools/x86_64-unknown-linux-gnu/sys-include    and cc understand -c and -o together… yes
checking for an ANSI C-conforming const… yes
checking for inline… inline
checking for grep that handles long lines and -e… /bin/grep
checking for egrep… /bin/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 whether byte ordering is bigendian… no
checking for a BSD-compatible install… /usr/bin/install -c
checking for sys/file.h… yes
checking for sys/param.h… yes
checking for limits.h… yes
checking for stdlib.h… (cached) yes
checking for malloc.h… yes
checking for string.h… (cached) yes
checking for unistd.h… (cached) yes
checking for strings.h… (cached) yes
checking for sys/time.h… yes
checking for time.h… yes
checking for sys/resource.h… yes
checking for sys/stat.h… (cached) yes
checking for sys/mman.h… yes
checking for fcntl.h… yes
checking for alloca.h… yes
checking for sys/pstat.h… no
checking for sys/sysmp.h… no
checking for sys/sysinfo.h… yes
checking for machine/hal_sysinfo.h… no
checking for sys/table.h… no
checking for sys/sysctl.h… yes
checking for sys/systemcfg.h… no
checking for stdint.h… (cached) yes
checking for stdio_ext.h… yes
checking for process.h… no
checking for sys/prctl.h… yes
checking for sys/wait.h that is POSIX.1 compatible… yes
checking whether time.h and sys/time.h may both be included… yes
checking whether errno must be declared… no
checking size of int… 4
checking for a 64-bit type… uint64_t
checking for intptr_t… yes
checking for uintptr_t… yes
checking for ssize_t… yes
checking for pid_t… yes
checking for library containing strerror… configure: error: Link tests are not allowed after GCC_NO_EXECUTABLES.
make[2]: *** [configure-stage2-libiberty] Error 1
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build’
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build’
make: *** [all] Error 2

 

make distclean 后重新编译即可解决,不行就重新解压gcc-4.6.0,再编译

5.5. GCC-4.6.0 – Pass 1 error ,已经解决

Filed under: 操作系统 ; Tags: — freeyun @ 2011-06-27 23:35:20

In file included from /usr/include/bits/errno.h:25:0,
from /usr/include/errno.h:36,
from ../../../gcc-4.6.0/libgcc/../gcc/tsystem.h:93,
from ../../../gcc-4.6.0/libgcc/../gcc/libgcc2.c:29:
/usr/include/linux/errno.h:4:23: fatal error: asm/errno.h: No such file or directory
compilation terminated.
make[3]: *** [_negdi2.o] Error 1
make[3]: *** Waiting for unfinished jobs….
In file included from /usr/include/bits/errno.h:25:0,
from /usr/include/errno.h:36,
from ../../../gcc-4.6.0/libgcc/../gcc/tsystem.h:93,
from ../../../gcc-4.6.0/libgcc/../gcc/libgcc2.c:29:
/usr/include/linux/errno.h:4:23: fatal error: asm/errno.h: No such file or directoryIn file included from /usr/include/bits/errno.h:25:0,
from /usr/include/errno.h:36,
from ../../../gcc-4.6.0/libgcc/../gcc/tsystem.h:93,
from ../../../gcc-4.6.0/libgcc/../gcc/libgcc2.c:29:
/usr/include/linux/errno.h:4:23: fatal error: asm/errno.h: No such file or directory

compilation terminated.
compilation terminated.
make[3]: *** [_muldi3.o] Error 1
make[3]: *** [_lshrdi3.o] Error 1
make[3]: Leaving directory `/mnt/lfs/sources/gcc-build/x86_64-unknown-linux-gnu/libgcc’
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory `/mnt/lfs/sources/gcc-build’
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/mnt/lfs/sources/gcc-build’
make: *** [all] Error 2

 

need root

ln -sv /usr/src/linux-headers-2.6.38-8/arch/x86/include/asm  /usr/include/asm