1. 程式人生 > >mingw中編譯庫出現sys/times.h: No such file or directory的可行解決方法

mingw中編譯庫出現sys/times.h: No such file or directory的可行解決方法

在mingw中成功編譯好了boost庫後, 使用別人寫的機器學習庫BMRM(https://github.com/funkey/bmrm) 編譯模型時出現了fatal error: sys/times.h:No such file or directory的錯誤, 一看,就是sys/times.h這個檔案沒有...

去mingw的include目錄下檢視,果然沒有times.h這個標頭檔案,只有一個time.h的標頭檔案。 後來在網上查詢相關錯誤, 知道了mingw中本身就沒有times.h這個檔案, 只有cygwin中有times.h檔案。

times.h的實現在libc.a中, 在cygwin的安裝包cygwin-1.5.25-5.tar中找到了libc.a檔案放在了mingw的lib資料夾中,並將sys/times.h標頭檔案和其他需要的檔案如sys/config.h拷貝到mingw安裝資料夾中,需要libc.a , sys/times.h 和 sys/config.h三個檔案, 

另外, 還要進行一下修改,因為mingw在include資料夾中有time.h檔案定義了clock_t,所以要將拷貝過來的times.h檔案要進行以下修改:

將times.h中下述字樣中的巨集定義

#include <_ansi.h>
#include <machine/types.h>

#ifndef __clock_t_defined
typedef _CLOCK_T_ clock_t;
#define __clock_t_defined
#endif

改為:

#ifndef _CLOCK_T_DEFINED
typedef _CLOCK_T_ clock_t;
#define _CLOCK_T_DEFINED
#endif

成功。

編譯可以通過了,可以生成BMRM的訓練和預測的二進位制檔案。 

另外,為了保證程式的穩定性, 最好還是使用cygwin代替mingw. 

相關推薦

mingw編譯出現sys/times.h: No such file or directory可行解決方法

在mingw中成功編譯好了boost庫後, 使用別人寫的機器學習庫BMRM(https://github.com/funkey/bmrm) 編譯模型時出現了fatal error: sys/times.h:No such file or directory的錯誤, 一看,就

Qt編譯錯誤“GL/gl.h:No such file or directory”的解決方法

導致 安裝 egl 新版 工具 ubunt 沒有 一個 -o 備註:1)操作系統:Ubuntu-14.04或12.042)Linux用戶:root3)Qt版本:qt-linux-opensource-5.2.0-x86 為了迎接Qt的新紀元(從諾基亞移居到

Linux下出現 error: mysql.h: No such file or directory解決辦法

在linux 下使用C語言呼叫 mysql的庫會出現找不到 mysql.h 的錯誤,解決辦法如下 在使用GCC編譯的時候,加上如下幾句 需要在gcc編譯時指定 標頭檔案地址,用命令mysql_config,即可獲取mysql安裝後頭檔案所在位置,庫檔案所在位置,之後指

fatal error C1083 Cannot open include file 'iostream.h' No such file or directory解決方法

VC++6.0 中的一段程式,有用到iostream.h中的標準輸入輸出流,直接用 VS2005編譯器編譯的時候報錯“Cannot open include file: 'iostream.h': No such file or directory”。 舊的原始檔如下:

linux/videodev.h: No such file or directory錯誤解決方法

yum install libv4l-dev* 上面錯誤的問題是兩個2.4以上的核心裡面都沒有包含videodev.h這個檔案了。但是有的在include/linux/下面有videodev.h檔案和videodev2.h這個檔案,但是在v4lgrab.c檔案中只有部

解決Ubuntu編譯error:fatal error: sys/cdefs.h: No such file or directory

64位的Ubuntu如果執行X86平臺32位編譯,gcc -m32 -o x  x.c會報錯:fatal error: sys/cdefs.h: No such file or directory 解

解決fatal error: sys/system_properties.h: No such file or directory compilation terminated.

編譯的異常log: system/core/include/cutils/properties.h:22:35: fatal error: sys/system_properties.h: No such file or directory compilation term

離線安裝expat-2.0.1 ——安裝apr-util 遇到 expat.h: No such file or directory解決

在安裝apr-util-1.6.1 的過程中 ./configure --prefix=/usr/local/apr-util -with-apr=/usr/local/apr/bin/apr-1-config make 之後出現報錯 xml/ap

rpm -ivh vsftpd-3.0.2-22.el7.x86_64.rpm出現error: open of vsftpd-3.0.2-22.el7.x86_64.rpm failed: No such file or directory解決方法

   情況一: 出現如圖問題, 我當時的問題是通過安裝rpmbuild工具軟體解決的 以前製作rpm時,沒有遇到過這個問題,幾經搜尋也沒有解決。後來發現當前的centos沒有安裝 rpmbuild 工具軟體。以前的系統安裝了,索性就安裝了 rpmbuild軟體  

交叉編譯環境的建立:no such file or directory解決方法

建立交叉編譯環境,首先修改了/etc/bash.bashrc中的PATH,發現即使在路徑中有該檔案的東西,可是還是會報“”no such file or directory“”的錯誤,於是在網上尋找了一會答案,發現是缺

cocos2d-x 移植到android編譯的一些問題:fatal error: Box2D/Box2D.h: No such file or directory&quot;

cocos2 app nal get dsc err 2dx ros blue 1、fatal error: Box2D/Box2D.h: No such file or directory" 須要加入box2d庫的支持,改動android.mk

Codeblocks 一直出現 codeblocks fatal error: **.h: No such file or directory

這幾天寫程式的時候動不動就出現這個惱人的錯誤,明明前一次編譯的時候還是好好的。但是繼續寫了一會兒,再編譯就又出現這個錯誤了。真的讓人丈二摸不著頭腦。今天仔細搜了搜 C++ 的命名規範,覺得應該是檔名命名錯了的原因。下面內容出自 Google C++ 風格指南 命名約定 檔案命名

使用交叉編譯編譯,stdio.h: No such file or directory

使用交叉編譯編譯。 ndk-build and an Android.mk with BUILD_EXECUTABLE or, the --sysroot GCC option [1] LOCAL_PATH :=

caffe編譯:fatal error: pyconfig.h: No such file or directory #include "pyconfig.h編譯protobuf

sudo make clean sudo make all -j8 報錯 CXX tools/caffe.cpp In file included from /usr/include/boost/python/detail/prefix.hpp:13:0,

編譯錯誤 無法開啟包括檔案:“SDKDDKVer.h”: No such file or directory

本機安裝了兩個版本的VS就可能會出現這個編譯錯誤, 比如我機器上同時裝了VS2012和VS2008. VS2012中關於Windows SDK的路徑巨集定義和VS2008不同,而在某種情況下VS2008的配置串擾到了VS2012. VS2012繼承了VS2008的Inclu

VS2008"fatal error C1083:無法開啟包括檔案:“Stdafx.h”: No such file or directory

錯誤型別1: 環境:VS2008 語言:C++      下午出了一個非常可惡的問題,我的一個基於MFC 對話方塊的程式因為預編譯標頭檔案stdafx.h的原因始終無法編譯通過。 由於程式整體是需要預編譯標頭檔案的。因此工程內所有cpp檔案通通都包括了#include st

tesseract的編譯安裝 tesseract編譯錯誤:fatal error: allheaders.h: No such file or directory

    需要安裝: <span style="font-family:'Microsoft YaHei';font-size:14px;">apt-get install autoconfapt-get install automakeapt-get install li

編譯u-boot 報錯 openssl/evp.h: No such file or directory

在陸佳華《嵌入式系統軟硬體協同設計實戰指南 第2版》一書的第13章節 編譯U-boot時會遇到2個錯誤。原因很簡單,就從一開始的錯誤提示著手: fatal error: openssl/evp.h: 沒有那個檔案或目錄。當然在網上也可以搜尋到相關的解決方法。在此僅作為記錄

glib標頭檔案找不著 glib.h/glibconfig.h: no such file or directory

glib-2.0使用pkg-configMakefile加上CFLAGS  += `pkg-config --cflags glib-2.0`LDFLAGS += `pkg-config --libs glib-2.0`

關於安裝MySQLdb出現fatal error: my_config.h: No such file or directory

今天在安裝python的模組MySQLdb時,在編譯原始碼時,一直出現一個錯誤,下面是編譯資訊: running build running build_py creating build creating build/lib.linux-x86_64-2.7 cop