Click to See Complete Forum and Search --> : Visual Studio: How to not include windows libraries?
thomas_fogh
February 2nd, 2005, 09:26 AM
I'm porting a library from linux which only uses standard c++ libraries.
I've created a project in Visual Studio .NET disabled ATL, but still I get the following error:
Compiling...
xxxx.c
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlbase.h(52) : fatal error C1189: #error : ATL requires C++ compilation (use a .cpp suffix)
(The library is a mix of .c and .cpp files)
Anyone has an idea why I get this error?
NoHero
February 2nd, 2005, 10:08 AM
Rename all your class files to .cpp if you want to compile them within the default ATL. If so you should create a "Windows application" and select "Console application" after this check "Empty project" add all your files to it, and you can use them without any problems.
thomas_fogh
February 2nd, 2005, 10:20 AM
I don't want to use ATL. I just want to use "standard" c++ libraries.
The library will later be used on a embedded device, which only has
these standard libraries.
NoHero
February 2nd, 2005, 10:48 AM
I don't want to use ATL. I just want to use "standard" c++ libraries.
The library will later be used on a embedded device, which only has
these standard libraries.
Then do what I have said and you will create an empty project. It does not use anything for default and you can simply add your files to it.
thomas_fogh
February 2nd, 2005, 11:54 AM
Sorry, I must have misunderstood something, when I read it earlier.
I've tried it and seems to be working.
Thank you very much!
thomas_fogh
February 3rd, 2005, 07:51 AM
When I include a .c file I get this error:
fatal error C1189: #error : ATL requires C++ compilation (use a .cpp suffix)
So it seems to still include some windows header files...
Andreas Masur
February 3rd, 2005, 07:57 AM
The error simply says it....ATL cannot be compiled using the C compiler (which usually happens whiel compiling files with '.c' extension....
thomas_fogh
February 4th, 2005, 06:50 AM
I've disabled ATL (or so I thought) and used the option "Compile as C++ code".
NoHero
February 4th, 2005, 06:56 AM
I've disabled ATL (or so I thought) and used the option "Compile as C++ code".
Just for clearing this out: If you name a source file .c the Microsoft Compiler will automatically assume that it contains C files. And the ATL is a set of classes and generic containers which require C++ compiling. To overcome this you either rename the file to .cpp or set the compiler flag.
Ajay Vijay
February 4th, 2005, 08:00 AM
If you dont want to use ATL, just remove all #include from all source files, that refer to ATL headers.
Regards.
thomas_fogh
February 4th, 2005, 08:59 AM
If you dont want to use ATL, just remove all #include from all source files, that refer to ATL headers.
Regards.
Actually I'm porting a linux c++ library, which of course doesn't contain any ATL headers.
Configuration Properties -> General -> Use of ATL: Not Using ATL
.. -> C/C++ -> Advanced -> Compile As: Compile As C++ Code (/TP)
I even specified:
.. -> C/C++ -> Preprocessor -> Preprocessor Definitions : _CONSOLE
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.