stpncpy.c:33: error while trying to compile dc3dd on Mac OSX MT Lion - xcode4.5

I'm trying to compile dc3dd which I downloaded from sourceforge.net. I'm running Mac OS X MT Lion. I have installed Xcode v4.5.2 and have installed the command line tools. I have also installed MacPorts 2.1.2. I ran 'sudo ./configure' as instructed which appeared to complete successfully. When I run 'sudo make'. I get the following error:
sudo make
Password:
make all-recursive
Making all in lib
make all-am
depbase=`echo stpncpy.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -I. -O2 -DDEFAULT_HASH_MD5 -MT stpncpy.o -MD -MP -MF $depbase.Tpo -c -o stpncpy.o stpncpy.c &&\
mv -f $depbase.Tpo $depbase.Po
stpncpy.c:33: error: expected declaration specifiers or '...' before numeric constant
stpncpy.c:33: error: expected ')' before '!=' token
stpncpy.c:33: error: expected ')' before '?' token
make[3]: *** [stpncpy.o] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
I have not been able to find anything every helpful on the internet. I am not an experienced developer and haven't a clue what is wrong. I have had previous versions of XCode on my computer (the old /Developer directory still exists). I don't really know where to go from here. Does anybody have some suggestions I can try?
Thanks

In file : ./lib/stpncpy.c
Change:
__stpncpy (char *dest, const char *src, size_t n)
to:
__stpcpy (char *dest, const char *src, size_t n)

If you've installed MacPorts then why not install the MacPorts version?
$ sudo port install dc3dd
Job done.

Related

gRPC fails when building from source

I'm doing a project for school and we have to install gRPC and protocol buffer dependencies for c++. I have been following the build instructions here https://github.com/grpc/grpc/blob/master/BUILDING.md
I am building on Ubuntu 19 and when I run make from the root grpc/ I get the below error.
src/cpp/common/channel_filter.cc: In member function ‘grpc_linked_mdelem* grpc::MetadataBatch::AddMetadata(const string&, const string&)’:
src/cpp/common/channel_filter.cc:33:48: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘grpc_linked_mdelem’ {aka ‘struct grpc_linked_mdelem’}; use assignment or value-initialization instead [-Werror=class-memaccess]
memset(storage, 0, sizeof(grpc_linked_mdelem));
^
In file included from ./src/core/lib/transport/transport.h:34,
from ./src/core/lib/channel/channel_stack.h:48,
from src/cpp/common/channel_filter.cc:21:
./src/core/lib/transport/metadata_batch.h:33:16: note: ‘grpc_linked_mdelem’ {aka ‘struct grpc_linked_mdelem’} declared here
typedef struct grpc_linked_mdelem {
^~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make: *** [Makefile:2926: /home/n0auth/Project3/grpc/objs/opt/src/cpp/common/channel_filter.o] Error 1
My protoc version
libprotoc 3.0.0
My gcc version
gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0
Looks like downgrading to gcc-7 and g++-7 worked for me.
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70 --slave /usr/bin/g++ g++ /usr/bin/g++-7 --slave /usr/bin/gcov gcov /usr/bin/gcov-7
Then I set gcc-7 with highest priority
sudo update-alternatives --config gcc
Then I tried to make install again and there were no errors.

WKHTMLTOPDF with Patched QT Ubuntu 14.04 Errors during compiling

I am trying to compile the wkhtmltopdf with patched qt using these instructions and when i get to the make && make install it gives me an error has anyone else done this on Ubuntu 14.04? I can't figure out what to do from here.
these are the instructions i am following i know they are not for 14.04 but i hoped they would have worked https://gist.github.com/Zauberfisch/8773593
This is the error i get:
cd src/lib/ && make -f Makefile make[1]: Entering directory /temp/wkhtmltopdf/src/lib' rm -f libwkhtmltox.so.0.12.1 libwkhtmltox.so libwkhtmltox.so.0 libwkhtmltox.so.0.12 g++ -Wl,-O1 -Wl,-rpath,/temp/wkqt/lib -shared -Wl,-soname,libwkhtmltox.so.0 -o libwkhtmltox.so.0.12.1 ../../build/loadsettings.o ../../build/multipageloader.o ../../build/tempfile.o ../../build/converter.o ../../build/websettings.o ../../build/reflect.o ../../build/utilities.o ../../build/pdfsettings.o ../../build/pdfconverter.o ../../build/outline.o ../../build/tocstylesheet.o ../../build/imagesettings.o ../../build/imageconverter.o ../../build/pdf_c_bindings.o ../../build/image_c_bindings.o ../../build/moc_multipageloader_p.o ../../build/moc_converter_p.o ../../build/moc_pdfconverter_p.o ../../build/moc_imageconverter_p.o ../../build/moc_pdf_c_bindings_p.o ../../build/moc_image_c_bindings_p.o ../../build/moc_converter.o ../../build/moc_multipageloader.o ../../build/moc_utilities.o ../../build/moc_pdfconverter.o ../../build/moc_imageconverter.o ../../build/qrc_wkhtmltopdf.o -L/temp/wkqt/lib -lQtWebKit -lQtSvg -L/temp/wkqt/lib -L/usr/X11R6/lib -lQtXmlPatterns -lQtGui -lQtNetwork -lQtCore -lpthread /usr/bin/ld: ../../build/qrc_wkhtmltopdf.o: relocation R_X86_64_32 against.rodata' can not be used when making a shared object; recompile with -fPIC ../../build/qrc_wkhtmltopdf.o: error adding symbols: Bad value collect2: error: ld returned 1 exit status make[1]: * [../../bin/libwkhtmltox.so.0.12.1] Error 1 make[1]: Leaving directory `/temp/wkhtmltopdf/src/lib' make: * [sub-src-lib-make_default-ordered] Error 2
I downloaded a binary from their site that already had the QT build and that fixed the issue for me. Thanks!

