header-files

Where are the C headers in MacOS Mojave?

别等时光非礼了梦想. 提交于 2019-12-01 20:00:40
It seems that Apple keeps on moving their tools around and the old solution of installing the command line tools are with using xcode-select --install doesn't work. In Mojave, xcode-select doesn't install anything anymore (the GUI always fails to find the package) and the command line tools don't install itself in /usr/ or /usr/local . xcode-select --install did work for me in Mojave. Maybe you can try installing XCode from Mac App Store, and then install developer tools? Regarding header locations, I have Apples headers in /Library/Developer/CommandLineTools/ : $ sudo find /Library -name

Is it possible to reference C enums from an assembly file?

删除回忆录丶 提交于 2019-12-01 19:39:39
syscalls.h enum Syscall { OPEN_FILE, READ_FILE, CLOSE_FILE }; syscalls.s extern WRITE_TO_SCREEN global write_to_screen write_to_screen: mov eax, WRITE_TO_SCREEN mov ebx, [esp+4] int 0x80 ret Gives me this error: stdlib/syscalls.o: In function `write_to_screen': stdlib/syscalls.s:(.text+0x1): undefined reference to `WRITE_TO_SCREEN' make: *** [kernel.elf] Error 1 No there isn't. You could do something like: enum_support.h #ifdef __ASSEMBLER__ #define ENUM_START #define ENUM_VALUE(key,value) .equ key,value #define ENUM_END(typename) #else #define ENUM_START typedef enum{ #define ENUM_VALUE(key

What are the rules on #include “xxx.h” Vs #include <xxx.h>? [duplicate]

有些话、适合烂在心里 提交于 2019-12-01 18:55:30
This question already has an answer here: What is the difference between #include <filename> and #include “filename”? 27 answers If I have my own library projects, which style should I use to #include the headers from them in my application? Are there strict rules, and do the two actually have different meanings to the compiler/preprocessor or is it about standards only? There are few rules, according to the ISO standard. Both forms are implementation-dependent as to where they look for the header files. They don't even have to be files. Section 2.9 of C++11 makes no distinction between the

What Should go in my Header File in C++?

╄→尐↘猪︶ㄣ 提交于 2019-12-01 18:14:46
I'm just getting started on my first ever C++ program and am pretty much just learning as I go. The program is supposed to have 3 different files, a header file (prog1.h), a prog1.cpp file (not sure the right terminology for this one) and a test file that includes main: to test our program (prog1_test.cpp). Not asking for help on any of this (yet, I'm sure I'll be posting another question once I get into it), but figured you'd need to know what the program is supposed to do in order to understand my question. Our program is supposed to read in some numbers from a file and put these numbers

Header files linked to from header file not found.

穿精又带淫゛_ 提交于 2019-12-01 18:01:48
I have a problem with Nvidia's OpenCl/Cuda framework, but I think it is a gcc linking issue. The opencl_hello_world.c example file uses following header file: #include "../OpenCL/common/inc/CL/opencl.h" with opencl.h using these header files: #include <../OpenCL/common/inc/CL/cl.h> #include <../OpenCL/common/inc/CL/cl_gl.h> #include <../OpenCL/common/inc/CL/cl_gl_ext.h> #include <../OpenCL/common/inc/CL/cl_ext.h> So all the header files are in the same folder. When I then compile with gcc opencl_hello_world.c -std=c99 -lOpenCL I get following error messages: error: ../OpenCL/common/inc/CL/cl.h

Are there limits to how deep nesting of header inclusion can go?

喜欢而已 提交于 2019-12-01 17:14:50
I can't find anything on MSDN or elsewhere, but are there hard-coded limits to how deep nesting of header inclusion can go? Example: // H1.h // guards etc. #include "H2.h" // H2.h // guards etc. #include "H3.h" //... // HN.h <---- how large can N get?? I wonder if there is anything in the Standard about this. If the answer is implementation defined, then I'm primarily interested in the Visual Studio toolchain. The standard also says something about it (in the part about implementation quantities, annex B): The limits may constrain quantities that include those described below or others. The

QT undefined reference errors when trying to compile

别说谁变了你拦得住时间么 提交于 2019-12-01 17:12:20
I added a class IcecastServer to my QT-project, added the header-file to the pro file and added some code. Everytime I compile it the following errors occur: release/icecastserver.o:icecastserver.cpp:(.text+0x39): undefined reference to _imp___ZN10QTcpServerC1EP7QObject' release/icecastserver.o:icecastserver.cpp:(.text+0x50): undefined reference to imp ZN12QHostAddressC1ENS_14SpecialAddressE' release/icecastserver.o:icecastserver.cpp:(.text+0x68): undefined reference to _imp___ZN10QTcpServer6listenERK12QHostAddresst' release/icecastserver.o:icecastserver.cpp:(.text+0x73): undefined reference

Will there be a performance hit on including unused header files in C/C++?

两盒软妹~` 提交于 2019-12-01 16:31:11
I have a project where each C/C++ file uses a bunch of header files. But about 70-80% of the header files that each C/C++ file uses is the same. So to make my code more readable, I am planning to include all the headers that I will need in the project into a single header file say common_headers.h and include this in all my C/C++ files like this: #include "common_headers.h" Now this will include all the necessary headers but also few extra headers that will not be used by an individual file. I want to know if doing this way, would it hit the performance at run time by any chance? I am fine

Are there limits to how deep nesting of header inclusion can go?

人盡茶涼 提交于 2019-12-01 16:16:59
问题 I can't find anything on MSDN or elsewhere, but are there hard-coded limits to how deep nesting of header inclusion can go? Example: // H1.h // guards etc. #include "H2.h" // H2.h // guards etc. #include "H3.h" //... // HN.h <---- how large can N get?? I wonder if there is anything in the Standard about this. If the answer is implementation defined, then I'm primarily interested in the Visual Studio toolchain. 回答1: The standard also says something about it (in the part about implementation

Will there be a performance hit on including unused header files in C/C++?

怎甘沉沦 提交于 2019-12-01 15:39:55
问题 I have a project where each C/C++ file uses a bunch of header files. But about 70-80% of the header files that each C/C++ file uses is the same. So to make my code more readable, I am planning to include all the headers that I will need in the project into a single header file say common_headers.h and include this in all my C/C++ files like this: #include "common_headers.h" Now this will include all the necessary headers but also few extra headers that will not be used by an individual file.