gcc編譯出現“warning: implicit declaration of function ‘inet_aton’”
在linux下寫了一個簡單的網路程式,用到函式inet_aton。使用gcc編譯,編譯的時候加上了-std=c99,編譯可以通過,但是報錯“warning: implicit declaration of function ‘inet_aton’”。去掉-std=c99,編譯正常通過,沒有報錯。google了一下,發現gcc提供的一些c擴充套件與標準c有衝突。在gcc中使用"-std=c99"時,gcc會關閉產生衝突的擴充套件。如果要使用gcc針對c99的擴充套件,設定“-std=gnu99”,編譯就不會報錯了。
http://stackoverflow.com/questions/1783792/why-does-gcc-report-implicit-declaration-of-function-round
相關推薦
gcc編譯出現“warning: implicit declaration of function ‘inet_aton’”
在linux下寫了一個簡單的網路程式,用到函式inet_aton。使用gcc編譯,編譯的時候加上了-std=c99,編譯可以通過,但是報錯“warning: implicit declaration of function ‘inet_aton’”。去掉-std=c99,編譯
C語言中,函式不宣告也能使用,但會出現warning: implicit declaration of function
偶然發現有很多自定義函式未經宣告卻能在主程式中被呼叫,這就奇怪了,連使用標準庫函式printf()都要包括標準輸入輸出標頭檔案<stdio.h>,何況是自定義函式?這個問題困擾了我很久。 今天通過實驗,基本明白了箇中原因。一、在VC6中, 1、檔案test1.
warning: implicit declaration of function 與c99
-U__STRICT_ANSI_ -std=c99 或者 -std=iso9899:1999 使用C99規範。 -std=gnu89 使用c89規範加上gcc自己的擴充套件(目前預設) -std=gnu99 使用c99規範加上gcc自己的擴充套件 編譯時更改規範為c99擴充
驅動模組編譯錯誤提示--implicit declaration of function ‘kmalloc’
驅動模組編譯時出現如下錯誤: error: implicit declaration of function ‘kmalloc’ error: implicit declaration of function ‘kfree’ 解決辦法: 新增如下標頭檔案即可: #
解決編譯錯誤 implicit declaration of function 'strptime'
div 編譯選項 cit fine 編譯錯誤 定義 .com glibc this 根據man手冊,在文件中加上以下定義,應該可以去處該warning #define _XOPEN_SOURCE /* glibc2 needs this */
NDK編譯JNI檔案報錯implicit declaration of function 'RCCread' is invalid in C99 [-Wimplicit-function-declar
關於JNI報錯 I:/AndroidProject/APP4/ledtest/jni/com_topeet_ledtest_ad1256.c:32:14:警告:函式'RCCread'的隱式宣告在C99中無效[-Wimplicit-function-dec
關於Xcode6編譯變更 “Implicit declaration of function 'sysctl' is invalid in C99” 報錯問題
之前程式碼在Xcode5.1上面跑的好好的,但是自從升級到6.0之後,就經常出現編譯報錯問題。後來查閱的相關資料,好像是Xcode為了相容Swift語言,更換來編譯系統(名字忘記了)。於是就報了一個C語言的C99編譯錯誤,不說了,直接上程式碼。 一般出現該問題是因
linux下C語言程式設計解決warning : incompatible implicit declaration of built-in function問題
在C語言程式設計過程中,偶遇如下warning,雖然並不影響最終的編譯結果,但是看著warning也很無語,畢竟強迫症。 我們可以發現被警告沒有宣告的都是常用
用keil編譯提示 warning: #...: last line of file ends without a newline
str 空格 LG ref title mil div 警告 OS 用keil編譯提示 warning: ......: last line of file ends without a newline 最後一行回車後還要保證是在第一列,新一行不能有空格等空字符才能不出
gcc編譯出現dlopen、dlerror、dlsym、dlcolse的解決方法
➜ test_sqlite3 gcc *.c -I . -o xixi -pthread /tmp/cckGKTrr.o: In function `unixDlOpen':
virt-viewer-5.0編譯出現At one least of spice or vnc must be used
條件:先編譯spice-gtk-0.33原始碼. 系統:Fedora25 架構:x64 1 ./configure ;make; make install 2.進入virt-viewer-5.0目錄執行./configure時,出現了了如題的錯誤。 第一種原因是 配置spice時,未
gcc編譯出現segmentation fault的錯誤
segmentation fault 即段錯誤,一般都是出現了非法的地址寫操作導致的。 常見的有如下幾種情況: 1、空指標訪問。 如果指標為空(NULL), 那麼對空指標的讀寫操作都會導致segmentation fault。 如 1 2 3 ch
如何解決linux下編譯出現的multiple definition of錯誤
今天,在編譯quagga的過程中出現了multiple definition of的錯誤。該錯誤表示不同檔案對同一變數進行了重複定義。因此,可以從以下幾個方面來排查這個問題: 1. 是否定義了重複變數: 直觀來講,如果在已經引用的global.h中定義了變數v,那麼在本檔案
Linux程式設計時使用gcc編譯.c出現以下問題warning: the `gets' function is dangerous and should not be used.
Linux程式設計時使用gcc編譯.c出現以下問題 [[email protected] final1]# gcc -pthread client.c /tmp/ccSuK4v5.o: In function `writedata': client.c:(.text+0xb2a): w
GCC編譯WARNING解決:"extra tokens at end of #ifndef directive" tags: GCC,WARNING
近日,檢查專案中的所有的WARNING,發現了一個有趣的WARNING: “extra tokens at end of #ifndef directive”。從字面上來看是"在#ifndef後面有無效的指令"。私下裡寫了小程式驗證,發現有兩種情況可以產生這個W
Kernel編譯出現error, forbidden warning
這是在編譯的過程中,由於程式碼不符合規範所致,比如型別轉換時未強制轉化,或者定義了某些變數或者函式卻沒有使用,這些都會出現警告,而警告將會被看做錯誤來處理。 修改自己的程式碼,將出現的警告全部解決掉,該強制轉換的強制轉換,該刪除定義了未使用的變數函式刪除或者註釋掉
mysql 匯入sql檔案,出現ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL報錯
ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL mysql的設定預設是不允許建立函式 1、更改全域性配置 SET GLOBAL l
arm-linux-gcc編譯時出現的一些小插曲-----64位系統需要32位的庫
最近由於工作的需要,重新弄起arm-linux-gcc編譯。離上一次弄這些有整整10年了。 我是在一臺64位的機器上實機安裝的 centos7 發行版,系統和交叉編譯器的安裝過程自是沒話說,問題出在使用arm-linux-gcc編譯 arm程式時, $ arm-linu
Linux程式設計時使用gcc編譯.c出現以下問題,pthread.c:(.text+0x29): undefined reference to `pthread_create'collect2: err
Linux程式設計時使用gcc編譯.c出現以下問題 client.c:(.text+0x13e): undefined reference to `pthread_create' collect2: ld 返回 1 解決方法如下: 只需在用gcc編譯時加上-pthread選項即
關於Ubuntu下gcc編譯帶-lsqlite3出現錯誤的解決方法
如下錯誤: /usr/bin/ld: 找不到 -lsqlite3 collect2: error: ld returned 1 exit status Makefile:16: recipe for target 'FrontServer' failed make: ***