I have a large class ClassA that I defined in a Code::Blocks Project ProjectA. ProjectA compiles fine, but when I try to use ClassA in a different project ProjectB, I start getting errors like
C:\ProjectA\ClassA.cpp|17|error: boost/foreach.hpp: No such file or directory|
C:\ProjectA\ClassA.cpp|649|error: 'strlen' was not declared in this scope|
also one of these for every function in cstring
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\cstring|76|error: '::memchr' has not been declared|
I added both ClassA.h and ClassA.cpp to ProjectB and added the folder for ProjectA to the directories searched in ProjectB.
I saw this question addressing a similar error, but I don’t use C, so it would be weird for my projects to suddenly start trying to compile in C. However, I don’t want to completely dismiss the possibility, so I would also like to know how to check whether a project is compiling in C or C++ in Code::Blocks.
Using files from multiple projects has been working for me up until today, so I’m at a total loss for what could be wrong. Thanks in advance for your answers!
It sounds like
ProjectBhas different include paths, ensure that it has the equivalent toProjectA. Usually you would setup boost in an external directory.