Build wxWidgets 2.8.12 GCC 4.6.2 - gcc

I am getting this error when building wxWidgets in Cygwin:
../src/generic/dirctrlg.cpp:67:24: fatal error: direct.h: No such file or directory
compilation terminated.
make: *** [corelib_dirctrlg.o] Error 1
T_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -I/cygdrive/c/wxWidgets-2.8.12/build-debug/lib/wx/include/msw-ansi-debug-static-2.8 -I../include -Wall -Wundef -Wno-ctor-dtor-privacy -ggdb -O0 ../src/generic/dirctrlg.cpp
Makefile:28340: recipe for target `corelib_dirctrlg.o' failed
I followed the instructions included in wxWidgets for Windows using configure in install.txt(Compiling wxWidgets).

Which compiler do you use? See http://wxwidgets.blogspot.com/2011/06/choosing-gcc-for-building-wxwidgets.html for some of the choices you have. FWIW direct.h should be present in MinGW compiler headers.

Related

How to use NDK wth gcc on Android?

I need to compile OpenCV 2 to test some things and it can only be built with gcc. I tried downloading the oldest NDK in Android Studio which is version 16, however it still tries to use clang. How can I force it to use gcc?
Error on version 16:
ERROR: /home/user/AndroidStudioProjects/opencv2builder/app/src/main/cpp/CMakeLists.txt : C/C++ debug|x86 : CMake Error at /home/user/Android/Sdk/cmake/3.10.2.4988404/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/home/user/Android/Sdk/ndk/16.1.4479499/toolchains/llvm/prebuilt/linux-x86_64/bin/clang"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/user/AndroidStudioProjects/opencv2builder/app/.cxx/cmake/debug/x86/CMakeFiles/CMakeTmp
Run Build Command:"/home/user/Android/Sdk/cmake/3.10.2.4988404/bin/ninja" "cmTC_ed369"
[1/2] Building C object CMakeFiles/cmTC_ed369.dir/testCCompiler.c.o
FAILED: CMakeFiles/cmTC_ed369.dir/testCCompiler.c.o
/home/user/Android/Sdk/ndk/16.1.4479499/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=i686-none-linux-android --gcc-toolchain=/home/user/Android/Sdk/ndk/16.1.4479499/toolchains/x86-4.9/prebuilt/linux-x86_64 --sysroot=/home/user/Android/Sdk/ndk/16.1.4479499/sysroot -isystem /home/user/Android/Sdk/ndk/16.1.4479499/sysroot/usr/include/i686-linux-android -D__ANDROID_API__=16 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -mstackrealign -Wa,--noexecstack -Wformat -Werror=format-security -fPIE -o CMakeFiles/cmTC_ed369.dir/testCCompiler.c.o -c testCCompiler.c
/home/user/Android/Sdk/ndk/16.1.4479499/toolchains/llvm/prebuilt/linux-x86_64/bin/clang: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt
Affected Modules: app

Issue compiling FFTW

I am trying to install FFTW on my mac with OpenMP enabled. I initially had trouble configuring, but that issue was solved here.
Now after configuring I type "make" and I get the following error:
libtool: compile: mpicc -DHAVE_CONFIG_H -I. -I.. -I../kernel -I../dft -I../rdft -I../api -I../tests -I../libbench2 -O3 -fomit-frame-pointer -mtune=native -malign-double -fstrict-aliasing -fno-schedule-insns -ffast-math -Wa,-q -Wl,-no_compact_unwind -MT any-true.lo -MD -MP -MF .deps/any-true.Tpo -c any-true.c -o any-true.o
clang: error: unknown argument: '-malign-double'
clang: warning: -Wl,-no_compact_unwind: 'linker' input unused
clang: error: unsupported argument '-q' to option 'Wa,'
clang: warning: optimization flag '-fno-schedule-insns' is not supported
make[3]: *** [any-true.lo] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
What is the issue here and how can I solve it?
You could try passing the location of the gcc compiler its absolute path rather than the binary name, just as
CC=/usr/local/gcc-6.1.0/bin/gcc-6.1.0 ./configure --enable-mpi --enable-threads --enable-openmp
EDIT
After having a brief chat with OP, it looks like he omitted part of the error and the error came from the mpicc compiler used (due to --enable-mpi in the configure stage). According to the user, they were using OpenMPI and according to this FAQ the user can tune the C compiler by using the OMPI_CC environtment variable. So my suggestion was to build the FFTW library as
OMPI_CC=/usr/local/gcc-6.1.0/bin/gcc-6.1.0 make

Clang boost header not found

I am trying to compile a Python PCL module which builds some C++ source. I am getting this error:
$ python setup.py install
running install
running build
running build_py
running build_ext
skipping 'pcl/_pcl.cpp' Cython extension (up-to-date)
building 'pcl._pcl' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -g -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Python/2.7/site-packages/numpy/core/include -I/usr/local/Cellar/pcl/HEAD/include/pcl-1.8 -I/usr/local/Cellar/eigen/3.2.3/include/eigen3 -I/usr/local/Cellar/pcl/HEAD/include/pcl-1.8 -I/usr/local/Cellar/flann/1.8.4/include -I/usr/local/Cellar/pcl/HEAD/include/pcl-1.8 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pcl/_pcl.cpp -o build/temp.macosx-10.6-intel-2.7/pcl/_pcl.o
pcl/_pcl.cpp:244:10: fatal error: 'boost/smart_ptr/shared_ptr.hpp' file not
found
#include "boost/smart_ptr/shared_ptr.hpp"
^
1 error generated.
error: command '/usr/bin/clang'
For whatever reason clang isn't looking in /usr/local/include where it most definitely would find the boost headers. As you can see it is linking all the other dependencies fine. What can I add that so clang will find boost?
On OSX 10.10, nothing fancy happening anywhere. Boost was probably installed by homebrew, but the files are all in /usr/local/include/boost as I'd expect.
Check the output of /usr/bin/clang++ -v some_test_file.cpp but chances are /usr/local/include isn't in the standard search path of the compiler.
You'll need to add -I/usr/local/include to CXXFLAGS or CPPFLAGS or whatever appropriate place in your build script or environment. It seems the python build script is failing to properly detect Boost.
If the above is not true (and /usr/local/include does show up in the output), make sure /usr/local/include/boost/smart_ptr/shared_ptr.hpp exists.

how to use snprintf() in g++ -std=c++11 version 4.8.2

I am trying compile code that uses snprintf in version 4.8.2 of g++ with -std=c++11 without success.
Why doesn't g++ recognize snprintf? Can I overcome this while still using snprintf and c++11?
I got the following:
make all Building file: ../src/cppHWtest.cpp Invoking: Cygwin C++
Compiler g++ -std=c++11 -D"hash_map=unordered_map" -O0 -g3 -Wall -c
-fmessage-length=0 -MMD -MP -MF"src/cppHWtest.d" -MT"src/cppHWtest.d" -o "src/cppHWtest.o" "../src/cppHWtest.cpp" cygwin warning: MS-DOS style path detected: C:\Users\poudyal\workspace\cppHWtest\Debug
Preferred POSIX equivalent is:
/cygdrive/c/Users/poudyal/workspace/cppHWtest/Debug CYGWIN
environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames ../src/cppHWtest.cpp: In function 'int main()':
../src/cppHWtest.cpp:20:35: error: 'snprintf' was not declared in this
scope snprintf(buff, 10, "%s", "Hell O");
^ make: *** [src/cppHWtest.o] Error 1 src/subdir.mk:18: recipe for target 'src/cppHWtest.o' failed
**** Build Finished ****
Probably less intrusive solution than switching the mode to -std=gnu++11 is -U__STRICT_ANSI__. This will enable #if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) at stdio.h:234 (GCC 4.8.3).

How do I fix the DoS String#hash vulnerability for ruby-enterprise-1.8.7-2009.10?

The problem is described here.
There have been patches for 1.8, JRuby and later version of ree, but I can't find anything for this version.
I tried applying this patch.
But compiling fails with an error that doesn't make sense since there are no changes to the compiler directives that I can see:
gcc -g -Os -fno-strict-aliasing -DRUBY_EXPORT -D_GNU_SOURCE=1 -I. -I. -c st.c
st.c:230:49: error: '#' is not followed by a macro parameter
make: *** [st.o] Error 1

Resources