Facing following error in makefile
Makefile:54: *** multiple target patterns. Stop.
Full source code of makefile as below
MINGW_HOME ?= C:/mingw
PRODUCTNAME ?= Jitsi
COMPANYNAME ?= jitsi.org
PRODUCTBUILDVERSION ?= 1.0.0.0
PRODUCTBUILDVERSION_COMMA ?= 1,0,0,0
TARGET_BASENAME ?= run
TARGET_DIR ?= ../../../../release/windows/tmp
ifeq ($(wildcard /bin/cygpath.*),/bin/cygpath.exe)
target.dir := $(shell cygpath --mixed "$(TARGET_DIR)")
cygwin.target.dir := $(shell cygpath --unix "$(TARGET_DIR)")
else
target.dir := $(TARGET_DIR)
cygwin.target.dir := $(TARGET_DIR)
endif
CC = $(MINGW_HOME)/bin/gcc.exe
CPPFLAGS := $(CPPFLAGS) \
-Wall -Wreturn-type \
-DPSAPI_VERSION=1 \
-DWINVER=0x0502 -D_WIN32_WINNT=0x0502 \
-I$(target.dir) \
-I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/win32"
LDFLAGS = -mwindows
LIBS = -ladvapi32 -lpsapi
MACHINE = $(shell $(CC) -dumpmachine)
WINDRES = $(MINGW_HOME)/bin/windres.exe
ifneq ("x$(MACHINE)","x")
ifeq ($(wildcard $(MINGW_HOME)/bin/$(MACHINE)-windres.*),$(MINGW_HOME)/bin/$(MACHINE)-windres.exe)
WINDRES = $(MINGW_HOME)/bin/$(MACHINE)-windres.exe
endif
endif
$(cygwin.target.dir)/$(TARGET_BASENAME).exe: $(cygwin.target.dir)/config.h registry.c run.c $(cygwin.target.dir)/run.res ../setup/nls.c
**$(CC) $(CPPFLAGS) registry.c run.c $(target.dir)/run.res ../setup/nls.c $(LDFLAGS) -o $(target.dir)/$(TARGET_BASENAME).exe $(LIBS)**
-$(MINGW_HOME)/$(MACHINE)/bin/strip.exe $(target.dir)/$(TARGET_BASENAME).exe
.PHONY: $(cygwin.target.dir)/config.h
$(cygwin.target.dir)/config.h:
-rm.exe -f ../../../../resources/install/windows/config.h
echo #define PRODUCTNAME "$(PRODUCTNAME)" > $(cygwin.target.dir)/config.h
echo #define COMPANYNAME "$(COMPANYNAME)" >> $(cygwin.target.dir)/config.h
echo #define PRODUCTBUILDVERSION "$(PRODUCTBUILDVERSION)" >> $(cygwin.target.dir)/config.h
echo #define PRODUCTBUILDVERSION_COMMA $(PRODUCTBUILDVERSION_COMMA) >> $(cygwin.target.dir)/config.h
echo #define TARGET_BASENAME "$(TARGET_BASENAME)" >> $(cygwin.target.dir)/config.h
echo #define TARGET_BASENAME_EXE "$(TARGET_BASENAME).exe" >> $(cygwin.target.dir)/config.h
$(cygwin.target.dir)/run.res: $(cygwin.target.dir)/config.h run.rc
$(WINDRES) -I../../../../resources/install/windows -I$(target.dir) run.rc -O coff -o $(target.dir)/run.res
and the line number 54 is given below.
$(CC) $(CPPFLAGS) registry.c run.c $(target.dir)/run.res ../setup/nls.c $(LDFLAGS) -o $(target.dir)/$(TARGET_BASENAME).exe $(LIBS)
what could be the possible cause for this.
Actually Had a silly mistake instead of Tab space there was spaces which was causing an issue.
I had this happen because I had a : in a filename.
Specifically, I had this crap
./lib/libwww-perl-5.837/share/man/man3/HTTP::Daemon.3pm
./lib/libwww-perl-5.837/share/man/man3/HTTP::Date.3pm
./lib/libwww-perl-5.837/share/man/man3/HTTP::Headers.3pm
./lib/libwww-perl-5.837/share/man/man3/HTTP::Headers::Util.3pm
./lib/libwww-perl-5.837/share/man/man3/HTTP::Message.3pm
./lib/libwww-perl-5.837/share/man/man3/HTTP::Negotiate.3pm
./lib/libwww-perl-5.837/share/man/man3/HTTP::Request.3pm
./lib/libwww-perl-5.837/share/man/man3/HTTP::Request::Common.3pm
./lib/libwww-perl-5.837/share/man/man3/HTTP::Response.3pm
./lib/libwww-perl-5.837/share/man/man3/HTTP::Status.3pm
./lib/libwww-perl-5.837/share/man/man3/LWP::Authen::Ntlm.3pm
./lib/libwww-perl-5.837/share/man/man3/LWP::ConnCache.3pm
./lib/libwww-perl-5.837/share/man/man3/LWP::Debug.3pm
./lib/libwww-perl-5.837/share/man/man3/LWP::MediaTypes.3pm
./lib/libwww-perl-5.837/share/man/man3/LWP::MemberMixin.3pm
./lib/libwww-perl-5.837/share/man/man3/LWP::Protocol.3pm
./lib/libwww-perl-5.837/share/man/man3/LWP::RobotUA.3pm
./lib/libwww-perl-5.837/share/man/man3/LWP::Simple.3pm
./lib/libwww-perl-5.837/share/man/man3/LWP::UserAgent.3pm
./lib/libwww-perl-5.837/share/man/man3/Net::HTTP.3pm
Related
When I try to compile my .c file in AndroidStudio with NDK I get error:
FAILED: C:\AndroidSDK\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang.exe --target=mips64el-none-linux-android --gcc-toolchain=C:/AndroidSDK/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/windows-x86_64 --sysroot=C:/AndroidSDK/ndk-bundle/platforms/android-21/arch-mips64 -Dnative_lib_EXPORTS -I/src/main/cpp/include -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -O0 -fno-limit-debug-info -O0 -fno-limit-debug-info -fPIC -MD -MT CMakeFiles/native-lib.dir/src/main/cpp/src/file.c.o -MF
And below
#define EcCurveFromBytes EcjaKCurveFromBytes /src/main/cpp/include\Crypto/Core/Algorithm/ecja_curve_select.h:76:9: note: previous definition is here #define EcCurveFromBytes EcjaMCurveFromBytes
I just try to use #if #elif preprocessor. How can I fix it?
#if (GFP_IMPL == GFP_IMPL_G)
#define EcCurveFromBytes EcjaGCurveFromBytes
#elif (GFP_IMPL == GFP_IMPL_K)
#define EcCurveFromBytes EcjaKCurveFromBytes
Stacktrace:
In file included from C:\Users\srgev\AndroidStudioProjects\MyApplication4\app\src\main\cpp\src\Crypto\Core\Bign.c:294:
../../../../src/main/cpp/include\Crypto/Core/Bign_c_impl.h:7:8: error: redefinition of 'BignLoadDefaultParameters'
bool_t BignLoadDefaultParameters( EcCurveEx ex, uint64 *pseed, bitsiz_t L )
^
../../../../src/main/cpp/include\Crypto/Core/Bign_c_impl.h:7:8: note: previous definition is here
bool_t BignLoadDefaultParameters( EcCurveEx ex, uint64 *pseed, bitsiz_t L )
First time I'm doing an hook like this..
I need a pre-commit hook that scan all the java classes to commit, it should check for the presence of some character into the class and avoid the commit if found some of them, chars like † or ¥ and so on, i think a good way to make this dynamically change could be put all these invalid chars into a plan file in order to change it easily if we need to...
I'm starting from a simple hook that i wrote long time ago..
Now the BIG problem is getting the location of the working copy files..
The one I should scan the content.
I tried many svnlook commands, but I'm really unable to catch this information into the pre-commit hook....
Getting a lot of information but not the local path of the file. I'm using this to scan for content...
OUTPUT="$($SVNLOOK changed -t $TXN $REPOS)"
echo $SVNLOOK changed -t $TXN $REPOS 1>&2
echo "$BASEDIR" 1>&2
echo "${OUTPUT}" 1>&2
echo "$TXN $REPOS" 1>&2
Maybe it is my approach that is wrong?
Thanks a lot!
UPDATED
Thanks "CaffeineAddiction", you know it is always a "BIG QUESTION" when you do something for the first time.
In reality, the real issue in the end, after one day of attempts was another one, a SVN Bug related to the client char coding:
Error output could not be translated from the native locale to UTF-8
Now also this last issue is solved and the script works as well, you can see it below, it just need to be beautified, by the way thanks for yours, i'll get some ideas from yours:
REPOS="$1"
TXN="$2"
SVNLOOK=/usr/bin/svnlook
OUTPUT="$($SVNLOOK changed -t $TXN $REPOS | awk '{print $2}')"
for LINE in $OUTPUT
do
FILE=`echo $LINE`
MESSAGE=`$SVNLOOK cat -t "$TXN" "$REPOS" "${FILE}"`
echo "File is: $FILE" 1>&2
echo "${MESSAGE}" > /tmp/app.txt
grep -P -n '[\x80-\xFF]' /tmp/app.txt | cut -f1 -d: 1>&2
done
This is not a full answer, but it might be enough to get you headed in the right direction. A while back I was asked to run gjslint against javascript files before allowing them to be checked into SVN. Here is the pre-hook I used for the task:
#!/bin/sh
SVNLOOK=/usr/bin/svnlook
GJSLINT=/usr/local/bin/gjslint
ECHO=$(which echo)
GREP=$(which grep)
SED=$(which sed)
## Used for Debug
#MYRUNLOG=/run/svn-pre-commit/pre-commit.log
#touch $MYRUNLOG
#echo "" > $MYRUNLOG
MYTEMPJS=/run/svn-pre-commit/temp.js
touch $MYTEMPJS
echo "" > $MYTEMPJS
MYTEMPLOG=/run/svn-pre-commit/gjslint.log
touch $MYTEMPLOG
echo "" > $MYTEMPLOG
REPOS="$1"
TXN="$2"
FILES_CHANGED=`$SVNLOOK changed -t$TXN $REPOS | $SED -e "s/^....//g"`
LINTERROR=0
for FILE in $FILES_CHANGED
do
if $ECHO $FILE | $GREP "\.js$"
then
if ! $ECHO "$REPOS/$FILE" | $GREP "/paweb5/\|/pamc/"; then exit 0; fi
if $ECHO "$REPOS/$FILE" | $GREP "/doc/"; then exit 0; fi
if $ECHO "$REPOS/$FILE" | $GREP "/docs/"; then exit 0; fi
$SVNLOOK cat -t$TXN $REPOS $FILE > $MYTEMPJS
$ECHO "$REPO/$FILE" >> $MYTEMPLOG
$GJSLINT --strict --disable 0001 $MYTEMPJS >> $MYTEMPLOG
GJSL_ERROR_CODE=$?
if [ $GJSL_ERROR_CODE != 0 ]
then
LINTERROR=1
fi
$ECHO "~~~" >> $MYTEMPLOG
fi
done
if [ $LINTERROR != 0 ]
then
echo "..........................................................................." >&2
while read line; do
if $ECHO $line | $GREP "Line\|no errors\|new errors\|paweb5\|~~~"
then
echo $line >&2
fi
done < $MYTEMPLOG
echo "..........................................................................." >&2
exit 1
fi
# If we got here, nothing is wrong.
exit 0
I believe the answer to your "BIG problem" getting the location of the working copy files might lie within $SVNLOOK cat -t$TXN $REPOS $FILE > $MYTEMPJS
If you have questions about the script feel free to ask
I'm trying to link a library in a JNI project I have. I'm running into a strange bug where the console output tells me that there was a "symbol not found for x86 64 architecture". I'm kinda stumped on what could be going wrong. There are other classes but they're way too many to put here. Here's my code:
EDIT: I'll include the entire console debug log. It doesn't mention which symbol is the one in question.
EDIT 2: I fixed a static variable that was a problem, but it's still giving an error. Updated the code to reflect changes
Console Debug Log:
14:24:05 **** Build of configuration Debug for project HPA* Program ****
make all
cc -v -c -stdlib=libstdc++ -fPIC -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/ HPAProgram.c++ -o libhpaprogram.o
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.9.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name HPAProgram.c++ -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 224.1 -v -coverage-file "/Users/zalbhathena/Documents/workspace/Thesis-Test-Application/HPA* Program/jni/libhpaprogram.o" -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0 -I /System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/ -stdlib=libstdc++ -fdeprecated-macro -fdebug-compilation-dir "/Users/zalbhathena/Documents/workspace/Thesis-Test-Application/HPA* Program/jni" -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.9.0 -fobjc-dispatch-method=mixed -fobjc-default-synthesize-properties -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o libhpaprogram.o -x c++ HPAProgram.c++
clang -cc1 version 5.0 based upon LLVM 3.3svn default target x86_64-apple-darwin13.0.0
ignoring nonexistent directory "/usr/include/c++/4.2.1/i686-apple-darwin10/x86_64"
ignoring nonexistent directory "/usr/include/c++/4.0.0"
ignoring nonexistent directory "/usr/include/c++/4.0.0/i686-apple-darwin8/"
ignoring nonexistent directory "/usr/include/c++/4.0.0/backward"
ignoring nonexistent directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers
/usr/include/c++/4.2.1
/usr/include/c++/4.2.1/backward
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/include
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
libtool -dynamic -lSystem libhpaprogram.o -o libhpaprogram.dylib
ld: warning: -macosx_version_min not specified, assuming 10.8
Undefined symbols for architecture x86_64:
"__Z11create_dcdtv", referenced from:
_Java_HPAProgram_sayHello in libhpaprogram.o
ld: symbol(s) not found for architecture x86_64
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: internal link edit command failed
make: *** [libhpaprogram.dylib] Error 1
14:24:05 Build Finished (took 162ms)
HPAProgram.c++
#include <stdio.h>
#include "HPAProgram.h"
#include "DCDTWrapper.h"
extern void create_dcdt();
JNIEXPORT void JNICALL Java_HPAProgram_sayHello (JNIEnv *env, jobject obj) {
printf("Hello World!\n");
create_dcdt();
}
DCDTWrapper.h
# include "DCDTsrc/se_dcdt.h"
# include "DCDTsrc/gs_polygon.h"
# include <stdlib.h>
void create_dcdt ();
DCDTWrapper.c++
# define END 12345.6
# define FIRST_EXAMPLE Example1
//# include "DCDTsrc/se_dcdt.h"
//# include "DCDTsrc/gs_polygon.h"
//# include <stdlib.h>
# include "DCDTWrapper.h"
static double Example1[] =
{ -10, -10, 10, -10, 10, 10, -10, 10, END,
1, 1, 7, 3, 3, 8, END,
END };
static const double* CurExample = FIRST_EXAMPLE;
static SeDcdt *TheDcdt;
static GsPolygon CurPath;
static GsPolygon CurChannel;
static float CurX1=0, CurY1=0, CurX2=0, CurY2=0;
static int CurSelection=0; // -2,-1: moving point, >0: moving polygon
void create_dcdt ()
{
const double* data = CurExample;
GsPolygon pol;
// domain:
while ( *data!=END ) { pol.push().set((float)data[0],(float)data[1]); data+=2; }
TheDcdt->init ( pol, 0.00001f );
while ( *++data!=END )
{ pol.size(0);
while ( *data!=END ) { pol.push().set((float)data[0],(float)data[1]); data+=2; }
TheDcdt->insert_polygon ( pol );
}
}
makefile:
# Define a variable for classpath
CLASS_PATH = ../bin
# Define a virtual path for .class in the bin directory
vpath %.class $(CLASS_PATH)
all: libhpaprogram.dylib
# $# matches the target, $< matches the first dependancy
libhpaprogram.dylib:
cc -v -c -stdlib=libstdc++ -fPIC -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/ HPAProgram.c++ -o libhpaprogram.o
libtool -dynamic -lSystem libhpaprogram.o -o libhpaprogram.dylib
HPAProgram.h : HPAProgram.class
javah -classpath $(CLASS_PATH) $*
clean:
rm HPAProgram.h libhpaprogram.o libhpaprogram.dylib
This is your problem:
static void create_dcdt ();
When you declare a global object static in a header file, every single translation unit (ie: cpp file) that includes it will want to create their own version of that object.
You probably want to qualify create_dcdt() with extern:
extern void create_dcdt();
Then in the file DCDTWrapper.c++ remove the static qualifier.
This will tell the compiler to allow all versions of the undefined object to be resolved at link time, to a single version that lives in one cpp file.
(the extern keyword is probably optional but you certainly do not want to use static here)
The second part of your problem is that you are not including the DCDTWrapper.c++ file in your build project.
Modify your makefile like this:
libhpaprogram.dylib:
cc -v -c -stdlib=libstdc++ -fPIC -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/ HPAProgram.c++ -o libhpaprogram.o
cc -v -c -stdlib=libstdc++ -fPIC -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/ DCDTWrapper.c++ -o DCDTWrapper.o
libtool -dynamic -lSystem libhpaprogram.o DCDTWrapper.o -o libhpaprogram.dylib
I fixed my problem, here's the updated makefile:
SRC=DCDTsrc
TGT=obj
INCLUDES=-IDCDTsrc DCDTWrapper.h SearchAlgorithms.h
FLAGS=-stdlib=libstdc++ -std=c++0x -D GS_SYSTEM_RAND_LIBS -lm -fPIC -I/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers/ -v
SOURCES=$(wildcard $(SRC)/*.cpp) DCDTWrapper.cpp SearchAlgorithms.cpp
OBJS=$(addprefix $(TGT)/, $(notdir $(SOURCES:.cpp=.o)))
CC=g++
# Define a variable for classpath
CLASS_PATH = ../bin
# Define a virtual path for .class in the bin directory
vpath %.class $(CLASS_PATH)
$(TGT)/%.o: $(SRC)/%.cpp
$(CC) $(FLAGS) -c $< -o $#
$(TGT)/%.o: %.cpp
$(CC) $(FLAGS) -c $< -o $#
# $# matches the target, $< matches the first dependancy
libsearchalgorithms.dylib: $(OBJS)
libtool -lc -lstdc++ -ldl -macosx_version_min 10.9 -lm -dynamic -lSystem $(OBJS) -o libsearchalgorithms.dylib
SearchAlgorithms.h : SearchAlgorithms.class
javah -classpath $(CLASS_PATH) $*
clean:
rm -rf $(TGT)
mkdir $(TGT)
if [ -a SearchAlgorithms.h ] ; \
then \
rm SearchAlgorithms.h ; \
fi;
if [ -a libsearchalgorithms.o ] ; \
then \
rm libsearchalgorithms.o ; \
fi;
if [ -a libsearchalgorithms.dylib ] ; \
then \
rm libsearchalgorithms.dylib ; \
fi;
all:clean SearchAlgorithms.h libsearchalgorithms.dylib
I wrote a C++ code that compiles in a standard environment. But when I try to translate it towards android shared library, with Swig utility, though I get the source_wrapp.cpp generated, the Android NDK fails to generate the library.
jni/ is the jni subfolder that i created for the purpose (when I remove it -build file for example-, the file is at the choosen project root)
Here is jni/goodComptSolver.h
#include <vector>
#include <string>
#ifndef GOOD_COMPT_SOLVER_H_
#define GOOD_COMPT_SOLVER_H_
class Solutions {
private:
std::vector<std::string> collection;
int maxSize;
public:
Solutions(int size = 5) : maxSize(size) {};
void push_back(const std::string &str);
int size() const;
const std::string& operator[](int index) const; // does not perform index cheching !!!
};
#endif
Here is jni/goodComptSolver.cpp
#include <iostream>
#include "goodComptSolver.h"
using std::cout;
using std::endl;
using std::vector;
using std::string;
void Solutions::push_back(const string &str)
{
if (collection.size() < maxSize)
collection.push_back(str);
}
int Solutions::size() const
{
return collection.size();
}
const string& Solutions::operator[](int index) const
{
return collection[index];
}
Here is jni/goodComptSolver.i
%module goodComptSolver
%rename(bracketOperator) operator[];
%{
#include "goodComptSolver.h"
%}
%include <std_string.i>
%include <std_vector.i>
%template(stringVector) std::vector<std::string>;
%include "goodComptSolver.h"
Here is my build file
swig -c++ -java -package com.loloof64.android_native.good_compt_solver -outdir . -o jni/goodComptSolver_wrap.cpp jni/goodComptSolver.i
echo "-------------------------------------------"
echo "Done with swig"
echo "-------------------------------------------"
ndk-build -B V=1
Here is my jni/Android.mk
# Sets the local path to current dir
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := goodComptSolver
LOCAL_SRC_FILES := goodComptSolver_wrap.cpp goodComptSolver.cpp
LOCAL_CFLAGS := -frtti
include $(BUILD_SHARED_LIBRARY)
Here is jni/Application.mk
APP_ABI := all
APP_STL := gnustl_static
Here is my build output :
$ ./build
-------------------------------------------
Done with swig
-------------------------------------------
rm -f ./libs/armeabi/lib*.so ./libs/armeabi-v7a/lib*.so ./libs/mips/lib*.so ./libs/x86/lib*.so
rm -f ./libs/armeabi/gdbserver ./libs/armeabi-v7a/gdbserver ./libs/mips/gdbserver ./libs/x86/gdbserver
rm -f ./libs/armeabi/gdb.setup ./libs/armeabi-v7a/gdb.setup ./libs/mips/gdb.setup ./libs/x86/gdb.setup
Compile++ thumb : goodComptSolver <= goodComptSolver_wrap.cpp
/home/laurent-bernabe/Programmes/android-ndk-r8e/toolchains/arm-linux-androideabi- 4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -MMD -MP -MF ./obj/local/armeabi- v7a/objs/goodComptSolver/goodComptSolver_wrap.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 - fno-exceptions -fno-rtti -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing - finline-limit=64 -I/home/laurent-bernabe/Programmes/android-ndk-r8e/sources/cxx-stl/gnu- libstdc++/4.6/include -I/home/laurent-bernabe/Programmes/android-ndk-r8e/sources/cxx- stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -Ijni -DANDROID -Wa,--noexecstack -frtti -I/home/laurent-bernabe/Programmes/android-ndk-r8e/platforms/android-3/arch-arm/usr/include -c jni/goodComptSolver_wrap.cpp -o ./obj/local/armeabi- v7a/objs/goodComptSolver/goodComptSolver_wrap.o
jni/goodComptSolver_wrap.cpp: In function 'const std::basic_string<char>& std_vector_Sl_std_string_Sg__get(std::vector<std::basic_string<char> >*, int)':
jni/goodComptSolver_wrap.cpp:231:72: error: exception handling disabled, use - fexceptions to enable
jni/goodComptSolver_wrap.cpp: In function '_jstring* Java_com_loloof64_android_1native_good_1compt_1solver_goodComptSolverJNI_stringVector_1get(J NIEnv*, jclass, jlong, jobject, jint)':
jni/goodComptSolver_wrap.cpp:376:73: error: '_e' was not declared in this scope
jni/goodComptSolver_wrap.cpp: In function 'void Java_com_loloof64_android_1native_good_1compt_1solver_goodComptSolverJNI_stringVector_1set(J NIEnv*, jclass, jlong, jobject, jint, jstring)':
jni/goodComptSolver_wrap.cpp:408:73: error: '_e' was not declared in this scope
make: *** [obj/local/armeabi-v7a/objs/goodComptSolver/goodComptSolver_wrap.o] Error 1
I can't post the generated jniCalls file, because it is at least about 400 lines.
I was inspired by this answer in my attempt : and extended in to a vector of string, instead of a native type. But it seems that i misunderstood something : what ?
My environement :
Ubuntu 13.04 64 bits
gcc 4.7.3
Swig 2.0.10
Android NDK recent
Thanks in advance.
Thanks to Chad comment, and a bit of searching in order to understand why, I solved the issue.
The fact is that vector use C++ exceptions, and in order to make them active, I replace, in the Android.mk, the line
LOCAL_CFLAGS := -frtti
with the line
LOCAL_CFLAGS := -frtti -fexceptions
And this time, I had no compilation error.
I have a lucene index that i build and update using raw lucene indexers. I was wondering if there is a way to force solr to re-read the index without restarting the solr instance. Ive tried the update?commit=true but it doesnt seem to matter. The only way i can be sure solr -re-reads the index is by a total restart, which of course is not ideal in a production environment.
If you are using a multi-core setup, you can just reload that single core. AFAIK, while the core is being reloaded, the requests to that core are queued.
Not sure if there is another better way to do it.
But I wrote this script to perform full or delta imports.
#!/bin/bash
# script to index Solr
# by Felipe Ferreira Sept 2013
TYPE=$1
DATE=`date +%d_%m_%y`
DATEFULL=`date +%H:%M:%S_%d_%m_%y`
LOG="/var/log/solr/solr_import_${TYPE}_${DATE}.log"
LOGTMP="/var/log/solr/solr_status_${DATE}.log"
URL="http://<SERVER>:8080/solr/dataimport?command=status"
pt() {
echo -e $1
echo -e $1 >> $LOG
}
if [ $TYPE == "full" ]; then
pt "$DATEFULL - Starting full import"
URL="http://<SERVER>:8080/solr/dataimport?command=full-import"
# CMD="curl --location --no-buffer --fail --silent --output ${LOG} '${URL}'"
CMD="curl --location --silent --no-buffer '${URL}' >> $LOG"
pt "Executing $CMD"
CMD_E=`eval $CMD`
pt $CMD_E
elif [ $TYPE == "delta" ]; then
pt "$DATEFULL - Starting delta import"
URL="http://<SERVER>:8080/solr/dataimport?command=delta-import"
#CMD="curl --location --no-buffer --fail --silent --output ${LOG} '${URL}'"
CMD="curl --location --silent --no-buffer '${URL}' >> $LOG"
pt "Executing $CMD"
CMD_E=`eval $CMD`
pt $CMD_E
else
pt "ERROR - $TYPE not found, only delta or full,\n Usage: $0 delta/full"
fi
sleep 3
#check status after command
pt "$DATEFULL - Checking $TYPE status"
URL="http://infofish2:9080/solrcadin/cadin/dataimport?command=status"
CMD="curl --location --silent --no-buffer '${URL}' > $LOGTMP"
pt "Executing $CMD"
CMD_E=`eval $CMD`
pt $CMD_E
CHECK=0
CHECK=`grep -c failed $LOGTMP`
if [ $CHECK -eq 0 ]; then
pt "OK - Command $TYPE executed with success!"
exit 0
else
pt "CRITICAL - Command $TYPE failed, solr did not index!"
pt "grep -c failed $LOGTMP"
pt "CHECK $CHECK"
exit 0
fi