Hey folks I'm trying to compile a ELF binary server files from here:https://github.com/LibVNC/libvncserver
To do this I follow the steps here: (starting line 10 - 31). I set the NDK toolchains correctly and now I'm trying to run the $configure command
I'm using a 14.04 Ubuntu Machine.
The following command is succesful
$./configure --host=arm-eabi CC=arm-linux-androideabi-gcc
I then run
$make
and get the following error ($make clean ... doesn't help):
root#ip-172-31-35-74:~/Desktop/libvncserver-LibVNCServer-0.9.10#
root#ip-172-31-35-74:~/Desktop/libvncserver-LibVNCServer-0.9.10# make
make all-recursive
make[1]: Entering directory `/home/ubuntu/Desktop/libvncserver-LibVNCServer-0.9.10'
Making all in libvncserver
make[2]: Entering directory `/home/ubuntu/Desktop/libvncserver-LibVNCServer-0.9.10/libvncserver'
CC main.lo
CC rfbserver.lo
rfbserver.c: In function 'rfbProcessFileTransfer':
rfbserver.c:1690:69: warning: pointer targets in passing argument 1 of 'gmtime' differ in signedness [-Wpointer-sign]
strftime(timespec, sizeof(timespec), "%m/%d/%Y %H:%M",gmtime(&statbuf.st_ctime));
^
In file included from rfbserver.c:87:0:
/tmp/my-android-toolchain/sysroot/usr/include/time.h:76:20: note: expected 'const time_t *' but argument is of type 'long unsigned int *'
extern struct tm* gmtime(const time_t *timep);
^
CC rfbregion.lo
CC auth.lo
CC sockets.lo
CC websockets.lo
CC rfbssl_none.lo
CC rfbcrypto_included.lo
In file included from rfbcrypto_included.c:25:0:
../common/md5.h: In function '__md5_init_ctx':
../common/md5.h:101:50: error: expected declaration specifiers before '__THROW'
extern void __md5_init_ctx (struct md5_ctx *ctx) __THROW;
^
../common/md5.h:108:39: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__THROW'
struct md5_ctx *ctx) __THROW;
^
../common/md5.h:115:39: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__THROW'
struct md5_ctx *ctx) __THROW;
^
../common/md5.h:124:67: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__THROW'
extern void *__md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) __THROW;
^
../common/md5.h:133:71: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__THROW'
extern void *__md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) __THROW;
^
../common/md5.h:139:56: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__THROW'
extern int __md5_stream (FILE *stream, void *resblock) __THROW;
^
../common/md5.h:146:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__THROW'
void *resblock) __THROW;
^
In file included from rfbcrypto_included.c:26:0:
../common/sha1.h:62:1: warning: empty declaration
enum
^
../common/sha1.h:89:3: error: storage class specified for parameter 'SHA1Context'
} SHA1Context;
^
../common/sha1.h:94:17: error: expected declaration specifiers or '...' before 'SHA1Context'
int SHA1Reset( SHA1Context *);
^
../common/sha1.h:95:17: error: expected declaration specifiers or '...' before 'SHA1Context'
int SHA1Input( SHA1Context *,
^
../common/sha1.h:98:17: error: expected declaration specifiers or '...' before 'SHA1Context'
int SHA1Result( SHA1Context *,
^
rfbcrypto_included.c:30:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
{
^
rfbcrypto_included.c:41:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
{
^
In file included from rfbcrypto_included.c:25:0:
../common/md5.h:101:13: error: old-style parameter declarations in prototyped function definition
extern void __md5_init_ctx (struct md5_ctx *ctx) __THROW;
^
rfbcrypto_included.c:49:1: error: expected '{' at end of input
}
^
make[2]: *** [rfbcrypto_included.lo] Error 1
make[2]: Leaving directory `/home/ubuntu/Desktop/libvncserver-LibVNCServer-0.9.10/libvncserver'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ubuntu/Desktop/libvncserver-LibVNCServer-0.9.10'
make: *** [all] Error 2
root#ip-172-31-35-74:~/Desktop/libvncserver-LibVNCServer-0.9.10#
root#ip-172-31-35-74:~/Desktop/libvncserver-LibVNCServer-0.9.10#
Related
I am trying to install a specific version of gnuradio (3.7.10.1). To do so I am not using Pybombs, but I try to do it from source (I am following this).
First I've cloned the github repository, then checkout the appropriate version. It worked fine until I've tried to invoke CMake and build GNU Radio:
mkdir build
cd build
cmake ../
make
During the make, after 6% done, I have the following error:
In file included from /usr/include/c++/7/type_traits:35:0,
from /usr/include/cppunit/tools/StringHelper.h:7,
from /usr/include/cppunit/TestAssert.h:8,
from /usr/include/cppunit/TestCase.h:6,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/c++/7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
^~~~~
In file included from /usr/include/cppunit/TestAssert.h:8:0,
from /usr/include/cppunit/TestCase.h:6,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/tools/StringHelper.h:22:15: error: ‘enable_if’ in namespace ‘std’ does not name a template type
typename std::enable_if<!std::is_enum<T>::value, std::string>::type toString(const T& x)
^~~~~~~~~
/usr/include/cppunit/tools/StringHelper.h:22:24: error: expected unqualified-id before ‘<’ token
typename std::enable_if<!std::is_enum<T>::value, std::string>::type toString(const T& x)
^
/usr/include/cppunit/tools/StringHelper.h:31:15: error: ‘enable_if’ in namespace ‘std’ does not name a template type
typename std::enable_if<std::is_enum<T>::value, std::string>::type toString(const T& x)
^~~~~~~~~
/usr/include/cppunit/tools/StringHelper.h:31:24: error: expected unqualified-id before ‘<’ token
typename std::enable_if<std::is_enum<T>::value, std::string>::type toString(const T& x)
In file included from /usr/include/cppunit/TestCase.h:6:0,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestAssert.h: In static member function ‘static std::__cxx11::string CppUnit::assertion_traits<T>::toString(const T&)’:
/usr/include/cppunit/TestAssert.h:74:42: error: ‘toString’ is not a member of ‘CppUnit::StringHelper’
return CPPUNIT_NS::StringHelper::toString(x);
^~~~~~~~
In file included from /usr/include/cppunit/extensions/HelperMacros.h:9:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestCaller.h: At global scope:
/usr/include/cppunit/TestCaller.h:159:37: error: ‘std::function’ has not been declared
TestCaller(std::string name, std::function<void()> test_function, Fixture* fixture):
^~~~~~~~
/usr/include/cppunit/TestCaller.h:159:45: error: expected ‘,’ or ‘...’ before ‘<’ token
TestCaller(std::string name, std::function<void()> test_function, Fixture* fixture):
^
/usr/include/cppunit/TestCaller.h:200:8: error: ‘function’ in namespace ‘std’ does not name a template type
std::function<void()> m_test_function;
^~~~~~~~
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod)’:
/usr/include/cppunit/TestCaller.h:121:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, m_fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:121:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, m_fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:121:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, m_fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod, Fixture&)’:
/usr/include/cppunit/TestCaller.h:138:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, &fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:138:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, &fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:138:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, &fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod, Fixture*)’:
/usr/include/cppunit/TestCaller.h:155:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:155:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:155:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, int)’:
/usr/include/cppunit/TestCaller.h:162:17: error: ‘fixture’ was not declared in this scope
m_fixture(fixture),
^~~~~~~
/usr/include/cppunit/TestCaller.h:162:17: note: suggested alternative: ‘Fixture’
m_fixture(fixture),
^~~~~~~
Fixture
/usr/include/cppunit/TestCaller.h:163:7: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function(test_function)
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:163:23: error: ‘test_function’ was not declared in this scope
m_test_function(test_function)
^~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h: In member function ‘void CppUnit::TestCaller<Fixture>::runTest()’:
/usr/include/cppunit/TestCaller.h:175:7: error: there are no arguments to ‘m_test_function’ that depend on a template parameter, so a declaration of ‘m_test_function’ must be available [-fpermissive]
m_test_function();
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:175:7: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from /usr/include/cppunit/extensions/HelperMacros.h:14:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/extensions/TestNamer.h: In member function ‘std::__cxx11::string CppUnit::TestNamer::getTestNameFor(const string&, const E&) const’:
/usr/include/cppunit/extensions/TestNamer.h:70:95: error: ‘toString’ is not a member of ‘CppUnit::StringHelper’
return getTestNameFor(testMethodName) + " with parameter: " + CPPUNIT_NS::StringHelper::toString(val);
^~~~~~~~
In file included from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h: In static member function ‘static CppUnit::TestSuite* qa_fxpt::suite()’:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: ‘unique_ptr’ is not a member of ‘std’
CPPUNIT_TEST_SUITE_END();
^
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: expected primary-expression before ‘>’ token
CPPUNIT_TEST_SUITE_END();
^
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: ‘guard’ was not declared in this scope
CPPUNIT_TEST_SUITE_END();
^
In file included from /usr/include/cppunit/extensions/HelperMacros.h:9:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestCaller.h: In instantiation of ‘void CppUnit::TestCaller<Fixture>::runTest() [with Fixture = qa_fxpt]’:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:102:1: required from here
/usr/include/cppunit/TestCaller.h:175:22: error: ‘m_test_function’ was not declared in this scope
m_test_function();
~~~~~~~~~~~~~~~^~
/usr/include/cppunit/TestCaller.h:175:22: note: suggested alternative: ‘__fortify_function’
m_test_function();
~~~~~~~~~~~~~~~^~
__fortify_function
gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/build.make:62: recipe for target 'gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/math/qa_fxpt.cc.o' failed
make[2]: *** [gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/math/qa_fxpt.cc.o] Error 1
CMakeFiles/Makefile2:726: recipe for target 'gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/all' failed
make[1]: *** [gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
I am not a Linux expert and I am not very familiar to this compiler/library support. I don't really understand where the error comes from and how to correct it.
I use Ubuntu 18.04.
Coud you give me a hand on this please?
Any help would be very appreciated.
Thanks a lot.
/usr/include/c++/7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
To resolve the above error you need to compile with -std=c++11 flag. Open CMakeLists.txt, find all occurrences or -std=c++98 and change them to -std=c++11. Then go to the build directory, remove CMakeCache.txt and rebuild
sed -i 's/-std=c++98/-std=c++11/g' CMakeLists.txt
cd build
rm CMakeCache.txt
cmake ..
make
Also as the error is in the cppunit and it's used for testing you can try disabling all tests
cd build
rm CMakeCache.txt
cmake -DENABLE_TESTING=OFF ..
make
I am trying to do cross-compiling on Linux to create exe file for 32bit Windows. I use following code:
i686-w64-mingw32-g++ rnfltk_simplest.cpp -static-libgcc -static-libstdc++ -o rnfltk_simplest.exe -lfltk -I/usr/include/
But I get an output with many errors:
In file included from /usr/share/mingw-w64/include/winsock.h:32:0,
from /usr/share/mingw-w64/include/windows.h:92,
from /usr/include/Fl/Fl_Window.H:26,
from rnfltk_simplest.cpp:4:
/usr/share/mingw-w64/include/_timeval.h:10:8: error: redefinition of ‘struct timeval’
struct timeval
^~~~~~~
In file included from /usr/include/sys/select.h:47:0,
from /usr/include/sys/types.h:219,
from /usr/include/stdlib.h:275,
from /usr/include/FL/fl_utf8.h:36,
from /usr/include/FL/Fl.H:32,
from rnfltk_simplest.cpp:2:
/usr/include/bits/time.h:30:8: error: previous definition of ‘struct timeval’
struct timeval
^~~~~~~
In file included from /usr/share/mingw-w64/include/winsock.h:36:0,
from /usr/share/mingw-w64/include/windows.h:92,
from /usr/include/Fl/Fl_Window.H:26,
from rnfltk_simplest.cpp:4:
/usr/share/mingw-w64/include/psdk_inc/_fd_types.h:21:16: error: using typedef-name ‘fd_set’ after ‘struct’
typedef struct fd_set
^~~~~~
In file included from /usr/include/sys/types.h:219:0,
from /usr/include/stdlib.h:275,
from /usr/include/FL/fl_utf8.h:36,
from /usr/include/FL/Fl.H:32,
from rnfltk_simplest.cpp:2:
/usr/include/sys/select.h:77:5: note: ‘fd_set’ has a previous declaration here
} fd_set;
^~~~~~
In file included from /usr/share/mingw-w64/include/winsock.h:36:0,
from /usr/share/mingw-w64/include/windows.h:92,
from /usr/include/Fl/Fl_Window.H:26,
from rnfltk_simplest.cpp:4:
/usr/share/mingw-w64/include/psdk_inc/_fd_types.h:25:3: error: conflicting declaration ‘typedef int fd_set’
} fd_set;
^~~~~~
In file included from /usr/include/sys/types.h:219:0,
from /usr/include/stdlib.h:275,
from /usr/include/FL/fl_utf8.h:36,
from /usr/include/FL/Fl.H:32,
from rnfltk_simplest.cpp:2:
/usr/include/sys/select.h:77:5: note: previous declaration as ‘typedef struct fd_set fd_set’
} fd_set;
^~~~~~
In file included from /usr/share/mingw-w64/include/winsock.h:36:0,
from /usr/share/mingw-w64/include/windows.h:92,
from /usr/include/Fl/Fl_Window.H:26,
from rnfltk_simplest.cpp:4:
/usr/share/mingw-w64/include/psdk_inc/_fd_types.h:104:16: error: using typedef-name ‘fd_set’ after ‘struct’
typedef struct fd_set FD_SET;
^~~~~~
In file included from /usr/include/sys/types.h:219:0,
from /usr/include/stdlib.h:275,
from /usr/include/FL/fl_utf8.h:36,
from /usr/include/FL/Fl.H:32,
from rnfltk_simplest.cpp:2:
/usr/include/sys/select.h:77:5: note: ‘fd_set’ has a previous declaration here
} fd_set;
^~~~~~
In file included from /usr/share/mingw-w64/include/winsock.h:36:0,
from /usr/share/mingw-w64/include/windows.h:92,
from /usr/include/Fl/Fl_Window.H:26,
from rnfltk_simplest.cpp:4:
/usr/share/mingw-w64/include/psdk_inc/_fd_types.h:105:16: error: using typedef-name ‘fd_set’ after ‘struct’
typedef struct fd_set *PFD_SET;
^~~~~~
In file included from /usr/include/sys/types.h:219:0,
from /usr/include/stdlib.h:275,
from /usr/include/FL/fl_utf8.h:36,
from /usr/include/FL/Fl.H:32,
from rnfltk_simplest.cpp:2:
/usr/include/sys/select.h:77:5: note: ‘fd_set’ has a previous declaration here
} fd_set;
^~~~~~
In file included from /usr/share/mingw-w64/include/winsock.h:36:0,
from /usr/share/mingw-w64/include/windows.h:92,
from /usr/include/Fl/Fl_Window.H:26,
from rnfltk_simplest.cpp:4:
/usr/share/mingw-w64/include/psdk_inc/_fd_types.h:106:16: error: using typedef-name ‘fd_set’ after ‘struct’
typedef struct fd_set *LPFD_SET;
^~~~~~
In file included from /usr/include/sys/types.h:219:0,
from /usr/include/stdlib.h:275,
from /usr/include/FL/fl_utf8.h:36,
from /usr/include/FL/Fl.H:32,
from rnfltk_simplest.cpp:2:
/usr/include/sys/select.h:77:5: note: ‘fd_set’ has a previous declaration here
} fd_set;
^~~~~~
In file included from /usr/share/mingw-w64/include/windows.h:92:0,
from /usr/include/Fl/Fl_Window.H:26,
from rnfltk_simplest.cpp:4:
/usr/share/mingw-w64/include/winsock.h:299:34: error: conflicting declaration of C function ‘int select(int, fd_set*, fd_set*, fd_set*, PTIMEVAL)’
WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL timeout);
^~~~~~
In file included from /usr/include/sys/types.h:219:0,
from /usr/include/stdlib.h:275,
from /usr/include/FL/fl_utf8.h:36,
from /usr/include/FL/Fl.H:32,
from rnfltk_simplest.cpp:2:
/usr/include/sys/select.h:108:12: note: previous declaration ‘int select(int, fd_set*, fd_set*, fd_set*, timeval*)’
extern int select (int __nfds, fd_set *__restrict __readfds,
^~~~~~
Where is the problem and how can it be solved? Thanks for your help.
The problem is in
-I/usr/include/
This path contains headers for libraries configured for and installed in your Linux system. But you want to use headers specific to the Windows libraries. These are installed in the MinGW compiler "system" include directory (most likely /usr/share/mingw-w64/include given that from there all the collisions come).
You need to install Fltk into your MinGW. For example, in openSUSE, this would be the package mingw64-fltk-devel.
I am trying to install allennlp on my mac. I have tried installing macOS headers which solved the missing headers problem but now i am experiencing new problems.
The error when i run pip install allennlp:
Running setup.py bdist_wheel for jsonnet ... error
Complete output from command /anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/qf/jkn4v43j08xgst0r9yxyl0dc0000gn/T/pip-install-i4nyb384/jsonnet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/qf/jkn4v43j08xgst0r9yxyl0dc0000gn/T/pip-wheel-eof7cc6k --python-tag cp37:
running bdist_wheel
running build
running build_ext
x86_64-apple-darwin13.4.0-clang++ -c -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -stdlib=libc++ -fvisibility-inlines-hidden -std=c++14 -fmessage-length=0 core/desugarer.cpp -o core/desugarer.o
In file included from core/desugarer.cpp:17:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/cassert:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/assert.h:44:
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:111:82: error: use of undeclared identifier 'labs'; did you mean 'abs'?
inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:111:44: note: 'abs' declared here
inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:113:81: error: use of undeclared identifier 'llabs'
inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:116:35: error: unknown type name 'ldiv_t'
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:116:95: error: use of undeclared identifier 'ldiv'; did you mean 'div'?
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:116:42: note: 'div' declared here
inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:118:34: error: unknown type name 'lldiv_t'
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/stdlib.h:118:94: error: use of undeclared identifier 'lldiv'
inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);}
^
In file included from core/desugarer.cpp:19:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:642:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/cstring:61:
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:74:64: error: use of undeclared identifier 'strchr'
char* __libcpp_strchr(const char* __s, int __c) {return (char*)strchr(__s, __c);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:81:75: error: use of undeclared identifier 'strpbrk'
char* __libcpp_strpbrk(const char* __s1, const char* __s2) {return (char*)strpbrk(__s1, __s2);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:88:65: error: use of undeclared identifier 'strrchr'; did you mean 'strchr'?
char* __libcpp_strrchr(const char* __s, int __c) {return (char*)strrchr(__s, __c);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:76:13: note: 'strchr' declared here
const char* strchr(const char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:95:76: error: use of undeclared identifier 'memchr'
void* __libcpp_memchr(const void* __s, int __c, size_t __n) {return (void*)memchr(__s, __c, __n);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:102:74: error: use of undeclared identifier 'strstr'; did you mean 'strchr'?
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:78:13: note: 'strchr' declared here
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:102:74: error: no matching function for call to 'strchr'
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:78:13: note: candidate disabled: <no message provided>
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:102:81: error: cannot initialize a parameter of type 'char *' with an lvalue of type 'const char *'
char* __libcpp_strstr(const char* __s1, const char* __s2) {return (char*)strstr(__s1, __s2);}
^~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:78:32: note: passing argument to parameter '__s' here
char* strchr( char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
In file included from core/desugarer.cpp:19:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:642:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstring:70:9: error: no member named 'memcpy' in the global namespace; did you mean 'memchr'?
using ::memcpy;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:97:13: note: 'memchr' declared here
const void* memchr(const void* __s, int __c, size_t __n) {return __libcpp_memchr(__s, __c, __n);}
^
In file included from core/desugarer.cpp:19:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:642:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstring:71:9: error: no member named 'memmove' in the global namespace
using ::memmove;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstring:72:9: error: no member named 'strcpy' in the global namespace; did you mean 'strchr'?
using ::strcpy;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:76:13: note: 'strchr' declared here
const char* strchr(const char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
In file included from core/desugarer.cpp:19:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:642:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstring:73:9: error: no member named 'strncpy' in the global namespace
using ::strncpy;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstring:74:9: error: no member named 'strcat' in the global namespace; did you mean 'strchr'?
using ::strcat;
~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/string.h:76:13: note: 'strchr' declared here
const char* strchr(const char* __s, int __c) {return __libcpp_strchr(__s, __c);}
^
In file included from core/desugarer.cpp:19:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:642:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstring:75:9: error: no member named 'strncat' in the global namespace
using ::strncat;
~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Makefile:118: core/desugarer.o] Error 1
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/qf/jkn4v43j08xgst0r9yxyl0dc0000gn/T/pip-install-i4nyb384/jsonnet/setup.py", line 75, in <module>
test_suite="python._jsonnet_test",
File "/anaconda3/lib/python3.7/site-packages/setuptools/__init__.py", line 143, in setup
return distutils.core.setup(**attrs)
File "/anaconda3/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/anaconda3/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/anaconda3/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 188, in run
self.run_command('build')
File "/anaconda3/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/anaconda3/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/anaconda3/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/anaconda3/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/qf/jkn4v43j08xgst0r9yxyl0dc0000gn/T/pip-install-i4nyb384/jsonnet/setup.py", line 54, in run
raise Exception('Could not build %s' % (', '.join(LIB_OBJECTS)))
Exception: Could not build core/desugarer.o, core/formatter.o, core/libjsonnet.o, core/lexer.o, core/parser.o, core/pass.o, core/static_analysis.o, core/string_utils.o, core/vm.o, third_party/md5/md5.o
----------------------------------------
Failed building wheel for jsonnet
Running setup.py clean for jsonnet
Failed to build jsonnet
My compiler and gcc:
(base) Sakets-MacBook-Pro:usr saketkhandelwal$ gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
(base) Sakets-MacBook-Pro:usr saketkhandelwal$ clang --version
clang version 4.0.1 (tags/RELEASE_401/final)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /anaconda3/bin
How do i fix this, i have tried reinstalling command line tools and package headers but still no luck.
I suppose you can resolve this by updating to latest version of
anaconda
Try to install jsonnet separately using conda install -c
conda-forge jsonnet and then pip install allennlp
Please refer to this issue on allennlp github for more details :
Pip3 install failing on jsonnet
In my limited experience with kernel program, my os is Ubuntu16.04,and use sudo apt-get install linux-headers-`uname -r` to install kernel header,and the kernel_hello.c file is
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("DUAL BSD/GPL")
MODULE_AUTHOR("YANQIN")
MODULE_DESCRIPTION("kernel module hello")
MODULE_VERSION("1.0")
static int hello_init(void)
{
printk(KERN_ALERT "hello_init() start\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "hello_exit() start\n");
}
module_init(hello_init);
module_exit(hello_exit);
and the Makefile is
KERNAL_DIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
obj-m := kernel_hello.o
default:
$(MAKE) -C $(KERNAL_DIR) M=$(PWD) modules
but the build result is like this
yq#ubuntu:~/kernelProgram$ make
make -C /lib/modules/4.10.0-28-generic/build M=/home/yq/kernelProgram modules
make[1]: Entering directory '/usr/src/linux-headers-4.10.0-28-generic'
CC [M] /home/yq/kernelProgram/kernel_hello.o
In file included from ./include/linux/module.h:18:0,
from /home/yq/kernelProgram/kernel_hello.c:2:
./include/linux/moduleparam.h:21:1: error: expected ‘,’ or ‘;’ before ‘static’
static const char __UNIQUE_ID(name)[] \
^
./include/linux/module.h:161:32: note: in expansion of macro ‘__MODULE_INFO’
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
^
/home/yq/kernelProgram/kernel_hello.c:6:1: note: in expansion of macro ‘MODULE_AUTHOR’
MODULE_AUTHOR("YANQIN")
^
In file included from /home/yq/kernelProgram/kernel_hello.c:2:0:
/home/yq/kernelProgram/kernel_hello.c: In function ‘__inittest’:
/home/yq/kernelProgram/kernel_hello.c:19:13: error: ‘hello_init’ undeclared (first use in this function)
module_init(hello_init);
^
./include/linux/module.h:131:11: note: in definition of macro ‘module_init’
{ return initfn; } \
^
/home/yq/kernelProgram/kernel_hello.c: At top level:
./include/linux/module.h:132:6: error: ‘init_module’ aliased to undefined symbol ‘hello_init’
int init_module(void) __attribute__((alias(#initfn)));
^
/home/yq/kernelProgram/kernel_hello.c:19:1: note: in expansion of macro
‘module_init’
module_init(hello_init);
^
scripts/Makefile.build:301: recipe for target
'/home/yq/kernelProgram/kernel_hello.o' failed
make[2]: *** [/home/yq/kernelProgram/kernel_hello.o] Error 1
Makefile:1524: recipe for target '_module_/home/yq/kernelProgram' failed
make[1]: *** [_module_/home/yq/kernelProgram] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.10.0-28-generic'
Makefile:7: recipe for target 'default' failed
make: *** [default] Error 2
i don't know why it saids the linux kernel header has error
Calls to MODULE_LICENSE and other MODULE_* macros, which setup information about the module, should be terminated with ; like common C instructions
I have all dependencies set up, as far as I'm aware, ccmake shows everything has been found. However, when I run make, I get the following output:
shanesimmsart#shanesimmsart-pc:~/OpenShadingLanguage/build$ make
[ 1%] Building CXX object src/liboslcomp/CMakeFiles/oslcomp.dir/ast.cpp.o
In file included from /home/shanesimmsart/OpenShadingLanguage/src/include/osl_pvt.h:31:0,
from /home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/ast.cpp:35:
/home/shanesimmsart/OpenShadingLanguage/src/include/OSL/oslconfig.h:109:13: error: ‘OIIO::string_view’ has not been declared
using OIIO::string_view;
^
In file included from /home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/ast.cpp:35:0:
/home/shanesimmsart/OpenShadingLanguage/src/include/osl_pvt.h:54:1: error: ‘string_view’ does not name a type
string_view shadertypename (ShaderType s);
^
/home/shanesimmsart/OpenShadingLanguage/src/include/osl_pvt.h:58:34: error: ‘string_view’ was not declared in this scope
ShaderType shadertype_from_name (string_view name);
^
/home/shanesimmsart/OpenShadingLanguage/src/include/osl_pvt.h:76:32: error: ‘string_view’ was not declared in this scope
ShaderUse shaderuse_from_name (string_view name);
^
In file included from /home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/oslcomp_pvt.h:36:0,
from /home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/ast.cpp:36:
/home/shanesimmsart/OpenShadingLanguage/src/include/OSL/oslcomp.h:52:19: error: ‘string_view’ has not been declared
bool compile (string_view filename,
^
/home/shanesimmsart/OpenShadingLanguage/src/include/OSL/oslcomp.h:54:19: error: ‘string_view’ has not been declared
string_view stdoslpath = string_view());
^
/home/shanesimmsart/OpenShadingLanguage/src/include/OSL/oslcomp.h:59:26: error: ‘string_view’ has not been declared
bool compile_buffer (string_view sourcecode, std::string &osobuffer,
^
/home/shanesimmsart/OpenShadingLanguage/src/include/OSL/oslcomp.h:61:26: error: ‘string_view’ has not been declared
string_view stdoslpath = string_view());
^
/home/shanesimmsart/OpenShadingLanguage/src/include/OSL/oslcomp.h:65:5: error: ‘string_view’ does not name a type
string_view output_filename () const;
^
/home/shanesimmsart/OpenShadingLanguage/src/include/OSL/oslcomp.h:54:56: error: ‘string_view’ was not declared in this scope
string_view stdoslpath = string_view());
^
/home/shanesimmsart/OpenShadingLanguage/src/include/OSL/oslcomp.h:61:63: error: ‘string_view’ was not declared in this scope
string_view stdoslpath = string_view());
^
In file included from /home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/oslcomp_pvt.h:37:0,
from /home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/ast.cpp:36:
/home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/ast.h:354:5: error: ‘string_view’ does not name a type
string_view shadertypename () const;
^
In file included from /home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/ast.cpp:36:0:
/home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/oslcomp_pvt.h:69:19: error: ‘string_view’ has not been declared
bool compile (string_view filename,
^
/home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/oslcomp_pvt.h:71:19: error: ‘string_view’ has not been declared
string_view stdoslpath);
^
/home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/oslcomp_pvt.h:73:26: error: ‘string_view’ has not been declared
bool compile_buffer (string_view sourcecode,
^
/home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/oslcomp_pvt.h:76:26: error: ‘string_view’ has not been declared
string_view stdoslpath);
^
/home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/oslcomp_pvt.h:249:5: error: ‘string_view’ does not name a type
string_view output_filename () const { return m_output_filename; }
^
/home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/ast.cpp: In member function ‘virtual void OSL::pvt::ASTshader_declaration::print(std::ostream&, int) const’:
/home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/ast.cpp:195:59: error: ‘shadertypename’ was not declared in this scope
out << "(" << nodetypename() << " " << shadertypename()
^
/home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/ast.cpp: At global scope:
/home/shanesimmsart/OpenShadingLanguage/src/liboslcomp/ast.cpp:204:1: error: ‘string_view’ does not name a type
string_view
^
make[2]: *** [src/liboslcomp/CMakeFiles/oslcomp.dir/ast.cpp.o] Error 1
make[1]: *** [src/liboslcomp/CMakeFiles/oslcomp.dir/all] Error 2
make: *** [all] Error 2
This appears to be an issue with string_view.h, included from OpenImageIO, however when I look in /usr/include/OpenImageIO/, string_view.h is right there. As far as I can tell, OIIO is up to date with version 1.5, so I can't imagine it's a version issue either, although I'm not ruling that out.
Any advice would be greatly appreciated.