STL link error with CodeComposerStudio
I'm compiling an mixed C/C++ program using STL with CodeComposerStudio. I have many compiler remarks and link errors
compiler remarks
!defined(__MINGW32__)
!defined(__MINGW32__) "C:/CCStudio_v3.3/C2000_v5.2.5/include/yvals.h",
line 470: remark #195-D: zero
used for undefined preprocessing identifier #if
199901L <= __STDC_VERSION__
^ "C:/CCStudio_v3.3/C2000_v5.2.5/include/exception", line 181: remark #195-D:
zero used for undefined preprocessing identifier #if
__GNUC__ < 3 && !defined(__APPLE__) && !defined(__MINGW32__)!defined(__MINGW32__)
link errors
UPDATED : 开发者_运维知识库Fixed by updatingrts2800_ml.lib
to latest version (same as compiler).
error: unresolved symbols remain undefined
---------
std::_Raise_handler
std::_Throw(const std::exception &)
std::_String_base::_Xlen() const
std::_String_base::_Xran() const
error: unresolved symbols remainerror: unresolved symbols remain
Question
Why ??? It seems i'm missing an include or a bunch of defines down there.Config
CodeComposerStudio V3.3 DSP TMS320C2812 C2000 v5.2.5The remarks for #if 199901L <= STDC_VERSION
and #if GNUC < 3
are with respect to the fact that in a test for the value of an undefined macro, the macro is substituted with zero. So in this case GNUC < 3
will be true even when the compiler is not GNUC. It should be qualified with #if defined GNUC && GNUC < 3
or enclosed in an earlier test for defined GNUC
or other GNUC specific macro.
If STDC_VERSION is assumed to be zero, then the test #if 199901L <= STDC_VERSION
will always be false. The standard macro for this test is in fact STDC_VERSION. However the C standard applied is irrelevant if C++ compilation is used, so a prior test for defined __cplusplus
may be appropriate.
These macros are normally predefined by the pre-processor and require no header. For details of predefined macros defining standards, compilers, architectures and OS, see http://predef.sourceforge.net/prestd.html
The linker errors are a different issue and cannot be resolved by #including further files. If you were missing a header, the compilation would fail. Unresolved linker symbols invariably due to missing code. You may not have linked a necessary library or object file, or the code may have been omitted through earlier conditional compilation (code within a false #if...#endif
block).
精彩评论