Rcpp compilation on windows fails (64bit)

I am trying to set up Rcpp on my Windows machine (have not had issues on my unix box).
I have installed R in C:/opt/R/current (a Google search suggested that spaces in installation paths could give trouble), and I have installed Rtools.
I have the simple cpp file:
#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
int timesTwo(int x) {
return x * 2;
}
and an R file:
library(Rcpp)
sourceCpp("cppfile.cpp")
I get the following error:
C:/opt/R/current/etc/x64/Makeconf:196: warning: overriding recipe for target `.m.o' C:/opt/R/current/etc/x64/Makeconf:189: warning: ignoring old recipe for target `.m.o' C:\MINGW3~1\bin\make.exe: Interrupt/Exception caught (code = 0xc0000005, addr = 0x0x750343f9) Warning message: running command 'make -f "C:/opt/R/current/etc/x64/Makeconf" -f "C:/opt/R/current/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_67515.dll" WIN=64 TCLBIN=64 OBJECTS="cppfile.o"' had status 255
Error in sourceCpp("cppfile.cpp") :
Error 1 occurred building shared library.
Any help would be appreciated.
PS: Install e.g. dplyr from github via devtools works fine (and does quite a lot of compiling Rcpp stuff).
UPDATE: I added the Rtools bin dir to PATH, and now I get another error which seems to relate to 32/64bit:
g++ -m64 -I"C:/opt/R/current/include" -DNDEBUG -I"C:/opt/R/current/library/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c cppfile.cpp -o cppfile.o cppfile.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in make: *** [cppfile.o] Error 1 Warning message: running command 'make -f "C:/opt/R/current/etc/x64/Makeconf" -f "C:/opt/R/current/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_41862.dll" WIN=64 TCLBIN=64 OBJECTS="cppfile.o"' had status 2
Error in sourceCpp("cppfile.cpp") :
Error 1 occurred building shared library.
Turned out that I needed to add both the RTools/bin and the Rtools/gcc-x.y.z/bin to PATH. Now things work smoothly.

Cygwin 'make' command

I'm trying to compile a library using a Unix shell. I'm running Cygwin on Windows. The install instructions for the library state:
cd' to the directory containing the package's source code and type
./configure' to configure the package for your system. If you're
using csh' on an old version of System V, you might need to type
sh ./configure' instead to prevent csh' from trying to execute
configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
Type `make' to compile the package.
<... MORE INSTRUCTIONS FOLLOW ...>
So, I've placed the folder containing the library source into my Cygwin directory, cd'ed to the folder, and run ./configure. This all appears to work fine, but the 'make' command produces the following output:
$ make
make all-recursive
make[1]: Entering directory `/liblo-0.26'
Making all in src
make[2]: Entering directory `/liblo-0.26/src'
Making all in .
make[3]: Entering directory `/liblo-0.26/src'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -
Wall -I.. -g -O2 -MT liblo_la-address.lo -MD -MP -MF .deps/liblo_la-address.Tpo
-c -o liblo_la-address.lo `test -f 'address.c' || echo './'`address.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -Wall -I.. -g -O2 -MT liblo_la-a
ddress.lo -MD -MP -MF .deps/liblo_la-address.Tpo -c address.c -DDLL_EXPORT -DPI
C -o .libs/liblo_la-address.o
In file included from lo_types_internal.h:33,
from address.c:37:
../lo/lo_osc_types.h:32:20: stdint.h: No such file or directory
In file included from address.c:37:
lo_types_internal.h:89: field `addr' has incomplete type
lo_types_internal.h:98: confused by earlier errors, bailing out
make[3]: *** [liblo_la-address.lo] Error 1
make[3]: Leaving directory `/liblo-0.26/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/liblo-0.26/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/liblo-0.26'
make: *** [all] Error 2
What am I doing wrong? Happy to provide more info - but I'm new to Unix shell (as you can probably tell...)
The error is that the header file stdint.h is not found.
stdint.h is a new header, standardized in C99 (The version published in 1999 of the C standard.) It could be that your UNIX does not have it. But cygwin should be recent and have it.
Does your cygwin installation have the C library header files installed?

XCode 4 Unimotion

I use Xcode 4, and I currently dont have any iDevice right now to be able to test accelerometer in my application, so I googled for a while and find util named "unimotion". read me file for Unimotion says: "A Makefile is included so all you have to do is cd to the 'unimotion' directory and type 'make'." So I tried, but terminal give me a message
ls: /Developer/SDKs: No such file or directory cc -Wall -Os -g
-isysroot /Developer/SDKs/ -arch i386 -arch ppc -fconstant-cfstrings -c -o unimotion.o unimotion.c clang: warning: not using the clang compiler for the 'powerpc' architecture unimotion.c:72:10: fatal
error: 'IOKit/IOKitLib.h' file not found
include IOKit/IOKitLib.h>
1 error generated. make[1]: * [unimotion.o] Error 1 make: * [sub-unimotion] Error 2
again and again.
So, what am I doing wrong?
Thanks.
Rewrite all occurrences of /Developer/SDKs/ in the 3 Makefiles (calibrate/Makefile, motion/Makefile and unimotion/Makefile) with
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
that should help you. If you're using Xcode 4, you'll probably get further error also
llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
as the -arch ppc is not supported there anymore. Just delete every single occurrence of -arch ppc in Makefiles, and it will work.

Resources