![](/img/trans.png)
[英]What header files should I include to use the flock function?
我應該包含哪些 header 文件才能在 C 中使用群 function? 我在編譯過程中遇到的錯誤: ...
[英]What header files should I include to use the flock function?
我應該包含哪些 header 文件才能在 C 中使用群 function? 我在編譯過程中遇到的錯誤: ...
[英]Using #include in header files
假設我們有 2 個文件DIO.c和DIO.h 我曾經在DIO.c中 #include 所有必需的 header 文件,而在DIO.h中僅 #include DIO.h 。 在為 ATmega32 開發驅動程序時,我發現一些函數在包含其他模塊時被隱式聲明。 這讓我想知道是否有權將所有文件包含在 he ...
[英]cpp/c++ compilation error: combaseapi.h - No such file or directory
我一直在研究一個在 cpp/c++ 中使用 CoInitializeEx function 創建線程的項目。 當我嘗試編譯代碼時,出現以下錯誤; “致命錯誤:combaseapi.h:沒有這樣的文件或目錄\n 編譯終止。” 我在 windows 10 上,使用 VS 代碼作為 IDE。 任何幫助將 ...
[英]'error()' function in C++ works when I use '#include <iostream>', but not '#include "std_lib_facilities.h"'
我正在使用“使用 C++ 的編程原理和實踐”一書學習 C++ 的編程,而且我之前沒有任何編程經驗。 我正在使用 Visual Studio 2022(C++11、C++14、C++17) 在書的第五章,作者介紹了一個function,叫做'error()',它簡單地拋出一個runtime_erro ...
[英]How can a C# library depend on an unmanaged DLL whose name will only be provided later in the final application?
在 C 中,您可以編譯一個 static 庫,該庫依賴於 C header 定義的幾個函數。 您不需要知道哪個庫將最終實現這些功能,因此您的 static 庫可以與實現無關。 只要您提供有效的實現,您就可以將 static 庫鏈接到最終的可執行文件中。 我怎樣才能在 C# 中做類似的事情? 我想創 ...
[英]Multiple Definition Error Using Header and Implementation Files in C
使用 header 文件 (UDPRBPlib.h) 和實現文件 (UDPRBPlib.c),我不斷收到全局變量的多個定義錯誤,我的所有函數如下所示: Header 文件(UDPRBPlib.h): 實現文件(UDPRBPlib.c): 如果我將所有代碼放在一個文件中,它似乎可以正確運行,但是當代 ...
[英]Struct in headerfile doesnt contain right data
我創建了一個包含結構的頭文件: 函數.h 在文件 config.c 中,我將數據添加到結構中,並且能夠正確打印它。 但是當我嘗試在 main 方法中打印來自該結構的數據時,它無法正常工作。 它只是打印一些隨機字符 因此,當我嘗試訪問 configInput 結構的數據時,它沒有顯示正確的數據。 最好 ...
[英]I am writing a program to say hello to a person after prompting the user for their name but it doesn't work as expected
我嘗試定義一個string數據類型和一個 function 以在 header 文件中獲取用戶輸入。 該代碼正確地接受了輸入(我假設)但沒有給出預期的 output。 這是名為“rosis.h”的 header 文件的代碼 這是名為“hello.c”的主程序的代碼 這是 output 注意:我嘗試在 ...
[英]How can I handle several files in the same program using a single header?
我很難理解 C 手冊建議在單獨的文件中編寫函數的方式。 當我想在相對於 main 的單獨文件中編寫函數時,我通常做的是創建一個 header 文件stuff.h並將所有內容放在那里: 然后在文件main.c我會寫 一切都很好。 在手冊中(第 4.5 章 Header 文件在我的版本中),他們寧願推 ...
[英]How does this C code compile when it does not include the right header files?
我有一個來自 Pokemon Emerald 反編譯代碼庫 ( https://github.com/pret/pokeemerald ) 的 header 文件,它使用在不同的 header 文件中定義的類型,但不包括 header,或包括任何 88185,800806 文件但代碼仍然以某種方式 ...
[英]How to repeat code using __VA_ARGS__ in c++?
我想在 C++ 中創建一個執行以下操作的宏。#define SETUP_BULK(...) \ SETUP_HELPER(__VA_ARG__) \ // repeat this for all __VA_ARGS__ 這可能嗎? 我查找了有關迭代__VA_ARGS__的其他問題,但無濟於事。 ...
[英]include own header file in arduino's ide
嘿,聖誕快樂, 我想包含一個 header 文件,該文件是我在 Arduino 主代碼中創建的。 不幸的是,在編譯時我收到錯誤消息,即找不到 header 文件。 到目前為止,我在 windows 10 上使用 Arduino IDE 2.0.3,沒有出現重大問題。 這是,據我所知,到目前為止我所做 ...
[英]Python change headerrow of textfile (.csv)
我有一個標題行不正確的 txt 文件。 如何用正確的標題行替換標題行?old_header = "1;2;3;4;5;" new_header = "1;2;3;4;5;6;7;8" 如果我閱讀文件,我不會得到第一行。 with open(full_path) as file: ...
[英]Is iostream a header or a library
我剛剛開始學習 cpp,真正讓我困惑的一件事是#include <iostream>或#include<vector> 。 有人說我們正在包含 iostream 庫,有人說#include用於包含頭文件。 但是iostream和vector沒有.h擴展名,那么它們怎么可能是頭 ...
[英]C++ Error: ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1
我正在寫一個小項目。 我在.hpp文件中聲明了一個類,並在.cpp文件中定義了它,但是當我使用它時,鏈接出現了一些錯誤。 DSMgr.hpp DSMgr.cpp predefine.hpp testt.cpp 以下是錯誤信息。/usr/bin/clang++ -std=c++14 -fcolor- ...
[英]opencv chamfer distance C++ code missing header file
我正在嘗試編譯以下代碼來計算倒角距離。 但是我在編譯時遇到以下錯誤。 我在 64 位 ubuntu 18.04 上使用 opencv-3.2。 Synaptic 包管理器說 libopencv-contrib-dev 和 libopencv-contrib-3.2 分別安裝在 /usr/inclu ...
[英]GCC Warning - "warning: extra tokens at end of #include directive"
在嘗試包含自定義 header 文件時,我在 C 代碼中看到以下錯誤 - “警告:#include 指令末尾的額外標記”,盡管即使在拋出錯誤之后,程序似乎仍按預期工作。 但為什么會出現警告信息? 有什么意義? 代碼: header 文件: 警告背后的原因是什么? 代碼和header文件如上所述。 ...
[英]How to generate Native header files from java files in Android Studio
我正在嘗試學習 Android 本機編程,但我無法使用 Javac -h 從 java 源文件生成 header 文件。 javac -h "destination path desired for header files" then i add Java source file 但我不斷收到錯誤 ...
[英]Source and Header file syntax in MPLAB X IDE v5.50
我正在為我的 PIC32MK1024MCM 項目開發代碼。 我已經很好地測試了代碼,現在我只是將所有代碼模塊放入最終項目中(此示例中的代碼尚未完成,但功能不是這里感興趣的軸心)。 我有生以來第一次想讓它更專業一點,並為所有不同的模塊 function 聲明使用單獨的源文件和 header 文件。 但 ...
[英]Is there any way to define a struct/enum in source file but give interface in header file
有什么方法可以隱藏源文件(.c)中的結構/枚舉並僅在 header 文件(.h)中提供其接口? ...