Error compiling with Poco in XCode 4 - xcode

I am working on a project at work that includes a project that was built using the Poco library. When I attempt to compile the project, XCode gives me many errors related to the STL. After some searching around on the internet, I was able to deduce that including Poco can be the cause of this, but no answers on how to fix this problem.
Here are the errors:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:298:9: No member named 'memmove' in namespace 'std'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:321:7: Use of undeclared identifier 'ostreambuf_iterator'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:321:27: '_CharT' does not refer to a value
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:321:35: Expected unqualified-id
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:326:9: Use of undeclared identifier 'ostreambuf_iterator'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:326:29: '_CharT' does not refer to a value
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:326:37: Expected unqualified-id
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:5: Variable '__copy_aux' declared as a template
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:16: Use of undeclared identifier 'istreambuf_iterator'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:36: '_CharT' does not refer to a value
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:331:43: Expected expression
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:407:18: Use of undeclared identifier 'ostreambuf_iterator'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:407:38: '_CharT' does not refer to a value
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:407:46: Expected unqualified-id
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:446:9: No member named 'memmove' in namespace 'std'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:600:10: No member named 'memset' in namespace 'std'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:608:10: No member named 'memset' in namespace 'std'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:616:10: No member named 'memset' in namespace 'std'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h:908:31: No member named 'memcmp' in namespace 'std'
Any help would be greatly appreciate. I should note that I am not calling the Poco library directly, but some of the code from the other project makes reference to it.

Related

'Error: no member named 'signbit' in the global namespace' while trying to run opensmile-2.3.0 on Mac OS Catlina?

I'm trying install Opensmile-2.3.0 on Mac but I get few cmath errors. I have updated Xcode to 11.3 and it didn't help.
Mac OS - Catlina 10.15.3
I began by downloading the file as .tar file and unzipped it using
tar -zxvf opensmile-2.3.0.tar
Then changed the directory to opensmile-2.3.0.
Later started to follow the manual build instructions
bash autogen.sh
./configure
Everything runs fine till here and When I run the below command I get the following errors.
(base) Suryas-MacBook-Air:opensmile-2.3.0 suryareddy$ make j4 ; make
In file included from src/other/vectorOperation.cpp:58:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:318:9: error:
no member named 'signbit' in the global namespace
using ::signbit;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:319:9: error:
no member named 'fpclassify' in the global namespace
using ::fpclassify;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:320:9: error:
no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;
~~^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:749:12: note:
'finite' declared here
extern int finite(double)
^
In file included from src/other/vectorOperation.cpp:58:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:321:9: error:
no member named 'isinf' in the global namespace
using ::isinf;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:322:9: error:
no member named 'isnan' in the global namespace
using ::isnan;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:323:9: error:
no member named 'isnormal' in the global namespace
using ::isnormal;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:324:7: error:
no member named 'isgreater' in the global namespace; did you mean
'::std::greater'?
using ::isgreater;
^~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:728:29: note:
'::std::greater' declared here
struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
^
In file included from src/other/vectorOperation.cpp:58:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:325:7: error:
no member named 'isgreaterequal' in the global namespace; did you mean
'::std::greater_equal'?
using ::isgreaterequal;
^~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:757:29: note:
'::std::greater_equal' declared here
struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
^
In file included from src/other/vectorOperation.cpp:58:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:326:9: error:
no member named 'isless' in the global namespace
using ::isless;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:327:9: error:
no member named 'islessequal' in the global namespace
using ::islessequal;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:328:9: error:
no member named 'islessgreater' in the global namespace
using ::islessgreater;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:329:9: error:
no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:330:9: error:
no member named 'isunordered' in the global namespace
using ::isunordered;
~~^
196 warnings and 13 errors generated.
make[1]: *** [src/other/libopensmile_la-vectorOperation.lo] Error 1
make: *** [all] Error 2
uninstall xcode may work, it worked for my case, maybe some conflicts happened.

How to get better error output with Visual Studio

I was working on a project and got the following errors
Error (active) the default constructor of "Input" cannot be referenced -- it is a deleted function EquationSolver c:\Users\Kim\Documents\Visual Studio 2015\Projects\EquationSolver\EquationSolver\main.cpp 10
Error C2280 'Input::Input(void)': attempting to reference a deleted function EquationSolver <project_dir>\main.cpp 10
Since it is almost impossible to find the cause of the error from this, I tried compiling with gcc with -Wall and got following output
main.cpp: In function 'int main()':
main.cpp:10:9: error: use of deleted function 'Input::Input()'
Input input;
^~~~~
In file included from main.cpp:2:0:
Input.hpp:16:7: note: 'Input::Input()' is implicitly deleted because the default definition would be ill-formed:
class Input
^~~~~
Input.hpp:16:7: error: use of deleted function 'Expressions::Expressions()'
In file included from Input.hpp:11:0,
from main.cpp:2:
Expressions.hpp:8:7: note: 'Expressions::Expressions()' is implicitly deleted because the default definition would be ill-formed:
class Expressions
^~~~~~~~~~~
Expressions.hpp:8:7: error: uninitialized reference member in 'class Expressions'
Expressions.hpp:17:8: note: 'Expressions::Vec& Expressions::left' should be initialized
Vec& left;
^~~~
Expressions.hpp:8:7: error: uninitialized reference member in 'class Expressions'
class Expressions
^~~~~~~~~~~
Expressions.hpp:18:8: note: 'Expressions::Vec& Expressions::right' should be initialized
Vec& right;
^~~~~
This output is much more verbose and quickly helped me find the origin, which was a misplaced & (class member should be Vec left, was Vec& left).
Is it possible to make Visual Studio as verbose?
When putting Visual Studio to /Wall, I get >1800 warnings, most completely unrelated to my project, but I still only get those two errors.

Can't compile CapacitiveSensor example in Arduino

I am trying to use the Capacitive Sensors Library from the Arduino Playground with Arduino 1.5.3 for Intel Galileo.
While trying to compile the example Sketch of the library with nothing touched I get the following error:
Arduino: 1.5.3 (Windows 7), Board: "IntelĀ® Galileo"
CapacitiveSensor.cpp: In constructor
'CapacitiveSensor::CapacitiveSensor(uint8_t, uint8_t)':
CapacitiveSensor.cpp:30:63: error: 'F_CPU' was not declared in this
scope CapacitiveSensor.cpp:43:10: error: 'PinDescription' has no
member named 'ulPin' CapacitiveSensor.cpp:44:10: error:
'PinDescription' has no member named 'pPort'
CapacitiveSensor.cpp:45:31: error: 'portModeRegister' was not declared
in this scope CapacitiveSensor.cpp:46:9: error: base operand of '->'
is not a pointer CapacitiveSensor.cpp:48:9: error: 'PinDescription'
has no member named 'ulPin' CapacitiveSensor.cpp:49:10: error:
'PinDescription' has no member named 'pPort'
CapacitiveSensor.cpp:51:9: error: base operand of '->' is not a
pointer CapacitiveSensor.cpp:52:12: error: base operand of '->' is not
a pointer CapacitiveSensor.cpp:55:18: error: 'noInterrupts' was not
declared in this scope CapacitiveSensor.cpp:57:16: error: 'interrupts'
was not declared in this scope CapacitiveSensor.cpp: In member
function 'void CapacitiveSensor::set_CS_Timeout_Millis(long unsigned
int)': CapacitiveSensor.cpp:133:73: error: 'F_CPU' was not declared in
this scope CapacitiveSensor.cpp: In member function 'int
CapacitiveSensor::SenseOneCycle()': CapacitiveSensor.cpp:141:18:
error: 'noInterrupts' was not declared in this scope
CapacitiveSensor.cpp:151:16: error: 'interrupts' was not declared in
this scope
I downloaded the files and imported the "CapacitiveSensor"-Folder into (I did those steps one after the other, not at the same time.):
The libraries folder under Documents/arduino/.
The libraries folder in the arduino folder where the arduino.exe is stored.
Onto arduino-1.5.3/hardware/libraries/ (because this is mentioned on the site where I downloaded it)
And I tried this: Here Because it seemed to be the same error as I had. But it didnt work.
I also deleted my Arduino and reinstalled it.
Anyone has an Idea?
Thanks in advance,
Clemens
There is a similar question on the Arduino forum but I don't know if your issue is exactly the same: [FIXED][CapacitiveSensor] Can't compile with Due (port manipulation)
It doesn't look like the Arduino folks are very responsive. The user modified register names and eventually put his own library out there.
*"...changed the uint8_t registers to RwReg (compiler doesn't complain) and I replaced the use of portModeRegister(PIN) with simple pinMode(PIN, MODE) calls (it's slower but it works)."*

Can't compile Arduino CapSense example

