header-files Questions

6

Solved

Essentially, I've been able to install openCV fine for python but I also want to be able to do it for C++. I was able to install it using my linux distro's package manager (pacman for manjaro which...
Emikoemil asked 20/10, 2019 at 23:19

3

I have a cmake project that has: A static library called Project1 A static library called Project2 that depends on Project1 An executable called Project3 that depends on both libraries Everythin...
Diazine asked 8/2, 2021 at 4:21

4

Solved

If I declare static const variable in header file like this: static const int my_variable = 1; and then include this header in more than one .c files, will compilator make new instance per each ...
Boffa asked 12/8, 2016 at 7:18

3

I am using clang-tidy as a "linter" tool in development. I started to integrate 3rd party software into my code and when I include their header files using: -I/path/to/include tons of errors ar...
Zestful asked 15/5, 2018 at 17:16

1

Solved

I adapted a function I found on SO for SSE2 and included it in my program. The function uses SSE2 intrinsics to calculate the leading zero count of each of the 8 x 16bit integers in the vector. Whe...
Boyar asked 31/12, 2023 at 12:40

3

Solved

I have found the following code when refactoring: #ifndef TARGET_OS_LINUX #pragma once #endif Can anyone help me understand #pragma once? What, when, where, and why is it used? Do you have an exam...
Urethritis asked 11/8, 2009 at 23:25

3

In our workflow, we can have a module A that is composed of several header files, module A not producing any binary (side note: it will obviously be used by other modules, that include some of the ...
Escadrille asked 20/11, 2014 at 11:56

2

Solved

By entering the file with its extension, my code succeeds to detect the type of the file from the "magic number". magic_numbers = {'png': bytes([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, ...
Cerelia asked 13/10, 2021 at 19:42

3

Solved

I am getting a really odd error from GCC 4.8.1 with inline functions. I have two near-identical inline functions defined in header files (debug.h and error.h) in src/include/, with the only differ...
Gotha asked 28/9, 2013 at 15:47

2

Solved

//vector.h #ifndef MYVECTOR_H_ #define MYVECTOR_H_ #include<iostream> #include<vector> using namespace std; class vectors { public: vectors(void); ~vectors(void); vectors(int *vec,...
Goodbye asked 14/12, 2019 at 4:44

6

Solved

What happens if I include iostream or any other header file twice in my file? I know the compiler does not throw error. Will the code gets added twice or what happens internally? What actually ...
Squalid asked 17/10, 2012 at 7:7

2

Solved

When I'm trying to compile my C++ project in Visual Studio, I keep getting the 2 following errors: E1574: Static assertion failed with "Windows headers require the default packing option. Changin...
Trellas asked 12/6, 2019 at 21:35

11

Solved

How come this code std::map <std::string , int> m; m["a"]=1; compiles with (I'm using MSVC 2010) #include <string> but not with #include <string.h> ?
Accommodation asked 13/2, 2012 at 8:48

3

Solved

In C++, what is the purpose of include guards in a header? I have read that it is for preventing including files again and again, but how do header guard guarantee this
Almeida asked 5/6, 2010 at 6:15

18

You can structure a C++ program so that (almost) all the code resides in Header files. It essentially looks like a C# or Java program. However, you do need at least one .cpp file to pull in all the...

5

Solved

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++. T...
Champignon asked 8/1, 2010 at 13:57

4

Solved

Every time I try this: long crypt(int *integer) { printf("Enter five digit integer:\n"); scanf("%i",integer); int digit1=integer/10000; int digit2=(integer%10000)/1000; ...
Congest asked 10/12, 2011 at 23:57

4

Solved

I have several 450 element character arrays (storing bitmap data to display on lcd screens.) I would like to put them under a header file and #define them, but I keep getting compilation errors. Ho...
Remembrancer asked 23/3, 2012 at 21:49

4

I am trying to compile some C code (called rand_beta) in terminal which contains the lines to include R.h and Rmath.h header files using gcc -o rand_beta rand_beta.c so I can then call the code fro...
Withershins asked 21/11, 2013 at 17:38

6

Solved

I have no idea what this means. But here is the code that it supposely is happening in. //======================================================================================= // d3dApp.cpp by F...
Convolution asked 6/4, 2010 at 3:42

5

Solved

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...
Backfire asked 9/5, 2013 at 4:1

3

Solved

I could find stdio.h header file easily through search in Windows Explorer, but couldn't find its implementation file like stdio.lib(?). Where can I find it? Additionally, I can't find Windows.h t...
Homebred asked 9/12, 2012 at 9:11

3

Solved

In a related question ("std::string formatting like sprintf") I learned about this awesome new C++20 header <format>. However, there seems to be no supporting compiler. Is this correct or is...
Must asked 26/4, 2020 at 13:19

4

What I want to achieve: I want to set custom baud rate values for some tty*-like UART-mapped terminals. How: The only way I found by far is to use the struct termios2 structure which is located in...
Re asked 8/6, 2016 at 18:46

5

I am using CMake on a small C++ project and so far it works great... with one twist :x When I change a header file, it typically requires recompiling a number of sources files (those which include ...
Scrobiculate asked 18/9, 2011 at 10:54

© 2022 - 2025 — McMap. All rights reserved.