header-files

Where can I find source code to to 'truly' understand what the standard functions are doing in stdio.h? [closed]

孤街浪徒 提交于 2020-01-02 18:25:43
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . As a newb, like myself, to have great difficulty with searching the header files such as stdio.h for a function like getchar().

Why does OpenBSD's G++ make system headers default to C linkage?

故事扮演 提交于 2020-01-02 10:33:38
问题 I am porting some code to OpenBSD 5.0 and I ran into this very strange problem. My build settings use -isystem /usr/local/include . It is hard to remember but I believe I did that to avoid masses of compiler warnings from my use of -Wall on system types -- like BSD -- that install Boost to /usr/local/include . This seems to work great on FreeBSD. So take the following program: #include <boost/array.hpp> int main() { return 0; } Then build it with: c++ -O2 -pipe -isystem /usr/local/include

Why does OpenBSD's G++ make system headers default to C linkage?

…衆ロ難τιáo~ 提交于 2020-01-02 10:32:28
问题 I am porting some code to OpenBSD 5.0 and I ran into this very strange problem. My build settings use -isystem /usr/local/include . It is hard to remember but I believe I did that to avoid masses of compiler warnings from my use of -Wall on system types -- like BSD -- that install Boost to /usr/local/include . This seems to work great on FreeBSD. So take the following program: #include <boost/array.hpp> int main() { return 0; } Then build it with: c++ -O2 -pipe -isystem /usr/local/include

g++ can't find headers but I did include them

时光毁灭记忆、已成空白 提交于 2020-01-02 08:15:11
问题 I am starting on c++ and already going wrong ... I am trying to compile a small test of levelDB : #include <assert.h> #include "leveldb/db.h" using namespace std; int main() { leveldb::DB* db; leveldb::Options options; options.create_if_missing = true; leveldb::Status status = leveldb::DB::Open(options, "/tmp/testdb", &db); assert(status.ok()); return 1; } Here is the g++ command : g++ -I include/ testLevelDB.cpp Output: /tmp/ccuBnfE7.o: In function `main': testLevelDB.cpp:(.text+0x14):

Why include related header first?

冷暖自知 提交于 2020-01-02 00:47:14
问题 On the question C/C++ include file order/best practices, the best answer recommends to include the related header first. Same for Google and Mozilla style guides. However, in both cases, I couldn't find a good reason why you would do this. Google and Mozilla coding rules look best to me, because they enforce you to include the most "standard" headers first. This way, I think you are less likely to mess up the included files (for examples by undefining some macros used in the other headers etc

Cost of Including Header Files in Objective-C

泪湿孤枕 提交于 2020-01-01 08:46:27
问题 This may seem like a really stupid question, but what is the cost of including (actually, calling #import ) a header file in Objective-C? I get tired of constantly including the same headers in various locations, so I decided to simply create a GlobalReferences.h file that includes several commonly-referenced headers. Is there any appreciable cost for including references to other files if they aren't even used? My gut tells me "no" as it seems like the linker is just made aware of other

Where does Ruby's have_header method look for header files?

百般思念 提交于 2020-01-01 03:21:17
问题 On a CentOS 5.7 box, I'm having trouble installing the newest version of the mysql2 gem; it's not finding errmsg.h: /usr/bin/ruby extconf.rb checking for rb_thread_blocking_region()... yes checking for rb_wait_for_single_fd()... no checking for mysql_query() in -lmysqlclient... yes checking for mysql.h... no checking for mysql/mysql.h... yes checking for errmsg.h... no ----- errmsg.h is missing. please check your installation of mysql and try again. ----- *** extconf.rb failed *** The mysql

C++: Reason why using “.hh” as extension for C++ header files [closed]

做~自己de王妃 提交于 2019-12-31 11:40:49
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I would like to know why we use ".hh" as extension for C++ header files instead of using just ".h". The header files are preprocessed

Where are the headers of the C++ standard library

跟風遠走 提交于 2019-12-31 10:31:51
问题 I wonder where on my file system I find the headers of the C++ Standard library. In particular I am looking for the definition of the vector template. I searched in /usr/include/ and various subdirectories. I also tried 'locate vector.h' which brought up many implementations of vectors, but not the standard one. What am I missing? (The distribution is Gentoo) Background: I'm profiling a library that iterates over vector's most of the time and gprof shows that most of the time is spent in std:

Where are the headers of the C++ standard library

谁说胖子不能爱 提交于 2019-12-31 10:31:46
问题 I wonder where on my file system I find the headers of the C++ Standard library. In particular I am looking for the definition of the vector template. I searched in /usr/include/ and various subdirectories. I also tried 'locate vector.h' which brought up many implementations of vectors, but not the standard one. What am I missing? (The distribution is Gentoo) Background: I'm profiling a library that iterates over vector's most of the time and gprof shows that most of the time is spent in std: