I'm having serious problems running some standard commands such as sleep() with g++-mp-4.8 downloaded from macports. I don't have any of these problems compiling with llvm-g++-4.2.
This is quite annoying, because I'm trying to use C++11 features in this program.
Here is the read out from the compiler - I'm really sorry it's so long, I just have no idea what to do with it:
17:11:54 **** Incremental Build of configuration Debug for project BSDESimV2 ****
make all
Building file: ../TrueSolutions/TrueSoln.cpp
Invoking: GCC C++ Compiler
/opt/local/bin/g++ -g -O0 -Wall -I/opt/local/include -I/usr/include -I/usr/llvm-gcc-4.2 /lib/gcc/i686-apple-darwin11/4.2.1/include -I/Applications/Xcode.app/Contents/Developer/usr/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include -I/usr/include/c++/4.2.1 -I/usr/include/c++/4.2.1/backup -I/opt/local/bin -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"TrueSolutions/TrueSoln.d" -MT"TrueSolutions/TrueSoln.d" -o "TrueSolutions/TrueSoln.o" "../TrueSolutions/TrueSoln.cpp"
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:72:0,
from /usr/include/c++/4.2.1/bits/char_traits.h:46,
from /usr/include/c++/4.2.1/ios:45,
from /usr/include/c++/4.2.1/istream:44,
from /usr/include/c++/4.2.1/fstream:45,
from ../TrueSolutions/TrueSoln.h:15,
from ../TrueSolutions/TrueSoln.cpp:8:
/usr/include/c++/4.2.1/bits/cpp_type_traits.h:381:12: error: expected identifier before '__is_pod'
struct __is_pod
^
/usr/include/c++/4.2.1/bits/cpp_type_traits.h:381:12: error: expected unqualified-id before '__is_pod'
/usr/include/c++/4.2.1/bits/cpp_type_traits.h:394:12: error: expected identifier before '__is_empty'
struct __is_empty
^
/usr/include/c++/4.2.1/bits/cpp_type_traits.h:394:12: error: expected unqualified-id before '__is_empty'
In file included from /usr/include/c++/4.2.1/memory:54:0,
from /usr/include/c++/4.2.1/string:48,
from /usr/include/c++/4.2.1/bits/locale_classes.h:47,
from /usr/include/c++/4.2.1/bits/ios_base.h:47,
from /usr/include/c++/4.2.1/ios:48,
from /usr/include/c++/4.2.1/istream:44,
from /usr/include/c++/4.2.1/fstream:45,
from ../TrueSolutions/TrueSoln.h:15,
from ../TrueSolutions/TrueSoln.cpp:8:
/usr/include/c++/4.2.1/bits/allocator.h:135:41: error: expected unqualified-id before '__is_empty'
template<typename _Alloc, bool = std::__is_empty<_Alloc>::__value>
^
/usr/include/c++/4.2.1/bits/allocator.h:135:41: error: expected '>' before '__is_empty'
In file included from /usr/include/c++/4.2.1/vector:70:0,
from ../TrueSolutions/TrueSoln.h:23,
from ../TrueSolutions/TrueSoln.cpp:8:
/usr/include/c++/4.2.1/bits/stl_vector.h: In member function 'void std::vector<_Tp, _Alloc>::swap(std::vector<_Tp, _Alloc>&)':
/usr/include/c++/4.2.1/bits/stl_vector.h:740:34: error: template argument 2 is invalid
std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
^
/usr/include/c++/4.2.1/bits/stl_vector.h:740:45: error: invalid type in declaration before '(' token
std::__alloc_swap<_Tp_alloc_type>::_S_do_it(_M_get_Tp_allocator(),
^
/usr/include/c++/4.2.1/bits/stl_vector.h:741:36: error: expression list treated as compound expression in initializer [-fpermissive]
__x._M_get_Tp_allocator());
^
In file included from /usr/include/c++/4.2.1/vector:71:0,
from ../TrueSolutions/TrueSoln.h:23,
from ../TrueSolutions/TrueSoln.cpp:8:
/usr/include/c++/4.2.1/bits/stl_bvector.h: In member function 'void std::vector<bool, _Alloc>::swap(std::vector<bool, _Alloc>&)':
/usr/include/c++/4.2.1/bits/stl_bvector.h:690:56: error: template argument 2 is invalid
std::__alloc_swap<typename _Base::_Bit_alloc_type>::
^
/usr/include/c++/4.2.1/bits/stl_bvector.h:691:10: error: invalid type in declaration before '(' token
_S_do_it(_M_get_Bit_allocator(), __x._M_get_Bit_allocator());
^
/usr/include/c++/4.2.1/bits/stl_bvector.h:691:61: error: expression list treated as compound expression in initializer [-fpermissive]
_S_do_it(_M_get_Bit_allocator(), __x._M_get_Bit_allocator());
^
make: *** [TrueSolutions/TrueSoln.o] Error 1
As suggested in the hints, I got rid of all the outdated -I/'s and set up the clang++ compiler as in Eclipse, Macos 10.8 and C++11
There were some clashes with between my code and the stl, but they were easy to hunt down from the console output.
Related
when I try to cross compile my GStreamer pipeline to run it on Petalinux build, it loads the 64bit libraries while the host is a 32bit arm.
arm-linux-gnueabihf-gcc PIPEX.c -o PIPEX `pkg-config --cflags --libs gstreamer-app-1.0`
I get the following error:
In file included from /usr/lib/x86_64-linux-gnu/glib-2.0/include/glibconfig.h:9:0,
from /usr/include/glib-2.0/glib/gtypes.h:32,
from /usr/include/glib-2.0/glib/galloca.h:32,
from /usr/include/glib-2.0/glib.h:30,
from /usr/include/gstreamer-1.0/gst/gst.h:27,
from PIPEX.c:5:
/usr/include/glib-2.0/glib/gtypes.h: In function ‘_GLIB_CHECKED_ADD_U64’:
/usr/include/glib-2.0/glib/gmacros.h:241:53: error: size of array ‘_GStaticAssertCompileTimeAssertion_0’ is negative
#define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
^
/usr/include/glib-2.0/glib/gmacros.h:238:47: note: in definition of macro ‘G_PASTE_ARGS’
#define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
^~~~~~~~~~~
/usr/include/glib-2.0/glib/gmacros.h:241:44: note: in expansion of macro ‘G_PASTE’
#define G_STATIC_ASSERT(expr) typedef char G_PASTE (_GStaticAssertCompileTimeAssertion_, __COUNTER__)[(expr) ? 1 : -1] G_GNUC_UNUSED
^~~~~~~
/usr/include/glib-2.0/glib/gtypes.h:423:3: note: in expansion of macro ‘G_STATIC_ASSERT’
G_STATIC_ASSERT(sizeof (unsigned long long) == sizeof (guint64));
I've already tried installing ":i386" packages and exporting PKG_CONFIG_PATH to /usr/lib/i386-linux-gnu/pkgconfig/ but after that I get:
/media/mk/DATA/programs/Xilinx/SDK/2018.3/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lgstapp-1.0
/media/mk/DATA/programs/Xilinx/SDK/2018.3/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lgstbase-1.0
/media/mk/DATA/programs/Xilinx/SDK/2018.3/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lgstreamer-1.0
/media/mk/DATA/programs/Xilinx/SDK/2018.3/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lgobject-2.0
/media/mk/DATA/programs/Xilinx/SDK/2018.3/gnu/aarch32/lin/gcc-arm-linux-gnueabi/bin/../lib/gcc/arm-linux-gnueabihf/7.3.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lglib-2.0
collect2: error: ld returned 1 exit status
I've been trying for a while now compile wxWidgets library for Code::Blocks and I am still getting a lot of different errors.
My gcc verions is: gcc (tdm-2) 4.8.1 and I want to build newest wxWidgets: 3.1.0. I've tried 3 different sources and each time I have some error (sometimes this same, sometimes different). I am working on Windows 8.1.
[1]mingw32-make -f makefile.gcc UNICODE=1 MONOLITHIC=1 SHARED=1 BUILD=debug CXXFLAGS="-std=gnu++11"
and the error output:
../../src/common/wxcrt.cpp: In function 'int wxVsprintf(wchar_t*, const wxString
&, va_list)':
../../src/common/wxcrt.cpp:623:47: error: invalid conversion from 'const wchar_t
*' to 'size_t {aka unsigned int}' [-fpermissive]
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:623:56: error: cannot convert 'va_list {aka char*}' t
o 'const wchar_t*' for argument '3' to 'int vswprintf(wchar_t*, size_t, const wc
har_t*, char*)'
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:632:1: warning: control reaches end of non-void funct
ion [-Wreturn-type]
}
^
makefile.gcc:6786: recipe for target 'gcc_mswuddll\monodll_wxcrt.o' failed
mingw32-make: *** [gcc_mswuddll\monodll_wxcrt.o] Error 1
[2]mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=debug and the error output:
../../src/common/wxcrt.cpp: In function 'int wxVsprintf(wchar_t*, const wxString
&, va_list)':
../../src/common/wxcrt.cpp:623:47: error: invalid conversion from 'const wchar_t
*' to 'size_t {aka unsigned int}' [-fpermissive]
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:623:56: error: cannot convert 'va_list {aka char*}' t
o 'const wchar_t*' for argument '3' to 'int vswprintf(wchar_t*, size_t, const wc
har_t*, char*)'
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:632:1: warning: control reaches end of non-void funct
ion [-Wreturn-type]
}
^
makefile.gcc:11860: recipe for target 'gcc_mswuddll\basedll_wxcrt.o' failed
mingw32-make: *** [gcc_mswuddll\basedll_wxcrt.o] Error 1
[3]mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-fno-keep-inline-dllexport"1 and the error:
../../src/common/wxcrt.cpp: In function 'int wxVsprintf(wchar_t*, const wxString
&, va_list)':
../../src/common/wxcrt.cpp:623:47: error: invalid conversion from 'const wchar_t
*' to 'size_t {aka unsigned int}' [-fpermissive]
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:623:56: error: cannot convert 'va_list {aka char*}' t
o 'const wchar_t*' for argument '3' to 'int vswprintf(wchar_t*, size_t, const wc
har_t*, char*)'
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:632:1: warning: control reaches end of non-void funct
ion [-Wreturn-type]
}
^
makefile.gcc:6786: recipe for target 'gcc_mswudll\monodll_wxcrt.o' failed
mingw32-make: *** [gcc_mswudll\monodll_wxcrt.o] Error 1
Can someone please advice me what more I can do?
I'm not sure why are you speaking about multiple errors, this is clearly one and the same error and is due to using standard-like vswprintf() instead of the function from MSVC CRT which is normally used by MinGW by default. The former should only be used when __USE_MINGW_ANSI_STDIO is in effect and it's very strange that you still get it without it, I wonder if you have CPPFLAGS or similar set in your environment?
Anyhow, I'd recommend using TDM-GCC 4.9 as 3.1.0 definitely compiles with it (this is what the official binaries have been built with). 4.8 is supposed to work too, of course, so it could be worth checking how is __USE_MINGW_ANSI_STDIO getting defined, but installing 4.9 will probably be simpler for you.
I have successfully compiled the 3.6.1 version of LLVM-Clang-LLDB-Compiler-RT-LibCxx-LibCxxABI-TestSuite bundle. However, when I tried ninja check-all, the check failed right at the first target [1/150] Generating sanitizer_bitvector_test.cc.x86_64.o. I think the reason is that LLVM is trying to use the system GCC header files, but I compiled LLVM with another GCC toolchain (GCC 4.8.4) that I compiled and installed in a non-root directory. However, I can't figure out how to let the CMake avoid using the system GCC headers (I have modified the PATH and LD_LIBRARY_PATH, but they didn't help at all).
Here is the relevant information:
CentOS 6.6
x86_64 architecture (Intel(R) Xeon(R) CPU W3550 # 3.07GHz)
Tools used for installation:
1) gcc/4.8.4
2) ninja
3) zlib/1.2.8
4) python-miniconda
Linux Kernel version
2.6.32-504.16.2.el6.x86_64
CMake build command
cmake -G "Ninja" -DCMAKE_C_COMPILER=/Scr/scr-test-steven/install/gcc/4.8.4/bin/gcc -DCMAKE_CXX_COMPILER=/Scr/scr-test-steven/install/gcc/4.8.4/bin/c++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/Scr/scr-test-steven/install/llvm/3.6.1 /Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src -DLLDB_DISABLE_PYTHON=1 -DCMAKE_CXX_FLAGS:STRING="-I/Scr/scr-test-steven/install/gcc/4.8.4/include -I/Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/tools/clang/include -I/Scr/scr-test-steven/install/libedit/3.1/include -I/Scr/scr-test-steven/install/miniconda/include/python2.7 -L/Scr/scr-test-steven/install/gcc/4.8.4/lib64 -L/Scr/scr-test-steven/install/libedit/3.1/lib -L/Scr/scr-test-steven/install/miniconda/lib -L/Scr/scr-test-steven/install/miniconda/lib/python2.7" -DPYTHON_HOME=/Scr/scr-test-steven/install/miniconda -DLLVM_LIB_SEARCH_PATH=/Scr/scr-test-steven/Programs/LLVM/build_llvm-3.6.1/lib
ninja check results are okay, which means LLVM was compiled successfully:
[1/1] Running the LLVM regression tests
lit.py: lit.cfg:271: note: Did not find llvm-go in /Scr/scr-test-steven/Programs/LLVM/build_llvm-3.6.1/./bin
-- Testing: 12316 tests, 8 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 105.65s
* Expected Passes : 12056
* Expected Failures : 79
* Unsupported Tests : 181
The first few lines of errors for ninja check-all (see details in Log.check.log ):
[1/150] Generating sanitizer_bitvector_test.cc.x86_64.o
FAILED: cd /Scr/scr-test-steven/Programs/LLVM/build_llvm-3.6.1/projects/compiler-rt/lib/sanitizer_common/tests && /Scr/scr-test-steven/Programs/LLVM/build_llvm-3.6.1/./bin/clang -I/Scr/scr-test-steven/install/gcc/4.8.4/include -I/Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/tools/clang/include -I/Scr/scr-test-steven/install/libedit/3.1/include -I/Scr/scr-test-steven/install/miniconda/include/python2.7 -L/Scr/scr-test-steven/install/gcc/4.8.4/lib64 -L/Scr/scr-test-steven/install/libedit/3.1/lib -L/Scr/scr-test-steven/install/miniconda/lib -L/Scr/scr-test-steven/install/miniconda/lib/python2.7 -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-comment -std=c++11 -ffunction-sections -fdata-sections -Wall -std=c++11 -Wno-unknown-warning-option -DGTEST_NO_LLVM_RAW_OSTREAM=1 -DGTEST_HAS_RTTI=0 -I/Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/utils/unittest/googletest/include -I/Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/utils/unittest/googletest -I/Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/projects/compiler-rt/include -I/Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/projects/compiler-rt/lib -I/Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/projects/compiler-rt/lib/sanitizer_common -fno-rtti -O2 -Werror=sign-compare -Wno-non-virtual-dtor -m64 -c -o sanitizer_bitvector_test.cc.x86_64.o /Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cc
clang-3.6: warning: argument unused during compilation: '-L/Scr/scr-test-steven/install/gcc/4.8.4/lib64'
clang-3.6: warning: argument unused during compilation: '-L/Scr/scr-test-steven/install/libedit/3.1/lib'
clang-3.6: warning: argument unused during compilation: '-L/Scr/scr-test-steven/install/miniconda/lib'
clang-3.6: warning: argument unused during compilation: '-L/Scr/scr-test-steven/install/miniconda/lib/python2.7'
In file included from /Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cc:16:
In file included from /Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_utils.h:28:
In file included from /Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_config.h:20:
In file included from **/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7** /vector:61:
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_algobase.h:66:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_pair.h:89:10: error: no matching function for call to 'forward'
: first(std::forward<_U1>(__x)),
^~~~~~~~~~~~~~~~~
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_tree.h:1177:13: note: in instantiation of function template specialization 'std::pair<std::_Rb_tree_iterator<const char *>, bool>::pair<std::_Rb_tree_iterator<const char *>, bool>' requested here
return pair<iterator, bool>(_M_insert_(__x, __y, __v), true);
^
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_set.h:411:9: note: in instantiation of member function 'std::_Rb_tree<const char *, const char *, std::_Identity<const char *>, std::less<const char *>, std::allocator<const char *> >::_M_insert_unique' requested here
_M_t._M_insert_unique(__x);
^
/Scr/scr-test-steven/Programs/LLVM/llvm-3.6.1.src/utils/unittest/googletest/include/gtest/internal/gtest-internal.h:628:25: note: in instantiation of member function 'std::set<const char *, std::less<const char *>, std::allocator<const char *> >::insert' requested here
defined_test_names_.insert(test_name);
^
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/move.h:51:5: note: candidate function [with _Tp = std::_Rb_tree_iterator<const char *>] not viable: no known conversion from 'std::_Rb_tree_iterator<const char *>' to 'typename std::identity<_Rb_tree_iterator<const char *> >::type &&' (aka 'std::_Rb_tree_iterator<const char *> &&') for 1st argument
forward(typename std::identity<_Tp>::type&& __t)
^
In particular you may notice that:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7 was used. However, 'ninja check-all' really should have used the header files for gcc-4.8.4, not gcc-4.4.7 (system bundled gcc).
I have filed a bug report, but no one seems to want to answer it.
If anyone knows how to fix this, please let me know. Thanks.
I was building Python (3.4 dev version) from source as a framework on OS X 10.8. I'm a relative newbie to Mac OS X internals and couldn't figure out why the OS X framework headers caused these errors. Can someone please give me some pointers?
I use the latest version of GNU gcc on my mac instead of the Apple supplied LLVM compiler. Perhaps, that's causing a compatibility problem.
gcc -Wno-unused-result -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -o FileSettings.o -c ./FileSettings.m
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:123:0,
from ./FileSettings.h:9,
from ./FileSettings.m:9:
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:69:24: error: expected identifier or ‘(’ before ‘^’ token
#property (copy) void (^terminationHandler)(NSTask *) NS_AVAILABLE(10_7, NA);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSTask.h:72:1: error: expected identifier before ‘end’
#end
^
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:159:0,
from ./FileSettings.h:9,
from ./FileSettings.m:9:
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:36:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserScriptTaskCompletionHandler)(NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:37:1: error: unknown type name ‘NSUserScriptTaskCompletionHandler’
- (void)executeWithCompletionHandler:(NSUserScriptTaskCompletionHandler)handler;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:53:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserUnixTaskCompletionHandler)(NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:54:1: error: unknown type name ‘NSUserUnixTaskCompletionHandler’
- (void)executeWithArguments:(NSArray *)arguments completionHandler:(NSUserUnixTaskCompletionHandler)handler;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:68:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserAppleScriptTaskCompletionHandler)(NSAppleEventDescriptor *result, NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:69:1: error: unknown type name ‘NSUserAppleScriptTaskCompletionHandler’
- (void)executeWithAppleEvent:(NSAppleEventDescriptor *)event completionHandler:(NSUserAppleScriptTaskCompletionHandler)handler;
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:86:15: error: expected identifier or ‘(’ before ‘^’ token
typedef void (^NSUserAutomatorTaskCompletionHandler)(id result, NSError *error);
^
/System/Library/Frameworks/Foundation.framework/Headers/NSUserScriptTask.h:87:1: error: unknown type name ‘NSUserAutomatorTaskCompletionHandler’
- (void)executeWithInput:(id <NSSecureCoding>)input completionHandler:(NSUserAutomatorTaskCompletionHandler)handler;
^
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:160:0,
from ./FileSettings.h:9,
from ./FileSettings.m:9:
/System/Library/Frameworks/Foundation.framework/Headers/NSXPCConnection.h:46:11: error: expected identifier or ‘(’ before ‘^’ token
void (^_interruptionHandler)();
^
make[2]: *** [FileSettings.o] Error 1
make[1]: *** [install_PythonLauncher] Error 2
make: *** [frameworkinstallapps] Error 2
The errors correspond precisely to the 'block' extension Apple developed for C, C++ and Objective-C languages. GCC (the GNU version) doesn't recognize the block occurences and complains.
I have a library which compile without error using Makefile.
Now I want to switch to CMake but it doesn't work.
The sources and the Makefiles are here.
From all the folders I have kept the followin: can_socket, can_virtual, timers_xeno, timers_rtpreempt, timers_unix, unix.
This is my CMakeLists:
cmake_minimum_required(VERSION 2.4.6)
project(ikarus_arm_common C CXX)
#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
find_package(Boost COMPONENTS filesystem system serialization REQUIRED)
set(CAN_MASTER_INCLUDE_DIR include)
include_directories( ${Boost_INCLUDE_DIRS}
${CAN_MASTER_INCLUDE_DIR}
${CAN_MASTER_INCLUDE_DIR}/boost
${CAN_MASTER_INCLUDE_DIR}/timers_rtpreempt
${CAN_MASTER_INCLUDE_DIR}/timers_unix
${CAN_MASTER_INCLUDE_DIR}/timers_xeno
${CAN_MASTER_INCLUDE_DIR}/unix
/usr/xenomai/include
)
set(CAN_FESTIVAL_CPP drivers/unix/unix.c
drivers/timers_xeno/timers_xeno.c
drivers/can_socket/can_socket.c
)
add_library(canfestival ${CAN_FESTIVAL_CPP})
EDIT:
When I try to compile it returns the following error:
> $ make
> [ 9%] Building C object
> CMakeFiles/canfestival.dir/drivers/unix/unix.o
> In file included from
> /home/luca/ArmIkarus/ikarus_arm_stack/ikarus_arm_common/include/can.h:28:0,
> from /home/luca/ArmIkarus/ikarus_arm_stack/ikarus_arm_common/include/canDispatch.h:23,
> from /home/luca/ArmIkarus/ikarus_arm_stack/ikarus_arm_common/drivers/unix/unix.c:36:
> /usr/include/boost/function.hpp:13:57: fatal error: functional: No
> such file or directory compilation terminated. make[2]: ***
> [CMakeFiles/canfestival.dir/drivers/unix/unix.o] Error 1 make[1]: ***
> [CMakeFiles/canfestival.dir/all] Error 2 make: *** [all] Error 2
I suppose that one of the problems is due to the fact that some files have the extension .c but requires boost. If i modify the extension of the files unix.cpp and can_socket.cpp compile, while timers_xeno returns an error:
luca#luca-vmware:~/ArmIkarus/ikarus_arm_stack/ikarus_arm_common/build$ make
[ 9%] Building CXX object CMakeFiles/canfestival.dir/drivers/unix/unix.o
[ 18%] Building CXX object CMakeFiles/canfestival.dir/drivers/timers_xeno/timers_xeno.o
/home/luca/ArmIkarus/ikarus_arm_stack/ikarus_arm_common/drivers/timers_xeno/timers_xeno.cpp: In function ‘void CreateReceiveTask(CAN_PORT, pthread_t*, void (*)(void*))’:
/home/luca/ArmIkarus/ikarus_arm_stack/ikarus_arm_common/drivers/timers_xeno/timers_xeno.cpp:250:75: error: cannot convert ‘pthread_t* {aka long unsigned int*}’ to ‘RT_TASK* {aka rt_task_placeholder*}’ for argument ‘1’ to ‘int rt_task_create(RT_TASK*, const char*, int, int, int)’
/home/luca/ArmIkarus/ikarus_arm_stack/ikarus_arm_common/drivers/timers_xeno/timers_xeno.cpp:256:70: error: cannot convert ‘pthread_t* {aka long unsigned int*}’ to ‘RT_TASK* {aka rt_task_placeholder*}’ for argument ‘1’ to ‘int rt_task_start(RT_TASK*, void (*)(void*), void*)’
/home/luca/ArmIkarus/ikarus_arm_stack/ikarus_arm_common/drivers/timers_xeno/timers_xeno.cpp: In function ‘void WaitReceiveTaskEnd(pthread_t*)’:
/home/luca/ArmIkarus/ikarus_arm_stack/ikarus_arm_common/drivers/timers_xeno/timers_xeno.cpp:270:38: error: cannot convert ‘pthread_t* {aka long unsigned int*}’ to ‘RT_TASK* {aka rt_task_placeholder*}’ for argument ‘1’ to ‘int rt_task_join(RT_TASK*)’
/home/luca/ArmIkarus/ikarus_arm_stack/ikarus_arm_common/drivers/timers_xeno/timers_xeno.cpp:273:36: error: cannot convert ‘pthread_t* {aka long unsigned int*}’ to ‘RT_TASK* {aka rt_task_placeholder*}’ for argument ‘1’ to ‘int rt_task_delete(RT_TASK*)’
make[2]: *** [CMakeFiles/canfestival.dir/drivers/timers_xeno/timers_xeno.o] Error 1
make[1]: *** [CMakeFiles/canfestival.dir/all] Error 2
make: *** [all] Error 2
How can I fix this problem?