Compiling Asterisk on Windows - windows

I was trying to compile Asterisk 1.6 on Windows using Cygwin
1- I have installed Cygwin and included (Debug, Devel and Libs )while installing Cygwin.
2- ./Configure passed successfully
3- while running make command I got this
In file included from /home/Administrator/asterisk-1.6.2.24/include/asterisk.h:27:0,
from smsq.c:20:
/home/Administrator/asterisk-1.6.2.24/include/asterisk/compat.h:205:28: error: conflicting types for ‘uint64_t’
typedef unsigned long long uint64_t;
^
In file included from /usr/include/stdint.h:14:0,
from /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/stdint.h:9,
from /usr/include/inttypes.h:19,
from /home/Administrator/asterisk-1.6.2.24/include/asterisk/compat.h:29,
from /home/Administrator/asterisk-1.6.2.24/include/asterisk.h:27,
from smsq.c:20:
/usr/include/sys/_stdint.h:60:20: note: previous declaration of ‘uint64_t’ was here
typedef __uint64_t uint64_t ;
^
make[1]: *** [/home/Administrator/asterisk-1.6.2.24/Makefile.rules:91: smsq.o] Error 1
make: *** [Makefile:422: utils] Error 2
I need to know what is the cause and how can I fix this issue?
Thanks in advance

The type named uint64_t is defined in <stdint.h> where it should be, but asterisk is (wrongly, all identifiers ending in _t are reserved names) trying to provide its own definition.
Remove the improper definition in "compat.h".

Related

How to fix "error: no member named 'fancy_abort' in namespace 'std::__1'; did you mean simply 'fancy_abort'? _VSTD::abort();"

Platform: Macos Catalina 10.15.2
Xcode version: Xcode 11
I have tried many times to make-all gcc to build my source code. However, I have encountered a problem:
In file included from ../.././gcc/c/c-objc-common.c:33:
In file included from /Applications/Xcode11.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/new:85:
/Applications/Xcode11.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception:181:5: error:
no member named 'fancy_abort' in namespace 'std::__1'; did you mean simply 'fancy_abort'?
_VSTD::abort();
^~~~~~~ /Applications/Xcode11.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:873:15: note:
expanded from macro '_VSTD' # _VSTD std::_LIBCPP_ABI_NAMESPACE
^ ../.././gcc/system.h:685:13: note: 'fancy_abort' declared here extern void fancy_abort (const char *, int, const char
*) ATTRIBUTE_NORETURN;
^
1 error generated.
make[1]: *** [c/c-objc-common.o] Error 1
make: *** [all-gcc] Error 2
I have tried to install another version of Xcode. I have installed Xcode6 but it still did not work, and I found a solution of this issue. But when I download Xcode8.3.3, it is not compatible with Catalina 10.15.2.
I ran in to this issue while using crosstools-ng on mac (mojave 10.14) to compile cross-platform toolchain with gcc 4.9.
Solution: Edit .build/src/gcc-4.9.4/gcc/system.h to add #include <map> in #ifdef __cplusplus block where other include statements are.
The problem is that is included (via ) after abort has been
defined as a macro to fancy_abort. And thus when the C++ standard headers try
to call std::abort, they end up calling std::fancy_abort, which of course
doesn't exist.
Source: https://gcc.gnu.org/legacy-ml/gcc-bugs/2017-09/msg00154.html

gem install t gives "Failed to build gem native extension"

