博客

  • 延长Windows 7提示应用没有响应的等待时间

    修改如下(如果没有就新建)REG_SZ值:HKEY_CURRENT_USER\Control Panel\Desktop\HungAppTimeout内容是一个整数,表示提示之前的等待时间(毫秒),默认(不存在这个项的时候)是5000。

    另外,对于编程人员,可以使用API“DisableProcessWindowsGhosting”来禁止这个提示。

    最后,使用“应用程序兼容工具箱”也可以针对单个程序来禁止这个提示,不过操作较为复杂:http://blogs.technet.com/b/askperf/archive/2010/09/10/de-ghosting-your-windows.aspx。

  • QQ对战平台本地好友编辑器

    QQ对战平台的本地好友信息储存在%QQBattleZone%\%UIN%\Friend.dat,格式比较简单,一开始是一个DWORD,看起来总是为0,后面是一堆FriendObject(参考代码中的定义)。

    在平台上好象没有查找好友的功能,只能添加同一个房子的,所以就写了这么个代码来自由添加。

    代码好像写的比较烂,比如说添加好友就该单独写一个函数,偷个懒,各位勉强看吧。

    /*
      Description
        
        A simple tool to manage local friends in QQ game platform.
        
      Author
      
        NewbieCoder@0GiNr
      
      Revision
        
        None
        
    */
    
    #include <cstdio>
    #include <cstring>
    
    #include <iostream>
    #include <string>
    #include <vector>
    #include <iomanip>
    #include <fstream>
    #include <algorithm>
    
    struct FriendObject {
      int uin;
      char nickName[20];
      
      //
      // Except for a DWORD at the beginning, which may be face icon?
      // All the remaining bytes seem to always be zero.
      //
      
      char unknown[36];
      
      explicit FriendObject() {
        memset(this, 0, sizeof(*this));
      }
    };
    
    std::vector<FriendObject> friends;
    
    //
    // Binary read.
    //
    
    template<class type> std::istream& binaryRead(std::istream &istreamObject, type &object) {
      return istreamObject.read((char *)&object, sizeof(object));
    }
    
    //
    // Binary write.
    //
    
    template<class type> std::ostream& binaryWrite(std::ostream &ostreamObject, type object) {
      return ostreamObject.write((char *)&object, sizeof(object));
    }
    
    //
    // Load friends information from 'Friend.dat'
    //
    // File structure:
    //    DWORD unknow -- Always zero.
    //    One or more FriendObject follows.
    //
    
    void loadFriends(std::istream &istreamObject) {
      FriendObject friendObject;
      int temp;
      
      friends.clear();
      
      //
      // Always zero?
      //
      
      binaryRead(istreamObject, temp);
      
      //
      // Function binaryRead simplifies the work much.
      //
      
      while (binaryRead(istreamObject, friendObject)) {
        friends.push_back(friendObject);
      }
    }
    
    //
    // List the friends information.
    //
    
    void dumpFriends() {
      for (FriendObject friendObject : friends) {
        std::cout << std::setw(10) << std::left << friendObject.uin << " " <<
          std::setw(25) << std::left << friendObject.nickName << std::endl;
      }
    }
    
    //
    // Write friends information back.
    //
    
    void saveFriends(std::ostream &ostreamObject) {
      
      //
      // Always be zero.
      //
      
      binaryWrite(ostreamObject, (int)0);
      
      //
      // Write them back one by one.
      //
      
      for (FriendObject friendObject : friends) {
        binaryWrite(ostreamObject, friendObject);
      }
    }
    
    int main(int argc, char **argv) {
      std::string command;
      std::string fileName = "Friend.dat";
      std::ifstream inputFileStream;
      std::ofstream outputFileStream;
      bool informationModified = false;
      
      //
      // TODO: Validate arguments.
      //
      
      command = argv[1];
      
      inputFileStream.open(fileName, std::ios::binary);
      if (!inputFileStream) {
        std::cerr << "Unable to open Friend.dat." << std::endl;
        
        return -1;
      }
      
      loadFriends(inputFileStream);
      inputFileStream.close();
      
      if (command == "-list") {
        dumpFriends();
      } else if (command == "-add") {
        FriendObject friendObject;
        std::vector<FriendObject>::iterator friendPointer;
        
        //
        // Data should be write back.
        //
        
        informationModified = true;
    
        sscanf(argv[2], "%d", &friendObject.uin);
        strncpy(friendObject.nickName, argv[3], sizeof(friendObject.nickName));;
        
        //
        // Check if we have to add a new entry.
        //
        
        friendPointer = std::find_if(friends.begin(), friends.end(), 
          [friendObject] (FriendObject const &current) -> bool {
          return current.uin == friendObject.uin;
        });
        
        if (friendPointer == friends.end()) {
          friends.push_back(friendObject);
        } else {
          *friendPointer = friendObject;
        }
      } else if (command == "-delete") {
        int uin;
        
        sscanf(argv[2], "%d", &uin);
        
        informationModified = true;
        
        //
        // Find the corresponding entry and remove it if one exists.
        //
        
        friends.erase(std::remove_if(friends.begin(), friends.end(), 
          [uin] (FriendObject const &current) -> bool {
          return current.uin == uin;
        }), friends.end());
      } else if (command == "-clear") {
        informationModified = true;
        friends.clear();
      }
      
      //
      // Operation '-add' and '-delete' requires writting data back.
      //
      
      if (informationModified) {  
        outputFileStream.open(fileName, std::ios::binary | std::ios::trunc);
        if (!outputFileStream) {
          std::cerr << "Unable to write back to Friend.dat." << std::endl;
          
          return -1;
        }
        
        saveFriends(outputFileStream);
        
        outputFileStream.close();
      }
    }

  • VirtualBox 4.1.10 简体中文语言包

    这个语言包是ldr制作的,不过在汉化新世纪那儿下到的是个安装程序,其实就是把两个文件覆盖到安装目录下的nls目录里面就好了。这儿把那两个文件提取出来了:VirtualBox_zh_CN_4.1.10。

  • MinGW32 4.7.0

    Update at 1:42 2012/11/01: TDM-GCC 已经更新到了比 4.7.0 更新的版本,请移步 http://tdm-gcc.tdragon.net/。

    前两天自己编译的,参考https://newbiecoder.0ginr.com/blog/?p=268。

    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=f:/mingw32_470/bin/../libexec/gcc/i686-pc-mingw32/4.7.0/lto-
    wrapper.exe
    i686-pc-mingw32
    ./configure --enable-nls --enable-lto --enable-shared --enable-static --enable-l
    ibgomp --enable-version-specific-runtime-libs --enable-lto --enable-threads=win3
    2 --enable-cloog-backend=isl --disable-win32-registry --disable-sjlj-exceptions
    --disable-libstdcxx-pch --with-dwarf2 --with-mpc=/mingwlibs --with-mpfr=/mingwli
    bs --with-gmp=/mingwlibs --without-x --prefix=/mingw470 --host=i686-pc-mingw32
    win32
    gcc  4.7.0 (GCC)

    下载地址:http://kuai.xunlei.com/d/MPLKVCKBKQRT。

  • 编译 GCC 4.7.0

    [文件头]

    GCC 4.7.0源代码:ftp://gcc.gnu.org/pub/gcc/releases/。
    编译环境:MinGW 4.6.2(完全安装):http://sourceforge.net/projects/mingw/。
    安装后使用%MinGW%\msys\1.0\msys.bat环境编译。
    整个过程需要大约4G的可用磁盘空间。

    [环境配置]

    新建/mingw470、/mingwlibs,其中/mingw470是存放我们新生成的MinGW,/mingwlibs是一些GCC依赖的dll等。

    修改etc/profile,将

    if [ $MSYSTEM == MINGW32 ]; then
      export PATH=".:/usr/local/bin:/mingw/bin:/bin:$PATH"
    else
      export PATH=".:/usr/local/bin:/bin:/mingw/bin:$PATH"
    fi
    修改为
    if [ $MSYSTEM == MINGW32 ]; then
      export PATH=".:/mingwlibs/bin:/mingw470/bin:/usr/local/bin:/mingw/bin:/bin:$PATH"
    else
      export PATH=".:/mingwlibs/bin:/mingw470/bin:/usr/local/bin:/bin:/mingw/bin:$PATH"
    fi

    这儿我们把我们自己的bin目录们放在了系统(以及MinGW)的bin目录前面,这个主要是因为我们的bin目录会包括新生成的一些dll,某些dll(比如gmp的)会跟系统(或MinGW)自带的dll冲突,这种情况下我们需要使用我们新生成的dll,所以要把我们的bin放在系统的bin之前。

    在/etc/profile最后的cd “$HOME”之前加上以下内容。

    export CFLAGS="-O2 -fomit-frame-pointer -fno-exceptions -I/mingw470/include"
    export CXXFLAGS="-O2 -fomit-frame-pointer -mthreads -m128bit-long-double -I/mingw470/include"
    export LDFLAGS="-s -L/mingw470/lib"

    这个是编译器们的参数,主要是优化编译结果、包含的头文件和库之类的。

    [编译依赖项]

    下载以下库并解压到/home/$UserName($UserName为当前登陆的用户名,即用户主目录,如果找不到/home/$UserName,请先运行msys.bat,会自动创建/home/$UserName。),这些库是GCC的依赖项。

    依次编译(并安装,下同)gmp、mpfr、mpc,其中mpfr依赖于gmp,mpc依赖于mpfr。

    • 编译(确切来说是配置)mpc时可能会提示找不到GMP或者ABI不匹配,这是mpc自带的configure跟GCC的不兼容导致的(可能是mpc的configure写的不规范。),参考https://newbiecoder.0ginr.com/blog/?p=245。
    • gmp在make install之后还可以make check一下。(按照gmp的提示是说编译器可能会有BUG,check可以验证一下编译结果的正确性。)

    gmp
    configure --enable-shared --disable-static --enable-cxx --prefix=/mingwlibs --host=i686-pc-mingw32 && make && make install

    mpfr
    configure --enable-shared --disable-static --with-gmp=/mingwlibs --prefix=/mingwlibs --host=i686-pc-mingw32 && make && make install

    mpc
    configure --enable-shared --disable-static --with-gmp=/mingwlibs --with-mpfr=/mingwlibs --prefix=/mingwlibs --host=i686-pc-mingw32 && make && make install

    在上面3个库全部编译完成后,就可以编译GCC了。

    [编译GCC]

    在编译GCC之前,需要修改/mingwlibs/include/mpc.h,在行#131之前添加:

    #undef __MPC_DECLSPEC
    #define __MPC_DECLSPEC extern

    否则可能会提示gmp/mpfr/mpc版本不正确。实际上是mpc.h中__MPC_DECLSPEC的定义有问题(好像定义成了dllimport,但是mpc的.a文件跟这个.h对不上。),这可能是mpc的一个BUG。

    然后将gcc解压到/home/$UserName并编译。

    • 如果只需要C/C++编译器可以增加参数“–enable-languages=c,c++”。
    • GCC编译过程中分3个阶段。第一阶段是用当前系统中的编译器(通常是老版本GCC)编译新的GCC,第二阶段是用新编译出来的GCC再编译一次自己,这时候如果不存在BUG的话,产生出来的结果就应该是最终结果了,第三阶段是第二阶段产生的GCC再编译自己,这次的结果是用来和第二阶段的结果对比的,来验证编译结果的正确性的,如果不想要这个验证,可以增加参数“–disable-bootstrap”来关闭它,这样可以快不少。

    gcc
    configure --enable-nls --enable-shared --enable-static --enable-libgomp --enable-version-specific-runtime-libs --enable-lto --enable-threads=win32 --enable-cloog-backend=isl --disable-win32-registry --disable-sjlj-exceptions --disable-libstdcxx-pch --with-dwarf2 --with-mpc=/mingwlibs --with-mpfr=/mingwlibs --with-gmp=/mingwlibs --without-x --prefix=/mingw470 --host=i686-pc-mingw32 && make && make install

    [安装辅助库]

    从MinGW处下载w32api(3.17)、mingw-rt(3.20)、libiconv(1.14)、pthreads-w32(2.8.0)、binutils(2.22,源代码)、libintl(0.18.1.1,位于下载网页中的gettext目录下):http://sourceforge.net/projects/mingw/files/MinGW/Base/,这些库(及代码等)用于帮助构造完整的最终编译环境。

    将w32api、mingw-rt、libiconv、pthreads-w32、libintl解压到/mingw470。

    • 官方版发布的二进制版本的binutils是静态链接gmp/mpfr/mpc的,为使其动态链接,需要下载其源代码,然后解压到/home/$UserName并编译。如果不想自行编译也可以直接下载官方发布的二进制版本的binutils然后解压到/mingw470。

    binutils
    configure --enable-shared --disable-static --with-cloog-backend=isl --enable-nls --with-mpc=/mingwlibs --with-mpfr=/mingwlibs --with-gmp=/mingwlibs --prefix=/mingw470 --host=i686-pc-mingw32 && make && make install

    待编译完成后即可关闭msys。

    [合并]

    将/mingwlibs/bin下的所有文件复制到/mingw470/bin即可。

    [删除调试信息]

    编译完成后可能会发现文件都非常大(比如/mingw470/libexec/gcc/i686-pc-mingw32/4.7.0/cc1.exe就有70M。),这是因为其中包含了调试信息等信息,使用strip工具可以将这些信息删除掉。

    将/mingw470下的所有文件复制到新目录(比如F:\MinGW32_470。),将/mingwlibs/bin下的所有文件复制到新目录下的\bin(比如F:\MinGW32_470\bin)。

    打开命令提示符,进入这个目录,执行以下命令。

    copy bin\strip.exe strip.exe
    set path=.\bin;%path%
    for /r %f in (*.exe, *.dll) do strip.exe --strip-all %f
    for /r %f in (*.a) do strip.exe --strip-debug --strip-unneeded %f
    del strip.exe

    [其他]

    如果需要一个批处理来设置环境变量的话,直接用TDM-GCC带的mingwvars.bat即可。

    @echo.
    @echo Setting up environment for using MinGW with GCC from %~dp0.
    @set PATH=%~dp0bin;%PATH%

    另外,虽然辅助库是GCC 4.7.0编译出来的,但是之前的gmp等库都是由GCC 4.6.2编译的,如果有必要的话可以现在用GCC 4.7.0从头再来一次,不过只需要编译这些依赖项,不需要再编译GCC本身。

    [参考]

    [1] http://gcc.gnu.org/install/prerequisites.html
    [2] http://www.aristeia.com/Misc/gcc4ForWindows.html
    [3] http://blogs.ejb.cc/archives/1339/use-mingw64-compile-gcc-4-6-and-4-7

  • MinGW自带的MSYS中使用新版本GMP编译PPL

    在MinGW自带的MSYS(理论上来讲单独配置的MSYS整合MinGW也可能出现这个问题。)中使用新版本GMP编译PPL(动态链接)可能会出现以下错误:

    checking for the GMP library version 4.1.3 or above... no
    configure: error: Cannot find GMP version 4.1.3 or higher.
    GMP is the GNU Multi-Precision library:
    see http://www.swox.com/gmp/ for more information.
    When compiling the GMP library, do not forget to enable the C++ interface:
    add --enable-cxx to the configuration options.

    在config.log里面可以查到如下错误细节:

    configure:10021: checking for the GMP library version 4.1.3 or above
    configure:10110: g++ -o conftest.exe -g -O2 -frounding-math -I/mingwlibs/include conftest.cpp -L/mingwlibs/lib -lgmpxx -lgmp >&5
    configure:10110: $? = 0
    configure:10110: ./conftest.exe
    GMP header (gmpxx.h) and library (ligmpxx.*) version mismatch:
    header gives 5.0.4;
    library gives 5.0.1.
    configure:10110: $? = 1
    configure: program exited with status 1
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME "the Parma Polyhedra Library"
    | #define PACKAGE_TARNAME "ppl"
    | #define PACKAGE_VERSION "0.12"
    | #define PACKAGE_STRING "the Parma Polyhedra Library 0.12"
    | #define PACKAGE_BUGREPORT "ppl-devel@cs.unipr.it"
    | #define PACKAGE_URL ""
    | #define PPL_CONFIGURE_OPTIONS " '--disable-static' '--enable-shared' '--with-gmp=/mingwlibs' '--prefix=/mingwlibs' '--host=i686-pc-mingw32' 'host_alias=i686-pc-mingw32'"
    | #define PPL_NDEBUG 1
    | #define PPL_FPMATH_MAY_USE_387 1
    | #define PPL_FPMATH_MAY_USE_SSE 1
    | #define PPL_COEFFICIENT_TYPE mpz_class
    | #define PPL_COEFFICIENT_BITS 0
    | #define PPL_GMP_INTEGERS 1
    | #define STDC_HEADERS 1
    | #define HAVE_SYS_TYPES_H 1
    | #define HAVE_SYS_STAT_H 1
    | #define HAVE_STDLIB_H 1
    | #define HAVE_STRING_H 1
    | #define HAVE_MEMORY_H 1
    | #define HAVE_STRINGS_H 1
    | #define HAVE_INTTYPES_H 1
    | #define HAVE_STDINT_H 1
    | #define HAVE_UNISTD_H 1
    | #define HAVE_TYPEOF 1
    | #define SIZEOF_CHAR 1
    | #define SIZEOF_SHORT 2
    | #define SIZEOF_INT 4
    | #define SIZEOF_LONG 4
    | #define SIZEOF_LONG_LONG 8
    | #define SIZEOF_SIZE_T 4
    | #define SIZEOF_FLOAT 4
    | #define SIZEOF_DOUBLE 8
    | #define SIZEOF_LONG_DOUBLE 12
    | #define SIZEOF_INTP 4
    | #define SIZEOF_FP 4
    | #define HAVE_FENV_H 1
    | #define PPL_CAN_CONTROL_FPU 1
    | #define PPL_CXX_PLAIN_CHAR_IS_SIGNED 1
    | #define PPL_CXX_PROVIDES_PROPER_LONG_DOUBLE 1
    | #define PPL_CXX_FLOAT_BINARY_FORMAT PPL_FLOAT_IEEE754_SINGLE
    | #define PPL_CXX_FLOAT_EXACT_OUTPUT 0
    | #define PPL_SUPPORTED_FLOAT 0
    | #define PPL_CXX_DOUBLE_BINARY_FORMAT PPL_FLOAT_IEEE754_DOUBLE
    | #define PPL_CXX_DOUBLE_EXACT_OUTPUT 1
    | #define PPL_SUPPORTED_DOUBLE 1
    | #define PPL_CXX_LONG_DOUBLE_BINARY_FORMAT PPL_FLOAT_INTEL_DOUBLE_EXTENDED
    | #define PPL_CXX_LONG_DOUBLE_EXACT_OUTPUT 1
    | #define PPL_SUPPORTED_LONG_DOUBLE 1
    | #define PPL_CXX_SUPPORTS_ZERO_LENGTH_ARRAYS 1
    | #define PPL_CXX_SUPPORTS_IEEE_INEXACT_FLAG 1
    | #define PPL_CXX_SUPPORTS_ATTRIBUTE_WEAK 1
    | #define HAVE_FENV_H 1
    | #define HAVE_GETOPT_H 1
    | #define HAVE_SIGNAL_H 1
    | #define HAVE_STRING_H 1
    | #define HAVE_STRINGS_H 1
    | #define HAVE_SYS_TIME_H 1
    | #define HAVE_SYS_TYPES_H 1
    | #define HAVE_UNISTD_H 1
    | #define HAVE_DECL_FFS 0
    | #define HAVE_DECL_GETENV 1
    | #define HAVE_DECL_STRTOF 1
    | #define HAVE_DECL_STRTOD 1
    | #define HAVE_DECL_STRTOLD 1
    | #define HAVE_DECL_STRTOLL 1
    | #define HAVE_DECL_STRTOULL 1
    | #define HAVE_DECL_FMA 1
    | #define HAVE_DECL_FMAF 1
    | #define HAVE_DECL_FMAL 1
    | #define HAVE_DECL_RINTF 1
    | #define HAVE_DECL_RINTL 1
    | #define HAVE_INT_FAST16_T 1
    | #define HAVE_INT_FAST32_T 1
    | #define HAVE_INT_FAST64_T 1
    | #define HAVE_UINT_FAST16_T 1
    | #define HAVE_UINT_FAST32_T 1
    | #define HAVE_UINT_FAST64_T 1
    | #define HAVE_UINTPTR_T 1
    | /* end confdefs.h. */
    |
    | #include
    | #include
    | #include
    | #include
    | #include
    |
    | #if __GNU_MP_VERSION < 4 || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR < 1) || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR == 1 && __GNU_MP_VERSION_PATCHLEVEL < 3) | #GMP version 4.1.3 or higher is required | #endif | | #ifndef BITS_PER_MP_LIMB | #define BITS_PER_MP_LIMB GMP_LIMB_BITS | #endif | | int | main() { | std::string header_version; | { | std::ostringstream s(header_version); | s << __GNU_MP_VERSION << "." << __GNU_MP_VERSION_MINOR; | // Starting from GMP version 4.3.0, the gmp_version variable | // always contains three parts. In previous versions the | // patchlevel was omitted if it was 0. | if (__GNU_MP_VERSION_PATCHLEVEL != 0 | || __GNU_MP_VERSION > 4
    | || (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR >= 3))
    | s << "." << __GNU_MP_VERSION_PATCHLEVEL; | header_version = s.str(); | } | | std::string library_version = gmp_version; | | if (header_version != library_version) { | std::cerr | << "GMP header (gmpxx.h) and library (ligmpxx.*) version mismatch:\n" | << "header gives " << header_version << ";\n" | << "library gives " << library_version << "." << std::endl; | return 1; | } | | if (sizeof(mp_limb_t)*CHAR_BIT != BITS_PER_MP_LIMB | || BITS_PER_MP_LIMB != mp_bits_per_limb) { | std::cerr | << "GMP header (gmpxx.h) and library (ligmpxx.*) bits-per-limb mismatch:\n" | << "header gives " << BITS_PER_MP_LIMB << ";\n" | << "library gives " << mp_bits_per_limb << ".\n" | << "This probably means you are on a bi-arch system and\n" | << "you are compiling with the wrong header or linking with\n" | << "the wrong library." << std::endl; | return 1; | } | | mpz_class n("3141592653589793238462643383279502884"); | return 0; | } | configure:10115: result: no configure:10250: error: Cannot find GMP version 4.1.3 or higher.

    这个主要原因是因为所使用的MinGW包含了gmp的动态链接库,同时MinGW自带的gmp的版本较低(根据config.log可以看出MinGW自带的版本是5.0.1),而链接到的头文件却是新版本的(5.0.4),同时用来测试gmp版本的程序加载了MinGW自带的gmp的库,进而造成了不一致性。

    解决方法:把新编译出来的新版libgmp-10.dll复制到MinGW\bin替换MinGW自带的gmp库即可。

    另外,从理论上来讲,修改PATH应该也是可以的。

  • MPC 0.8.2/0.9和GCC 4.6.2 的一处兼容性问题

    在用GCC 4.6.2编译MPC 0.8.2/0.9的时候(动态链接),在configure的时候出现这样的错误:

    checking for __gmpz_init in -lgmp... no
    configure: error: libgmp not found or uses a different ABI.

    在config.log里面可以看到这样的信息:

    configure:10833: checking for __gmpz_init in -lgmp
    configure:10858: gcc -std=gnu99 -o conftest.exe -m32 -O2 -pedantic -fomit-frame-pointer -mtune=pentiumpro -march=pentiumpro -I/mingwlibs/include -I/mingwlibs/include  -L/mingwlibs/lib -L/mingwlibs/lib  -no-undefined conftest.c -lgmp   >&5
    gcc.exe: error: unrecognized option '-no-undefined'
    configure:10858: $? = 1
    configure: failed program was:
    | /* confdefs.h */
    | #define PACKAGE_NAME "mpc"
    | #define PACKAGE_TARNAME "mpc"
    | #define PACKAGE_VERSION "0.8.2"
    | #define PACKAGE_STRING "mpc 0.8.2"
    | #define PACKAGE_BUGREPORT "mpc-discuss@lists.gforge.inria.fr"
    | #define PACKAGE_URL ""
    | #define PACKAGE "mpc"
    | #define VERSION "0.8.2"
    | #define HAVE_SYS_TYPES_H 1
    | #define HAVE_SYS_STAT_H 1
    | #define HAVE_STDLIB_H 1
    | #define HAVE_STRING_H 1
    | #define HAVE_MEMORY_H 1
    | #define HAVE_STRINGS_H 1
    | #define HAVE_INTTYPES_H 1
    | #define HAVE_STDINT_H 1
    | #define HAVE_UNISTD_H 1
    | #define LT_OBJDIR ".libs/"
    | /* end confdefs.h.  */
    | 
    | /* Override any GCC internal prototype to avoid an error.
    |    Use char because int might match the return type of a GCC
    |    builtin and then its argument prototype would still apply.  */
    | #ifdef __cplusplus
    | extern "C"
    | #endif
    | char __gmpz_init ();
    | int
    | main ()
    | {
    | return __gmpz_init ();
    |   ;
    |   return 0;
    | }
    configure:10867: result: no
    configure:10872: error: libgmp not found or uses a different ABI.
    

    其实这儿的参数-no-undefined本该传给链接器的,所以直接把configure里面行#4457(0.8.2)或#4501(0.9)从

    LDFLAGS="$LDFLAGS -no-undefined"

    改成

    LDFLAGS="$LDFLAGS -Wl,-no-undefined"

    就好了。

    ————————————————————————————————

    更多信息:http://lists.gnu.org/archive/html/libtool/2011-03/msg00015.html

  • GCC 4.7.0 发布了

    昨天看的时候看到的:http://gcc.gnu.org/gcc-4.7/。
    好像也就是昨天发布的,呵呵。
    GCC 4.7.0支持C++11跟C11了,真不错。

    暂时放弃VC了,等VC出11的RTM了再说吧。

    不过MinGW跟TDM-GCC都比GCC那边慢好几个月,准备自己编译了,真要命。

  • Visual Studio 2010 Express 序列号

    存档。

    Visual Basic: 2KQT8-HV27P-GTTV9-2WBVV-M7X96
    Visual C#: PQT8W-68YB2-MPY6C-9JV9X-42WJV
    Visual C++: 6VPJ7-H3CXH-HBTPT-X4T74-3YVY7
    Visual Web Developer: CY8XP-83P66-WCF9D-G3P42-K2VG3

  • 破解 360doc 的防复制

    网上搜了下都是在地址栏跑一句 js 把 oncopy 的操作改成 null,略显麻烦。

    其实很简单的嘛,直接给加到 IE 的受限站点就好了~