I have two projects (x64).
A. Written in C (wxWidgets) --- edit: its in C++!
B. Written in C++
A compiles fine, but B (which uses functions of A) gives several errors when I try to compile.
I suggest that the reason for the errors is the same for all, so I mention only the first. It says:
strlen: identifier not found
In the file which gives the error messages ( wxcrtbase.h ), the following headers are included:
#include <stdio.h>
#include <string.h>`
The files from B include the following headers from A:
#include "wx/wx.h"
#include "wx/dcbuffer.h"
#include "wx/spinctrl.h"
So, currently, I have no idea where to start to search for the reason of the errors. May it be that I have C and C++ files? Maybe that I compiled for x64?
Thanks for help!
edit: more info
the lines in wxcrtbase.h around the one producing the first error message are:
#ifdef __cplusplus
inline size_t wxStrlen(const char *s) { return s ? wxCRT_StrlenA(s) : 0; }
inline size_t wxStrlen(const wchar_t *s) { return s ? wcslen(s) : 0; }
The order of the includes of the wxcrtbase.h is
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <wctype.h>
#include <time.h>
#include <io.h>
The /showIncludes lists the following ( I stop with the list after the first two error messages ):
1>Compiling...
1>widget.cpp
1>Note: including file: m:\visual studio 2008\projects\general\rama\src\widget.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include \string
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\istream
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\ostream
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\ios
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xlocnum
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\climits
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\yvals.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\sal.h
1>Note: including file: c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtassem.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\vadefs.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\use_ansi.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\limits.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cstdio
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\swprintf.inl
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cstdlib
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdlib.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\streambuf
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xiosbase
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\xlocale
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cstring
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx\string.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/defs.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/platform.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\setupp.h
1>Note: including file: m:\visual studio 2008\projects\general\wxwidgets-2.9.0\include\wx/version.h
1>Note: including file: m:\visual studio 2008\projects\general\wxwidgets-2.9.0\include\wx/cpp.h
1>Note: including file: m:\visual studio 2008\projects\general\wxwidgets-2.9.0\include\wx/cpp.h
1>Note: including file: M:/Visual Studio 2008/Projects/general/wxWidgets-2.9.0/lib/vc_lib/mswud/wx/setup.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/msw/libraries.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/chkconf.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/msw/chkconf.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/version.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/dlimpexp.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stddef.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/debug.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\assert.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/chartype.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/platform.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\tchar.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\wchar.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\wtime.inl
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/cpp.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/windowid.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/msw/winundef.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/features.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx\string.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdarg.h
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/wxcrtbase.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\io.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cctype
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\ctype.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\cwctype
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\wctype.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\ctime
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\time.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file: C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\time.inl
1>Note: including file: M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/chartype.h
1>M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/wxcrtbase.h(705) : error C3861: 'strlen': identifier not found
1>M:\Visual Studio 2008\Projects\general\wxWidgets-2.9.0\include\wx/wxcrtbase.h(718) : error C3861: '_strdup': identifier not found