AnsweredAssumed Answered

Compiler error "undefined identifier 'sprintf' "

Question asked by Robert Braisted on Jul 15, 2011
Latest reply on Jul 20, 2011 by CrasyCat

i'm using CW for MobileGT V9.2 and using the command_line_tools to build with. I've built a similar project for C and sprintf gets resolved there just fine and i can see from the .map file that it is defined in in the following lib.a

sprintf     MSL_C.PPCEABI.bare.H.UC.a printf.o

 

I assume that i'm not including the right library somehow for the C++ environment i'm trying to build. i would have thought that defining the following would get sprintf resolved

 

set MWLibraryFiles=%CWFolder%\PowerPC_EABI_Support\MSL\MSL_C\PPC_EABI\Lib\MSL_C.PPCEABI.bare.H.UC.a;%MWLibraryFiles%

 

the compile command is

 

mwcceppc -gdwarf2 -C -proc e300c1  -lang c++  -RTTI on -D_MSL_CONSOLE_SUPPORT -DVCAST_NO_FLOAT -DVCAST_DO_NOT_INCLUDE_STDIO -DVCAST_MAX_STRING_LENGTH=130 -DVCAST_STDIO -DVCAST_CLASS_INST_SHARING -DVCAST_DISABLE_STD_STRING_DETECTION -DVCAST_DISABLE_STD_WSTRING_DETECTION -DVCAST_NO_LIMITS -DVCAST_NO_SETJMP -DVCAST_NO_STDIN -DVCAST_NO_STDLIB -DVCAST_SBF_UNITS_AVAILABLE -DVCAST_CPP_ENVIRONMENT -DVCAST_ORIGINAL_CODE -DVECTORCAST   -IC:\cygwin\home\rmb\vector\build\17024_cwppc_hg\vc\DATA\codewarrior\EPPC -I"c:\\Program Files\\Freescale\\CodeWarrior for MobileGT V9.2\\powerpc_eabi_support\\Runtime\\Include" -IC:\PROGRA~1\FREESC~1\CODEWA~3.2\PowerPC_EABI_Support\Runtime\Include -I"c:\\Program Files\\Freescale\\CodeWarrior for MobileGT V9.2\\powerpc_eabi_support\\Runtime\\Lib" -IC:\PROGRA~1\FREESC~1\CODEWA~3.2\PowerPC_EABI_Support\Runtime\Lib -IC:\VECTOR\win32.52d\Tutorial\cpp   B0000002.cpp

 

the error i get is

 

### mwcceppc Compiler:
#    File: B0000002.cpp
# ---------------------
#    1159:      VCAST_sprintf (VC_S,VCAST_PRINTF_DECIMAL_LONG_DOUBLE,VC_F);
#   Error:                                                               ^
#   undefined identifier 'sprintf'
### mwcceppc Compiler:
#    2548:   VCAST_sprintf (VC_FILENAME,"E%.7d.DAT", vCAST_CURRENT_SLOT+1);
#   Error:                                                               ^
#   undefined identifier 'sprintf'

 Here is my complete environment variables setup

 

 

set CWFolder=C:\PROGRA~1\FREESC~1\CODEWA~3.2  

set PATH=%CWFolder%\PowerPC_EABI_Tools\Command_Line_Tools;%PATH%
set path=%CWFolder%\bin;%PATH%

 

set MWCIncludes=%CWFolder%\PowerPC_EABI_Support\MSL\MSL_C\PPC_EABI\Include;
set MWCIncludes=%CWFolder%\PowerPC_EABI_Support\MSL\MSL_C\MSL_Common\Include;%MWCIncludes%
set MWCIncludes=%CWFolder%\PowerPC_EABI_Support\MSL\MSL_C\MSL_Common_Embedded\Include;%MWCIncludes%
set MWCIncludes=%CWFolder%\PowerPC_EABI_Support\Runtime\Include;%MWCIncludes%
set MWCIncludes=%CWFolder%\PowerPC_EABI_Support\MSL\MSL_C\MSL_Common\Src;%MWCIncludes%
set MWCIncludes=%CWFolder%\PowerPC_EABI_Support\SystemCallSupport\Src;%MWCIncludes%

set MWLibraries=%CWFolder%\PowerPC_EABI_Support\Runtime\Lib;%MWLibraries%
set MWLibraries=%CWFolder%\PowerPC_EABI_Support\MSL\MSL_C++\PPC_EABI\Lib;%MWLibraries%
set MWLibraries=%CWFolder%\PowerPC_EABI_Support\MSL\MSL_C\PPC_EABI\Lib;%MWLibraries%
set MWLibraries=%CWFolder%\PowerPC_EABI_Support\MSL\MSL_C++\MSL_Common\Src;%MWLibraries%
set MWLibraries=%CWFolder%\PowerPC_EABI_Support\SystemCallSupport\Src;%MWLibraries%

set MWLibraryFiles=%CWFolder%\PowerPC_EABI_Support\Runtime\Lib\Runtime.PPCEABI.H.UC.a
set MWLibraryFiles=%CWFolder%\PowerPC_EABI_Support\MSL\MSL_C++\PPC_EABI\Lib\MSL_C++.PPCEABI.bare.H.UC.a;%MWLibraryFiles%
set MWLibraryFiles=%CWFolder%\PowerPC_EABI_Support\MSL\MSL_C\PPC_EABI\Lib\MSL_C.PPCEABI.bare.H.UC.a;%MWLibraryFiles%
set MWLibraryFiles=%CWFolder%\PowerPC_EABI_Support\SystemCallSupport\Lib\syscall.a;%MWLibraryFiles%

 

 

thanks for any advice

Rob

Outcomes