zoukankan      html  css  js  c++  java
  • ubuntu下交叉编译windows c程序

    简介

    采用mingw32可以在linux下直接编译c程序输出为windows下的exe程序或dll链接库。

    个人编译的纯c程序(不含winapi),主要是c99程序,通常采用gcc/cc编译调试后,再用mingw输出win目标文件。

    linux下目标程序及共享库与windows下的应用程序及链接库不同。

    具体步骤

    1. 安装mingw

      sudo apt-get install mingw32 mingw32-binutils mingw32-runtime

      即使不输入mingw32-binutils和mingw32-runtime也会自动安装

    2. 编译

      i586-mingw32msvc-gcc hello.c -o hello.exe

    3. 个人习惯

      alias cl=’i586-mingw32msvc-gcc -std=c99’

      cl *.o -mdll -o test.dll

      cl hello.c -o hello.exe

    mingw命令

    • C compiler: i586-mingw32msvc-gcc
    • C++ compiler: i586-mingw32msvc-g++
    • Linker for dynamic libs: i586-mingw32msvc-g++
    • Linker for static libs: i586-mingw32msvc-ar
    • Debugger: i586-mingw32msvc-gdb

    http://hustlei.tk/2014/08/ubuntu-compile-c-for-win.html

  • 相关阅读:
    CSS3 --- 盒子
    CSS3 --- 伪元素
    CSS3 --- 伪类结构
    CSS3 --- 选择器
    HTML5 --- 新增表单属性
    HTML5 --- 新增标签
    CSS --- 定位
    CSS---浮动造成的影响
    CSS---盒子模型
    CSS---样式属性
  • 原文地址:https://www.cnblogs.com/findumars/p/6251008.html
Copyright © 2011-2022 走看看