why DevCpp does not have support to this this directive?
I got a baunch of sources w/ #pragma once, pack directives.
how can i bzpass or replace this directive?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Most #pragmas are compiler specific, and your code most probably came from someone developing with MS Visual C++.
Normally, any compiler should ignore a #pragma that it doesn't recognise. However, GCC can be told to issue a warning for unknown #pragmas, with the -Wunknown-pragmas, which is also enabled by the -Wall option. If you have -Wall -Werror specified then the compiler should halt. You can change your options to -Wall -Werror -Wno-unknown-pragmas to fix this.
I would suggest that you comment them out, using C++ style comments "//" before each one. If it still compiles and runs correctly, you have two choices:
1) If the code is not shared with other people using a different compiler, just leave it.
2) If you need to merge the changes back to a shared project, surround the #pragmas with a guard, such as:
ifndef GNUC
pragma pack whatever
endif
If it doesn't work, you're going to need to work out why those pragmas are there, and speak to the developer about replacing them with something cross-platform. Good luck.
Cheers,
Ian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
why DevCpp does not have support to this this directive?
I got a baunch of sources w/ #pragma once, pack directives.
how can i bzpass or replace this directive?
Most #pragmas are compiler specific, and your code most probably came from someone developing with MS Visual C++.
Normally, any compiler should ignore a #pragma that it doesn't recognise. However, GCC can be told to issue a warning for unknown #pragmas, with the -Wunknown-pragmas, which is also enabled by the -Wall option. If you have -Wall -Werror specified then the compiler should halt. You can change your options to -Wall -Werror -Wno-unknown-pragmas to fix this.
GCC (the compiler inside Dev-C++) doesn't really utilise #pragmas - see http://gcc.gnu.org/onlinedocs/gcc-3.4.4/cpp/Pragmas.html#Pragmas for details.
I would suggest that you comment them out, using C++ style comments "//" before each one. If it still compiles and runs correctly, you have two choices:
1) If the code is not shared with other people using a different compiler, just leave it.
2) If you need to merge the changes back to a shared project, surround the #pragmas with a guard, such as:
ifndef GNUC
pragma pack whatever
endif
If it doesn't work, you're going to need to work out why those pragmas are there, and speak to the developer about replacing them with something cross-platform. Good luck.
Cheers,
Ian
thanks .