I'm trying to work with the CapSense library for Arduino. However, I can't manage to run the example included with the package, called "CapSenseSketch". When I try just opening the file and running it (I've tried both Arduino 1.0 and 1.0.1), I get a compiler error that says 'CapSense does not name a type", and also
CapSenseSketch.cpp:1:22: error: CapSense.h: No such file or directory
CapSenseSketch:11: error: 'CapSense' does not name a type
CapSenseSketch:12: error: 'CapSense' does not name a type
CapSenseSketch:13: error: 'CapSense' does not name a type
CapSenseSketch.cpp: In function 'void setup()':
CapSenseSketch:17: error: 'cs_4_2' was not declared in this scope
CapSenseSketch.cpp: In function 'void loop()':
CapSenseSketch:24: error: 'cs_4_2' was not declared in this scope
CapSenseSketch:25: error: 'cs_4_6' was not declared in this scope
CapSenseSketch:26: error: 'cs_4_8' was not declared in this scope
There is an include statement at the top of the code,
#include <CapSense.h>
and I thought that would be the problem, so I changed the brackets to quotes and still got an error saying "Error compiling" and:
CapSenseSketch.cpp.o: In function `__static_initialization_and_destruction_0':
CapSenseSketch.cpp:15: undefined reference to `CapSense::CapSense(unsigned char, unsigned char)'
CapSenseSketch.cpp:16: undefined reference to `CapSense::CapSense(unsigned char, unsigned char)'
CapSenseSketch.cpp:17: undefined reference to `CapSense::CapSense(unsigned char, unsigned char)'
CapSenseSketch.cpp.o: In function `loop':
CapSenseSketch.cpp:28: undefined reference to `CapSense::capSense(unsigned char)'
CapSenseSketch.cpp:29: undefined reference to `CapSense::capSense(unsigned char)'
CapSenseSketch.cpp:30: undefined reference to `CapSense::capSense(unsigned char)'
CapSenseSketch.cpp.o: In function `setup':
CapSenseSketch.cpp:21: undefined reference to `CapSense::set_CS_AutocaL_Millis(unsigned long)'
Any ideas? I've worked with CapSense on another computer and changing the brackets to quotes worked fine that time, but it doesn't seem to be doing much now.
Apparently including external files works a bit differently in the arduino ide. It's not enough to simply have an include statement at the top of your code, you must instead manually go to sketch > add file for every external file you want to use. In my case, I only did this for one out of the two files I was trying to use.

Using STL within the Mac 10.5 SDK

Hopefully this is more relevant to StackOverflow than mac.stackexchange...
I am using ARToolkit for an augmented reality project, and in order to make it work under Mac I need to run the 10.5 SDK.
My problem is that I cannot seem to include any of the STL header files...especially vector.
Is there any sort of wrapper or workaround that I can use? I am basically compiling straight C code, and would like to make use of some of the nicer features of the STL framework to speed up development...
Edit:
In closer inspection, it appears that ARToolkit is including std_vector at some point in its include path.
Error snippet:
Bits/c++allocator.h: No such file or directory
Expected template-name before '<' token
Expected `{' before '<' token
Expected unqualified-id before '<' token
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/iosfwd
Bits/c++locale.h: No such file or directory
Bits/c++io.h: No such file or directory
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/stl_algobase.h
Bits/c++config.h: No such file or directory
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/stl_vector.h
Expected type-specifier before 'allocator'
Expected '>' before 'allocator'
'input_iterator_tag' has not been declared
'forward_iterator_tag' has not been declared
'input_iterator_tag' has not been declared
'forward_iterator_tag' has not been declared
'input_iterator_tag' has not been declared
'forward_iterator_tag' has not been declared
There are no arguments to '__N' that depend on a template parameter, so a declaration of '__N' must be available
(if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
Expected nested-name-specifier before 'iterator_traits'
Expected initializer before '<' token
There are no arguments to '_IterCategory' that depend on a template parameter, so a declaration of '_IterCategory' must be available
Expected nested-name-specifier before 'iterator_traits'
Expected initializer before '<' token
There are no arguments to '_IterCategory' that depend on a template parameter, so a declaration of '_IterCategory' must be available
Expected nested-name-specifier before 'iterator_traits'
Expected initializer before '<' token
There are no arguments to '_IterCategory' that depend on a template parameter, so a declaration of '_IterCategory' must be available
/Users/espais/research/artoolkit/trunk/artoolkit/examples/newproject/newproject.cpp
Expected `}' at end of input
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.2.1/bits/stl_bvector.h
Expected template-name before '<' token
Expected `{' before '<' token
Expected unqualified-id before '<' token
You might need to make your file a .mm file (Objective-C++) instead of .m (Objective-C).
Other than that, there shouldn't be any trouble doing #include <vector>.
Basically, there was some trickery that had to be done behind the scenes.
I had to update my local SDK (turns out that ARToolkit does support newer versions, regardless of what THEIR documentation says), and then the STL libraries worked.

Resources