# disabling nvcc preincludes

**URL:** <https://forums.developer.nvidia.com/t/disabling-nvcc-preincludes/6758>\
**Category:** CUDA Programming and Performance\
**Created:** [December 9, 2008, 10:44am UTC](https://forums.developer.nvidia.com/t/disabling-nvcc-preincludes/6758 "2008-12-09T10:44:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sashang](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sashang](https://forums.developer.nvidia.com/u/sashang)\
**Post date:** [December 9, 2008, 10:44am UTC](https://forums.developer.nvidia.com/t/disabling-nvcc-preincludes/6758/1 "2008-12-09T10:44:00Z")

</div>

Hi

How do you disable the pre-including of header files that nvcc does when compiling \*.cu files? For example this file will compile if compiled as a .cu file even though the headers aren’t there.

```auto
#include <stdio.h>

int

main(int argc, char* argv[])

{

	void* dev;

	cudaError_t err;

	err = cudaMalloc(&dev, 1024);

	cudaFree(dev);

	return 0;

}

```

It will compile with nvcc -o test test.cu. nvcc -E test.cu shows a bunch of include files being shoved into this automatically. How do I disable this?

---

<div class="post-metadata">

**Author:** ![wumpus](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/wumpus/32/12040_2.png) [@wumpus](https://forums.developer.nvidia.com/u/wumpus)\
**Post date:** [December 9, 2008, 11:55am UTC](https://forums.developer.nvidia.com/t/disabling-nvcc-preincludes/6758/2 "2008-12-09T11:55:19Z")

</div>

I don’t think you can, those headers are part of the compilation environment and responsible for quite a lot of the CUDA “built in” things. Why would you want to?