I'm trying to gem install t(a command line tool for Twitter) in my OSX High Sierra. My Ruby version is ruby 2.3.7p456.
But I am getting the error below:
~> gem install t
Building native extensions. This could take a while...
ERROR: Error installing t:
ERROR: Failed to build gem native extension.
/Users/akira/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20181213-96401-3tpab1.rb extconf.rb
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling ryah_http_parser.c
In file included from ryah_http_parser.c:24:
In file included from ./ryah_http_parser.h:44:
In file included from /usr/local/include/stdint.h:59:
In file included from /usr/local/include/stdint.h:59:
....
/usr/local/include/stdint.h:2:10: error: #include nested too deeply
#include <stddef.h>
^
/usr/local/include/stdint.h:59:11: error: #include nested too deeply
# include <stdint.h>
^
/usr/local/include/stdint.h:72:11: error: #include nested too deeply
# include <sys/types.h>
^
In file included from ryah_http_parser.c:24:
./ryah_http_parser.h:210:3: error: unknown type name 'uint64_t'
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
^
In file included from ryah_http_parser.c:28:
In file included from /usr/include/stdlib.h:65:
In file included from /usr/include/sys/wait.h:110:
/usr/include/sys/resource.h:197:2: error: unknown type name 'uint64_t'
uint64_t ri_user_time;
^
/usr/include/sys/resource.h:198:2: error: unknown type name 'uint64_t'
uint64_t ri_system_time;
^
/usr/include/sys/resource.h:199:2: error: unknown type name 'uint64_t'
uint64_t ri_pkg_idle_wkups;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [ryah_http_parser.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/akira/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/http_parser.rb-0.6.0 for inspection.
Results logged to /Users/akira/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/http_parser.rb-0.6.0/gem_make.out
Does anyone have any idea what the problem is here?
Looks like you need to install the command line dev tools on osx.
Run xcode-select --install and try again.

Error building OpenCV with mingw under Windows 10

I tried to build the opencv Library on my Windows 10 PC.
I managed to generate everything from source with cmake. (Nothing red, no errors).
When I try to build everything with mingw (mingw32-make install)
It starts building and after a while I get the following error.
[ 76%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.obj
In file included from C:/Python34/include/Python.h:8:0,
from C:\OpenCV\opencv-master\modules\python\src2\cv2.cpp:6:
C:/Python34/include/pyconfig.h:440:5: warning: "_MSC_VER" is not defined [-Wundef]
#if _MSC_VER >= 1800
^~~~~~~~
In file included from C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/math.h:36:0,
from C:/Python34/include/pyport.h:328,
from C:/Python34/include/Python.h:50,
from C:\OpenCV\opencv-master\modules\python\src2\cv2.cpp:6:
C:/PROGRA~1/MINGW-~1/X86_64~1.0-P/mingw64/lib/gcc/x86_64-w64-mingw32/6.2.0/include/c++/cmath:1133:11: error: '::hypot' has not been declared
using ::hypot;
^~~~~
modules\python3\CMakeFiles\opencv_python3.dir\build.make:179: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.obj' failed
mingw32-make[2]: *** [modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.obj] Error 1
CMakeFiles\Makefile2:7051: recipe for target 'modules/python3/CMakeFiles/opencv_python3.dir/all' failed
mingw32-make[1]: *** [modules/python3/CMakeFiles/opencv_python3.dir/all] Error 2
Makefile:159: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
I found the following "Error: '::hypot' has not been declared" in cmath while trying to embed Python
But could not figured it out.
Can Anyone hint me in the direction. Where are those includes in the case of building OpenCV?
Versions:
OpenCV 3.2.0,
CMake 3.4.1,
GNU Make 4.1
Any help qould be appreciated!
Go to the following file
C:\OpenCV\opencv-master\modules\python\src2\cv2.cpp
and see if
#include "Python.h"
comes before #include <cmath>.
In that case exchange the order, i.e. write
#include <cmath>
#include "Python.h"
so that cmath comes before Python.h.
Try to build and see if that solves at list the error that you reported.

How to install SystemC on xcode

Is it possible to install SystemC on XCode? If so, how would I do it? Do I just need to set up some libraries and point xCode at them? I've set up openGL on xcode before but, I can't similar looking libraries for SystemC.
I tried following the top voted instructions in the link suggested and got these errors on the make install command:
...
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
../../libtool: line 1096: cd: .libs/libsystemc.lax/libkernel.a: No such file or directory
make[3]: *** [libsystemc.la] Error 1
make[2]: *** [install-recursive] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
I got the same error trying the other instructions.
In order to use SystemC with xCode, you have to build the library first. You can follow instructions #rmaddy suggested : how to use and install SystemC in terminal mac OS X?
I suppose you installed SystemC (result of make install) in /usr/local/systemc and so you have /usr/local/systemc/include containing SystemC headers and /usr/local/systemc/lib-macosx64 containing the library.
Create a new xCode project. File -> New -> Project. Choose OS X / Application and finally Command Line Tool for example. Add a product name (SystemCExample) and choose C++ language.
Select your target (SystemCExample) on the left panel and then be sure you selected your target in the top left list (and not the project). Select the area Build Settings and under Search Paths you will find Header Search Paths. Click on the "+" and add SystemC headers path (/usr/local/systemc/include).
Then, select the section Build Phases and either add the path manually or drag and drop the static (libsystemc.a) or dynamic version (libsystemc.dylib) of SystemC library you can find in /usr/local/systemc/lib-macosx64 in Link Binary with Libraries part.
Finally, just add a minimalist SystemC code and press the build and run button:
#include <systemc>
int sc_main(int argc, char *argv[]) {
std::cout << "Hello, World!\n";
sc_core::sc_start();
return 0;
}

CppuTest to build with C++11 versions

Installed g++ 4.9.0 (experimental) version under Ubuntu (I am using certain features provided by this version)
When building my code, I use cmake from a script, and it builds correctly. gcc below contains the path where g++ is installed (/mnt...)
$_cmake_ $_dir_ -DCMAKE_CXX_COMPILER=${_gpp_} -DCMAKE_C_COMPILER=${_gcc_} -DCMAKE_BUILD_TYPE=${_build_} -DCMAKE_INSTALL_PREFIX=${_install_} -DBUILD_TESTING:BOOL=1
Now, when I make the CppuTest to build the Unit Tests for my code, I get the following error.
make all
compiling UncrosserTest.cpp
In file included from /home/miguel/Desktop/Ugur/scmProject/scm/dist/dev/mfx_prod/scm/20160207/include/scm/services/primitives.hpp:4:0,
from /home/miguel/Desktop/Ugur/scmProject/log/lidya/src/cpp/scm/services/examples/dummy_strategy/Inside.hpp:6,
from AllTests/Uncrosser/UncrosserTest.cpp:7:
/usr/include/c++/4.9/experimental/optional: In member function ‘void std::experimental::_Optional_base<_Tp, _ShouldProvideDestructor>::_M_construct(_Args&& ...)’:
/usr/include/c++/4.9/experimental/optional:294:18: error: expected type-specifier
::new (std::__addressof(this->_M_payload))
^
/usr/include/c++/4.9/experimental/optional:294:18: error: expected ‘)’
/usr/include/c++/4.9/experimental/optional: In member function ‘void std::experimental::_Optional_base<_Tp, false>::_M_construct(_Args&& ...)’:
/usr/include/c++/4.9/experimental/optional:424:18: error: expected type-specifier
::new (std::__addressof(this->_M_payload))
^
/usr/include/c++/4.9/experimental/optional:424:18: error: expected ‘)’
make: *** [objs/AllTests/Uncrosser/UncrosserTest.o] Error 1
In the CppuTest makefile have included CPPUTEST_CPPFLAGS += -std=c++1y. I guess that am missing some flags in this makefile because as I said the C++ experimental library is building correctly in my "regular" code. What am I missing ?
Possible it's an include problem, see CppUTest Manual - section Conflicts with operator new macros (STL!) and Conflicts with my own overload!
TL;DR
In UncrosserTest add includes for CppUTest after your's.
Instead of
#include <CppUTest/TestHarnes.h>
#include "whatever.h"
do
#include "whatever.h"
#include <CppUTest/TestHarnes.h>

Resources