When I tried running my Ruby code with bundle install, I encountered this error: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
I tried running gem install kdtree and gem install kdtree -v '0.3' but it throws me the same error as well. Now I am unable to run my Ruby code. Any ideas on how to resolve this. I am running on Windows machine btw. Here's the full error log:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
generating kdtree-i386-mingw32.def
compiling kdtree.c
kdtree.c: In function 'kdtree_nearest0':
kdtree.c:221:13: error: expected identifier or '(' before ',' token
kdtree.c:237:14: error: expected expression before '=' token
kdtree.c:237:29: error: expected expression before '=' token
kdtree.c:239:14: error: expected expression before '=' token
kdtree.c:239:30: error: expected expression before '=' token
kdtree.c:241:34: error: expected expression before ',' token
kdtree.c:241:34: error: too few arguments to function 'kdtree_nearest0'
kdtree.c:217:13: note: declared here
kdtree.c:243:37: error: expected expression before ',' token
kdtree.c:243:37: error: too few arguments to function 'kdtree_nearest0'
kdtree.c:217:13: note: declared here
kdtree.c: In function 'kdtree_nearestk0':
kdtree.c:313:13: error: expected identifier or '(' before ',' token
kdtree.c:330:14: error: expected expression before '=' token
kdtree.c:330:29: error: expected expression before '=' token
kdtree.c:332:14: error: expected expression before '=' token
kdtree.c:332:30: error: expected expression before '=' token
kdtree.c:334:35: error: expected expression before ',' token
kdtree.c:334:35: error: too few arguments to function 'kdtree_nearestk0'
kdtree.c:309:13: note: declared here
kdtree.c:336:38: error: expected expression before ',' token
kdtree.c:336:38: error: too few arguments to function 'kdtree_nearestk0'
kdtree.c:309:13: note: declared here
kdtree.c: In function 'kdtree_persist':
kdtree.c:409:11: warning: unused variable 'str' [-Wunused-variable]
make: *** [kdtree.o] Error 1
make failed, exit code 2
Related
A rails application created with Ruby 3.1.0 and rails 7.0.3 on a Mac OS X 10.13.6 bundles all required gems using Bundler version 2.3.3
When migrating the application to Mac OS X 12.3 (monterey) with the same bundler version,
this is encountered:
An error occurred while installing semacode-ruby19 (0.7.4), and Bundler cannot continue.
Commenting out the gem allows the gem intallation procedure to complete. However the application remains incomplete, test/test_helper.rb for example needs to be commented out as the application tests the generation of Barby::DataMatrix.new(...)
The aforementioned gem has not been updated in a long time (thus no expectations should be entertained) - however the functionality of encoding DataMatrix for ruby remains a going concern. What options are open at this point?
I remain uncertain as to the source of the problem - the ∆s are OS X and homebrew - and thus uncertain as to where to report this. Suggestions welcome.
Update
As per the suggestion, the manual installation of the gem also fails:
gem install semacode -v 0.7.4 -- --with-cflags="-Wno-error=implicit-function-declaration"
Fetching semacode-0.7.4.gem
Building native extensions with: '--with-cflags=-Wno-error=implicit-function-declaration'
This could take a while...
ERROR: Error installing semacode:
ERROR: Failed to build gem native extension.
current directory: /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/semacode-0.7.4/ext
/Users/deploy/.rbenv/versions/3.1.0/bin/ruby -I /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/3.1.0 -r ./siteconf20220830-40292-dndt8s.rb extconf.rb --with-cflags\=-Wno-error\=implicit-function-declaration
creating Makefile
current directory: /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/semacode-0.7.4/ext
make DESTDIR\= clean
current directory: /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/semacode-0.7.4/ext
make DESTDIR\=
compiling iec16022ecc200.c
iec16022ecc200.c:284:80: warning: data argument not used by format string [-Wformat-extra-args]
rb_raise(rb_eArgError, "cannot encode character in X12", c);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
iec16022ecc200.c:299:80: warning: data argument not used by format string [-Wformat-extra-args]
rb_raise(rb_eArgError, "cannot encode character in X12", c);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
iec16022ecc200.c:323:89: warning: data argument not used by format string [-Wformat-extra-args]
rb_raise(rb_eRuntimeError, "this should not be happening!", c);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
iec16022ecc200.c:498:9: warning: incompatible pointer to integer conversion initializing 'VALUE' (aka 'unsigned long') with an expression of type 'void *' [-Wint-conversion]
VALUE rb_str = NULL;
^ ~~~~
iec16022ecc200.c:908:12: warning: assigning to 'unsigned char *' from 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
grid = ALLOC_N(char, W * H);
^ ~~~~~~~~~~~~~~~~~~~~
5 warnings generated.
compiling reedsol.c
compiling semacode.c
semacode.c:61:3: warning: implicit declaration of function 'iec16022init' is invalid in C99 [-Wimplicit-function-declaration]
iec16022init(&semacode->width, &semacode->height, message);
^
semacode.c:96:28: warning: 'bzero' call operates on objects of type 'semacode_t' (aka 'struct semacode_t') while the size is based on a different type 'semacode_t *' (aka 'struct semacode_t *') [-Wsizeof-pointer-memaccess]
bzero(semacode, sizeof(semacode));
~~~~~~~~ ^~~~~~~~
semacode.c:96:28: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?
bzero(semacode, sizeof(semacode));
^~~~~~~~
semacode.c:129:27: error: no member named 'len' in 'struct RString'
encode_string(semacode, StringValueLen(message), StringValuePtr(message));
^~~~~~~~~~~~~~~~~~~~~~~
./semacode.h:26:56: note: expanded from macro 'StringValueLen'
#define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
semacode.c:239:20: warning: equality comparison result unused [-Wunused-comparison]
semacode->data == NULL;
~~~~~~~~~~~~~~~^~~~~~~
semacode.c:239:20: note: use '=' to turn this equality comparison into an assignment
semacode->data == NULL;
^~
=
semacode.c:243:44: error: no member named 'len' in 'struct RString'
DATA_PTR(self) = encode_string(semacode, StringValueLen(message), StringValuePtr(message));
^~~~~~~~~~~~~~~~~~~~~~~
./semacode.h:26:56: note: expanded from macro 'StringValueLen'
#define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
3 warnings and 2 errors generated.
make: *** [semacode.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/semacode-0.7.4 for inspection.
Results logged to /Users/deploy/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/extensions/arm64-darwin-21/3.1.0/semacode-0.7.4/gem_make.out
Hello while trying to run my flutter iOS app on device im getting following error
SchedulerBinding.instance!
^
: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
../…/selection/overlay.dart:141
'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../flutter/packages/flutter/lib/src/scheduler/binding.dart').
package:flutter/…/scheduler/binding.dart:1
if (SchedulerBinding.instance!.schedulerPhase ==
^
: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
../…/selection/overlay.dart:143
'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../flutter/packages/flutter/lib/src/scheduler/binding.dart').
package:flutter/…/scheduler/binding.dart:1
SchedulerBinding.instance!.addPostFrameCallback(_markNeedsBuild);
^
: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
../…/selection/overlay.dart:193
'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../flutter/packages/flutter/lib/src/scheduler/binding.dart').
package:flutter/…/scheduler/binding.dart:1
if (SchedulerBinding.instance!.schedulerPhase ==
^
: Warning: Operand of null-aware operation '!' has type 'SchedulerBinding' which excludes null.
../…/selection/overlay.dart:195
'SchedulerBinding' is from 'package:flutter/src/scheduler/binding.dart' ('../../../../flutter/packages/flutter/lib/src/scheduler/binding.dart').
package:flutter/…/scheduler/binding.dart:1
SchedulerBinding.instance!.addPostFrameCallback(_markNeedsBuild);
^
: Error: Member not found: 'fadeDuration'.
../…/selection/handle_overlay.dart:60
duration: TextSelectionOverlay.fadeDuration, vsync: this);
^^^^^^^^^^^^
Failed to package /Users/name/Desktop/Project/application/nameofapliaction/ios/...
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
note: Removed stale file '/Users/name/Library/Developer/Xcode/DerivedData/Runner-bwvfmwkvjuzlddcmattnzdbblkrd/Build/Products/Debug-iphoneos/Runner.app'
Result bundle written to path:
/var/folders/0w/y0t7gyj53sld2zl56qqjmyzh0000gn/T/flutter_tools.mvIp8G/flutter_ios_build_temp_direh9ulh/temporary_xcresult_bundle
Could not build the precompiled application for the device.
Error launching application on iPhone.
Exited (sigterm)
I really have no idea what the hack this means . So hoper anyone can help
Failed to build a project using opencv libs and headers.
Additional include directories MVS:
C:\OpenCV\build\install\include
In a header file:
#include < opencv2/core/core.hpp >
#include < opencv2/imgproc/imgproc.hpp >
Build Output
2>c:\opencv\build\install\include\opencv2\core\cvdef.h(58): error C2059: syntax error: 'namespace'
2>c:\opencv\build\install\include\opencv2\core\cvdef.h(58): error C2143: syntax error: missing ';' before '{'
2>c:\opencv\build\install\include\opencv2\core\cvdef.h(58): error C2447: '{': missing function header (old-style formal list?)
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(437): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(437): error C2143: syntax error: missing ';' before '&'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(437): error C2530: 'cv::InputArray': references must be initialized
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(438): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(438): error C2378: 'cv::InputArray': redefinition; symbol cannot be overloaded with a typedef
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(437): note: see declaration of 'cv::InputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(438): error C2146: syntax error: missing ';' before identifier 'InputArrayOfArrays'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(439): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(439): error C2143: syntax error: missing ';' before '&'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(439): error C2530: 'cv::OutputArray': references must be initialized
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(440): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(440): error C2378: 'cv::OutputArray': redefinition; symbol cannot be overloaded with a typedef
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(439): note: see declaration of 'cv::OutputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(440): error C2146: syntax error: missing ';' before identifier 'OutputArrayOfArrays'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(441): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(441): error C2143: syntax error: missing ';' before '&'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(441): error C2530: 'cv::InputOutputArray': references must be initialized
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(442): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(442): error C2378: 'cv::InputOutputArray': redefinition; symbol cannot be overloaded with a typedef
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(441): note: see declaration of 'cv::InputOutputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(442): error C2146: syntax error: missing ';' before identifier 'InputOutputArrayOfArrays'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(444): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(444): error C2040: 'cv::InputOutputArray': 'int' differs in levels of indirection from 'int &'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(444): error C2146: syntax error: missing ';' before identifier 'noArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(1205): error C2061: syntax error: identifier 'OutputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(1213): error C2061: syntax error: identifier 'OutputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(1213): error C2535: 'void cv::Mat::copyTo(void) const': member function already defined or declared
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(1205): note: see declaration of 'cv::Mat::copyTo'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(1228): error C2061: syntax error: identifier 'OutputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(1250): error C2061: syntax error: identifier 'InputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(1317): error C2061: syntax error: identifier 'InputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(1326): error C2061: syntax error: identifier 'InputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(1336): error C2061: syntax error: identifier 'InputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(2442): error C2061: syntax error: identifier 'OutputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(2444): error C2061: syntax error: identifier 'OutputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(2444): error C2535: 'void cv::UMat::copyTo(void) const': member function already defined or declared
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(2442): note: see declaration of 'cv::UMat::copyTo'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(2446): error C2061: syntax error: identifier 'OutputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(2453): error C2061: syntax error: identifier 'InputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(2464): error C2061: syntax error: identifier 'InputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(2467): error C2061: syntax error: identifier 'InputArray'
2>c:\opencv\build\install\include\opencv2\core\mat.inl.hpp(811): error C2660: 'cv::Mat::copyTo': function does not take 1 arguments
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(1205): note: see declaration of 'cv::Mat::copyTo'
2>c:\opencv\build\install\include\opencv2\core\mat.inl.hpp(821): error C2660: 'cv::Mat::convertTo': function does not take 2 arguments
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(1228): note: see declaration of 'cv::Mat::convertTo'
2>c:\opencv\build\install\include\opencv2\core\mat.inl.hpp(3748): error C2660: 'cv::UMat::copyTo': function does not take 1 arguments
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(2442): note: see declaration of 'cv::UMat::copyTo'
2>c:\opencv\build\install\include\opencv2\core\mat.inl.hpp(3758): error C2660: 'cv::UMat::convertTo': function does not take 2 arguments
2>c:\opencv\build\install\include\opencv2\core\mat.hpp(2446): note: see declaration of 'cv::UMat::convertTo'
2>c:\opencv\build\install\include\opencv2\core.hpp(308): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(348): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(388): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(413): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(441): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(445): error C2061: syntax error: identifier 'InputArray'
2>c:\opencv\build\install\include\opencv2\core.hpp(466): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(494): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(522): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(535): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(551): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(560): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(569): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(597): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(610): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(632): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(671): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(684): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(711): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(718): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(782): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(812): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(840): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(879): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(900): error C2061: syntax error: identifier 'OutputArray'
2>c:\opencv\build\install\include\opencv2\core.hpp(908): error C2146: syntax error: missing ')' before identifier 'mv'
2>c:\opencv\build\install\include\opencv2\core.hpp(931): error C2146: syntax error: missing ')' before identifier 'm'
2>c:\opencv\build\install\include\opencv2\core.hpp(991): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1007): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1016): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1024): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1058): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1076): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1091): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1123): error C2061: syntax error: identifier 'OutputArray'
2>c:\opencv\build\install\include\opencv2\core.hpp(1144): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(1163): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1185): error C2061: syntax error: identifier 'OutputArray'
2>c:\opencv\build\install\include\opencv2\core.hpp(1209): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(1227): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1254): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(1281): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(1309): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(1326): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1352): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(1364): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1384): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1413): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(1426): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(1447): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(1466): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1491): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1507): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1520): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1542): error C2146: syntax error: missing ')' before identifier 'magnitude'
2>c:\opencv\build\install\include\opencv2\core.hpp(1563): error C2146: syntax error: missing ')' before identifier 'x'
2>c:\opencv\build\install\include\opencv2\core.hpp(1583): error C2146: syntax error: missing ')' before identifier 'x'
2>c:\opencv\build\install\include\opencv2\core.hpp(1597): error C2146: syntax error: missing ')' before identifier 'x'
2>c:\opencv\build\install\include\opencv2\core.hpp(1614): error C2146: syntax error: missing ')' before identifier 'a'
2>c:\opencv\build\install\include\opencv2\core.hpp(1619): error C2146: syntax error: missing ')' before identifier 'a'
2>c:\opencv\build\install\include\opencv2\core.hpp(1649): error C2146: syntax error: missing ')' before identifier 'src1'
2>c:\opencv\build\install\include\opencv2\core.hpp(1680): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1693): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1719): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1746): error C2146: syntax error: missing ')' before identifier 'src'
2>c:\opencv\build\install\include\opencv2\core.hpp(1746): fatal error C1003: error count exceeds 100; stopping compilation
Nothing helped but creating a project from scratch. Somehow settings from previous setup affected to build properly.
In my case I had the code like the following:
#include "some_my_own.h"
#include <opencv2/core/core.hpp>
The problem was in "some_my_own.h" that had incorrect curled braces.
I hope it will help someone since the error frustrated me for a long time.
I'm having trouble installing the rinku gem version '1.7.3' on Mavericks. I followed the advice of another post that suggested to install apple-gcc42 but that didn't help. I've also tried searching google and stack overflow but couldn't find this exact issue. Here is the error:
Building native extensions. This could take a while...
ERROR: Error installing rinku:
ERROR: Failed to build gem native extension.
/Users/home/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
creating Makefile
make clean
make
compiling autolink.c
In file included from autolink.c:17:
buffer.h:23:20: error: stdint.h: No such file or directory
In file included from autolink.c:17:
buffer.h:41: error: expected specifier-qualifier-list before 'uint8_t'
In file included from autolink.c:18:
autolink.h:31: warning: type defaults to 'int' in declaration of 'uint8_t'
autolink.h:31: error: expected ';', ',' or ')' before '*' token
autolink.h:35: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.h:39: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.h:43: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.c:20:20: error: string.h: No such file or directory
autolink.c:21:20: error: stdlib.h: No such file or directory
autolink.c:22:19: error: stdio.h: No such file or directory
autolink.c:23:19: error: ctype.h: No such file or directory
autolink.c:30: warning: type defaults to 'int' in declaration of 'uint8_t'
... Had to leave out some of the error because it won't let me post this without a lower code to text ratio.
autolink.c: At top level:
autolink.c:256: error: expected declaration specifiers or '...' before 'uint8_t'
autolink.c: In function 'sd_autolink__url':
autolink.c:263: error: 'data' undeclared (first use in this function)
autolink.c:266: warning: implicit declaration of function 'isalpha'
autolink.c:269: warning: implicit declaration of function 'sd_autolink_issafe'
autolink.c:272: warning: incompatible implicit declaration of built-in function 'strlen'
make: *** [autolink.o] Error 1
make failed, exit code 2
this ended up fixing it for 1.9.3
xcode-select --install
I am following the instructions given in the book "Hacking the Kinect" pages 15-16 (Apress 2011) to install the RGB Demo (version 0.5.0) on my system (32bit x86 machine running Xubuntu 12.04).
I downloaded and extracted the demo's source and installed the needed packages as described within the book:
libboost-all-dev, libusb-1.0-0-dev, libqt4-dev, libgtk2.0-dev, cmake, ccmake (from cmake-curses-gui), libglew1.5-dev, libgsl0-dev, freeglut3-dev (not libglut3-dev as stated in the book), and libxmu-dev.
Note book typo: libgs10-dev should actually read libgsl0-dev.
When running ccmake on the source's root directory, I set the flags as given by the book:
BUILD_EXAMPLES ON
BUILD_FAKENECT ON
BUILD_SHARED_LIBS ON
NESTK_USE_FREENECT ON
NESTK_USE_OPENNI OFF
NESTK_USE_PCL OFF
and leave all other flags as their defaults.
I then proceed to configure and generate without issue, but when subsequently running make, I run into the following error:
[ 35%] Building CXX object nestk/deps/opencv/modules/core/CMakeFiles/opencv_core.dir/src/out.o
In file included from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/precomp.hpp:55:0,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/out.cpp:43:
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:354:13: error: ‘ptrdiff_t’ does not name a type
In file included from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/precomp.hpp:55:0,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/out.cpp:43:
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2600:13: error: ‘ptrdiff_t’ does not name a type
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2623:24: error: declaration of ‘operator[]’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2623:22: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2623:34: error: expected ‘)’ before ‘i’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2626:36: error: declaration of ‘operator+=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2626:32: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2626:46: error: expected ‘)’ before ‘ofs’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2628:36: error: declaration of ‘operator-=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2628:32: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2628:46: error: expected ‘)’ before ‘ofs’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2641:5: error: ‘ptrdiff_t’ does not name a type
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2642:15: error: ‘ptrdiff_t’ has not been declared
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2661:13: error: ‘ptrdiff_t’ does not name a type
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2684:21: error: ‘ptrdiff_t’ has not been declared
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2687:37: error: declaration of ‘operator+=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2687:33: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2687:47: error: expected ‘)’ before ‘ofs’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2689:37: error: declaration of ‘operator-=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2689:33: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2689:47: error: expected ‘)’ before ‘ofs’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2733:22: error: declaration of ‘operator[]’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2733:20: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2733:32: error: expected ‘)’ before ‘i’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2736:32: error: declaration of ‘operator+=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2736:28: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2736:42: error: expected ‘)’ before ‘ofs’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2738:32: error: declaration of ‘operator-=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2738:28: error: expected ‘;’ at end of member declaration
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:2738:42: error: expected ‘)’ before ‘ofs’
In file included from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:4047:0,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/precomp.hpp:55,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/out.cpp:43:
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/operations.hpp:2822:15: error: ‘ptrdiff_t’ does not name a type
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/operations.hpp:3383:31: error: ‘ptrdiff_t’ does not name a type
In file included from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/core.hpp:4048:0,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/precomp.hpp:55,
from /home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/out.cpp:43:
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/mat.hpp:1629:57: error: declaration of ‘operator+=’ as non-function
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/mat.hpp:1629:57: error: ‘ptrdiff_t’ was not declared in this scope
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/include/opencv2/core/mat.hpp:1629:57: note: suggested alternatives:
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
/usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
/home/josh/dev/kinect/RGBDemo-0.5.0/nestk/deps/opencv/modules/core/src/out.cpp:305:1: error: expected ‘}’ at end of input
make[2]: *** [nestk/deps/opencv/modules/core/CMakeFiles/opencv_core.dir/src/out.o] Error 1
make[1]: *** [nestk/deps/opencv/modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2
What is causing these errors and how do I resolve them?
Could it be as simple as opencv/modules/core/include/opencv2/core/core.hpp missing #include <stddef.h>?
Yeah just edit the core.hpp /home/linaro/Downloads/RGBDemo-0.4.0-Source/nestk/deps/opencv/modules/core/include/opencv2/core and add the line
#include <stddef.h