header-files

Header files for x86 SIMD intrinsics

孤街浪徒 提交于 2019-11-26 23:15:02
Which header files provide the intrinsics for the different x86 SIMD instruction set extensions (MMX, SSE, AVX, ...)? It seems impossible to find such a list online. Correct me if I'm wrong. fredoverflow <mmintrin.h> MMX <xmmintrin.h> SSE <emmintrin.h> SSE2 <pmmintrin.h> SSE3 <tmmintrin.h> SSSE3 <smmintrin.h> SSE4.1 <nmmintrin.h> SSE4.2 <ammintrin.h> SSE4A <wmmintrin.h> AES <immintrin.h> AVX <zmmintrin.h> AVX512 If you use just #include <x86intrin.h> it will include all SSE/AVX headers which are enabled according to compiler switches like -march=corei7 or just -march=native . Additionally some

multiple definition in header file

无人久伴 提交于 2019-11-26 22:08:22
Given this code sample: complex.h : #ifndef COMPLEX_H #define COMPLEX_H #include <iostream> class Complex { public: Complex(float Real, float Imaginary); float real() const { return m_Real; }; private: friend std::ostream& operator<<(std::ostream& o, const Complex& Cplx); float m_Real; float m_Imaginary; }; std::ostream& operator<<(std::ostream& o, const Complex& Cplx) { return o << Cplx.m_Real << " i" << Cplx.m_Imaginary; } #endif // COMPLEX_H complex.cpp : #include "complex.h" Complex::Complex(float Real, float Imaginary) { m_Real = Real; m_Imaginary = Imaginary; } main.cpp : #include

Installation of Visual Studio 2010 (any edition) installs only 2 files in the C++ headers directory

╄→尐↘猪︶ㄣ 提交于 2019-11-26 22:08:21
I installed Visual Studio 2010 Premium on my Windows 7 workstation. After loading a test C++ project, I noticed that it could not locate iostream. I took a look in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include and noticed that only two files exist here, srv.h and wmiatlprov.h I installed the VS2010 product on a test virtual machine, and this directory ( ...\VC\include ) is filled with the usual collection of folders and headers (the materials you'd expect to find in the includes directory.) I have taken the following steps to rectify the missing headers on the problem

How to create two classes in C++ which use each other as data?

拥有回忆 提交于 2019-11-26 21:42:20
I'm looking to create two classes, each of which contains an object of the other class type. How can I do this? If I can't do this, is there a work-around, like having each class contain a pointer to the other class type? Thanks! Here's what I have: File: bar.h #ifndef BAR_H #define BAR_H #include "foo.h" class bar { public: foo getFoo(); protected: foo f; }; #endif File: foo.h #ifndef FOO_H #define FOO_H #include "bar.h" class foo { public: bar getBar(); protected: bar b; }; #endif File: main.cpp #include "foo.h" #include "bar.h" int main (int argc, char **argv) { foo myFoo; bar myBar; } $ g+

List of standard header files in C and C++

北慕城南 提交于 2019-11-26 21:24:03
Where could I find the list of all header files in C and C++? While I am building a library, I am getting an error like ' tree.h not found '. I suppose this is a standard header file in C and C++. This raised in me the curiosity to know all the header files and their contribution. Is there a place I can search for? I am working on Solaris Unix. Try here : http://en.cppreference.com/w/ However, you may also be refering to the header files of your OS. These can be found either on MSDN (Windows) or by man command (POSIX systems). Or another source if you're on another OS. The header 'tree.h' is

sql.h header file missing though unixODBC is installed

我是研究僧i 提交于 2019-11-26 20:53:14
问题 I am on an up-to-date Ubuntu 12.04 system. I have unixodbc (v2.2.14 from ubuntu repos), MySQL and its relevant drivers installed. Also connected to a valid DSN. Verified by issuing isql DBName UName passwd . I am trying to compile a C application that interacts with the database using ODBC. Almost everywhere I searched seemed to indicate that I should have "sql.h" installed somewhere. A find / -iname sql.h -print showed I don't have it. So my question is: where is it? Did something go wrong

endian.h not found on mac osx

非 Y 不嫁゛ 提交于 2019-11-26 20:52:24
问题 I meet some trouble when I compile some C code on my mac which give me this error : fatal error: 'endian.h' file not found I did some google search about this problem.It seems like mac os x does not have header files like "endian.h", we have to create this file manually. Then, I found this http://www.opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/Endian.h which might be the file I am looking for but not sure. But more troubles are coming.. where should I put this file? The file

Python.h header file missing on Mac OS X 10.6

一笑奈何 提交于 2019-11-26 20:44:14
问题 I'm trying to access a shared C library in Python with ctypes on Mac OS X 10.6.8 with Python 2.7.4. To do this, I need to #include <Python.h> in my C code. If I try to compile a C script that only has that one include statement in it, call it "sample.c", I get: $ gcc -shared -o sample.so sample.c sample.c:1:20: error: Python.h: No such file or directory Since I'm running Mac 10.6, I have Xcode 3.2.6, the latest version available on this iteration of OS X without paying to upgrade to 10.7 and

Is the backslash acceptable in C and C++ #include directives?

ⅰ亾dé卋堺 提交于 2019-11-26 20:34:21
There are two path separators in common use: the Unix forward-slash and the DOS backslash. Rest in peace, Classic Mac colon. If used in an #include directive, are they equal under the rules of the C++11, C++03, and C99 standards? C99 says (§6.4.7/3): If the characters ', \, ", //, or /* occur in the sequence between the < and > delimiters, the behavior is undefined. Similarly, if the characters ', \, //, or /* occur in the sequence between the " delimiters, the behavior is undefined. (footnote: Thus, sequences of characters that resemble escape sequences cause undefined behavior.) C++03 says (

Are there tools that help organizing #includes?

一世执手 提交于 2019-11-26 20:25:11
问题 Are there any tools that help organizing the #include s that belong at the top of a .c or .h file? I was just wondering because I am reorganizing my code, moving various small function definitions/declarations from one long file into different smaller files. Now each of the smaller files needs a subset of the #include s that were at the top of the long file. It's just annoying and error-prone to figure out all #includes by hand. Often the code compiles even though not all #include s are there