0

Is it possible to compile header files with C/C++ preprocessor direktives? (Defines)

I have a project with some header files which are without a cpp file. For example typedefs for different platforms.

I'm looking for a simple solution that can be integrated into my cmakefile.

too honest for this site
  • 12,050
  • 4
  • 30
  • 52
Erik
  • 21
  • 4

2 Answers2

0

Are you looking for precompiled headers maybe? They can be compiled by a makefile.

UKMonkey
  • 6,941
  • 3
  • 21
  • 30
-1

If your headers are included in cpp files, they will automatically be used. If they are not included, what is the point of 'compiling' them ?

So basically, the answer is no, you cannot compile only header files. The purpose of compilation is to produce an executable, a file that do actions when executed. Definitions are not actions, they do nothing on their own.

Hexdump
  • 159
  • 1
  • 7