c++ - Error when compiling using dmc 8.52
- Edward Diener (28/28) Aug 18 2010 The following code:
- Walter Bright (4/6) Aug 20 2010 When I run it I get:
- Edward Diener (37/43) Aug 20 2010 Source file is called TestFile.cpp:
- Walter Bright (3/9) Aug 20 2010 Yes, I got the same error now. It's because it is already defined, on li...
- Edward Diener (3/12) Aug 20 2010 The code is not defining the macro again. The error is bogus and should
- Walter Bright (2/16) Aug 20 2010 Right, it's defining a symbol again, not a macro.
- Edward Diener (3/19) Aug 21 2010 Are you claiming that this is an error in the particular C++ code
- Walter Bright (12/33) Aug 21 2010 Consider:
- Edward Diener (2/35) Aug 21 2010 OK, I see it now.
The following code: #include <cwctype> namespace std{ extern "C"{ #ifdef iswalnum inline int (iswalnum)(wint_t i) { return iswalnum(i); } #undef iswalnum #else #error iswalnum is undefined #endif } // extern "C" } // namespace std when compiled with dmc 8.52 using a sc.ini file of: [Version] version=8.52 [Environment] PATH=%PATH%;"% P%\..\bin" BIN="% P%\..\bin" INCLUDE="% P%\..\stlport\stlport";"% P%\..\include";"% P%\..\mfc\include";%INCLUDE% LIB="% P%\..\lib";"% P%\..\mfc\lib";%LIB% HELP="% P%\..\help" which puts stlport first among the includes, gives an error of: C:\Programming\Programs\TestDMC\TestFile.cpp(8) : Error: 'iswalnum' is already defined --- errorlevel 1 This appears to be a bug in dmc, and this bug is occuring when I try to run configuration tests for dmc for Boost.
Aug 18 2010
Edward Diener wrote:This appears to be a bug in dmc, and this bug is occuring when I try to run configuration tests for dmc for Boost.When I run it I get: Error test.cpp 7: iswalnum is undefined with or without -I\dm\stlport\stlport as a command line switch.
Aug 20 2010
On 8/20/2010 2:18 PM, Walter Bright wrote:Edward Diener wrote:Source file is called TestFile.cpp: #include <cwctype> namespace std{ extern "C"{ #ifdef iswalnum inline int (iswalnum)(wint_t i) { return iswalnum(i); } #undef iswalnum #else #error iswalnum is undefined #endif } // extern "C" } // namespace std The sc.ini is: [Version] version=8.52 [Environment] PATH=%PATH%;"% P%\..\bin" BIN="% P%\..\bin" INCLUDE="% P%\..\stlport\stlport";"% P%\..\include";"% P%\..\mfc\include";%INCLUDE% LIB="% P%\..\lib";"% P%\..\mfc\lib";%LIB% HELP="% P%\..\help" The command line is: dmc -c TestFile.cpp Result is: { return iswalnum(i); } ^ TestFile.cpp(7) : Error: 'iswalnum' is already defined --- errorlevel 1 Would you please try that exactly and see if it is the same ? The only version of dmc I have is 8.52, and I compiled from within the dmc bin directory just to make sure nothing changed from when i originally compiled it from outside the dmc bin directory with my PATH pointing to the bin directory. I am under Windows Vista Ultiante x_64. The version of StlPort under dmc says 4.5.3.This appears to be a bug in dmc, and this bug is occuring when I try to run configuration tests for dmc for Boost.When I run it I get: Error test.cpp 7: iswalnum is undefined with or without -I\dm\stlport\stlport as a command line switch.
Aug 20 2010
Edward Diener wrote:{ return iswalnum(i); } ^ TestFile.cpp(7) : Error: 'iswalnum' is already defined --- errorlevel 1 Would you please try that exactly and see if it is the same ?Yes, I got the same error now. It's because it is already defined, on line 148 of \dm\stlport\stlport\config\stl_wince.h
Aug 20 2010
On 8/20/2010 7:34 PM, Walter Bright wrote:Edward Diener wrote:The code is not defining the macro again. The error is bogus and should not be occurring.{ return iswalnum(i); } ^ TestFile.cpp(7) : Error: 'iswalnum' is already defined --- errorlevel 1 Would you please try that exactly and see if it is the same ?Yes, I got the same error now. It's because it is already defined, on line 148 of \dm\stlport\stlport\config\stl_wince.h
Aug 20 2010
Edward Diener wrote:On 8/20/2010 7:34 PM, Walter Bright wrote:Right, it's defining a symbol again, not a macro.Edward Diener wrote:The code is not defining the macro again. The error is bogus and should not be occurring.{ return iswalnum(i); } ^ TestFile.cpp(7) : Error: 'iswalnum' is already defined --- errorlevel 1 Would you please try that exactly and see if it is the same ?Yes, I got the same error now. It's because it is already defined, on line 148 of \dm\stlport\stlport\config\stl_wince.h
Aug 20 2010
On 8/21/2010 1:10 AM, Walter Bright wrote:Edward Diener wrote:Are you claiming that this is an error in the particular C++ code presented, and that the dmc compiler is correct in flagging it as such ?On 8/20/2010 7:34 PM, Walter Bright wrote:Right, it's defining a symbol again, not a macro.Edward Diener wrote:The code is not defining the macro again. The error is bogus and should not be occurring.{ return iswalnum(i); } ^ TestFile.cpp(7) : Error: 'iswalnum' is already defined --- errorlevel 1 Would you please try that exactly and see if it is the same ?Yes, I got the same error now. It's because it is already defined, on line 148 of \dm\stlport\stlport\config\stl_wince.h
Aug 21 2010
Edward Diener wrote:On 8/21/2010 1:10 AM, Walter Bright wrote:Consider: ============================================= H:\cbx\ztc>type test2.cpp inline int foo() { return 0; } inline int foo() { return 0; } H:\cbx\ztc>scppn test2 inline int foo() { return 0; } ^ test2.cpp(2) : Error: 'foo' is already defined ============================================== Is this not correct behavior?Edward Diener wrote:Are you claiming that this is an error in the particular C++ code presented, and that the dmc compiler is correct in flagging it as such ?On 8/20/2010 7:34 PM, Walter Bright wrote:Right, it's defining a symbol again, not a macro.Edward Diener wrote:The code is not defining the macro again. The error is bogus and should not be occurring.{ return iswalnum(i); } ^ TestFile.cpp(7) : Error: 'iswalnum' is already defined --- errorlevel 1 Would you please try that exactly and see if it is the same ?Yes, I got the same error now. It's because it is already defined, on line 148 of \dm\stlport\stlport\config\stl_wince.h
Aug 21 2010
On 8/21/2010 1:33 PM, Walter Bright wrote:Edward Diener wrote:OK, I see it now.On 8/21/2010 1:10 AM, Walter Bright wrote:Consider: ============================================= H:\cbx\ztc>type test2.cpp inline int foo() { return 0; } inline int foo() { return 0; } H:\cbx\ztc>scppn test2 inline int foo() { return 0; } ^ test2.cpp(2) : Error: 'foo' is already defined ============================================== Is this not correct behavior?Edward Diener wrote:Are you claiming that this is an error in the particular C++ code presented, and that the dmc compiler is correct in flagging it as such ?On 8/20/2010 7:34 PM, Walter Bright wrote:Right, it's defining a symbol again, not a macro.Edward Diener wrote:The code is not defining the macro again. The error is bogus and should not be occurring.{ return iswalnum(i); } ^ TestFile.cpp(7) : Error: 'iswalnum' is already defined --- errorlevel 1 Would you please try that exactly and see if it is the same ?Yes, I got the same error now. It's because it is already defined, on line 148 of \dm\stlport\stlport\config\stl_wince.h
Aug 21 2010