KcFnMi
KcFnMi

Reputation: 6171

How to deal with pragma once?

To my understanding Visual Studio C++ projects use #pragma once in the very top of header files to prevent multiple inclusion.

And the same is achieved, in Qt Creator projects, with

#ifndef   FILE_H
#define   FILE_H
// Code here
#endif

Let's say I got a Visual Studio project and I want to play with Qt Creator. How to deal with the #pragma once issue?

If possible I don't want to edit all header files.

Upvotes: 1

Views: 1154

Answers (1)

ivan.ukr
ivan.ukr

Reputation: 3561

Yes, really, #pragma once originates from Microsoft C++, but nowadays it is supported by at least two another most used modern C++ compilers (i.e GCC and clang). So you should not have a problems with it.

Upvotes: 1

Related Questions