Lib tool not able to create archive - ios

I am using libBilldesk.a library in my project for payment option.
As I am using TPKeyboarAvoidingScrollView file in my project and also same file exist in libBilldesk.a static library because of which I am getting duplicate symbol error at compile time. So to resolve this issue I am trying to remove TPKeyboarAvoidingScrollView.o file from libBilldesk file.
But I am getting following error message on terminal
error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `o' in: -output
Please help me to resolve this issue.

The correct parameter for the output file is -o instead of -output:
libtool -static -o ../libBilldesk-arm64.a *.o
See manpage of libtoolfor details.

Related

when i build "gomobile bind" a go project with opencv4 ,error come ,how can i solve

Gomobile bind error
The array mean what, Anybody ever had this problem?
go build -tags ios -buildmode=c-archive -o/var/folders/vp/3ztk4jzn3hq35qfmp3qwrfm80000gp/T/gomobile-work135205628/faceTest-arm.a gobind failed: exit status 2
# gocv.io/x/gocv
In file included from calib3d.cpp:1:
In file included from ../../../../../gocv.io/x/gocv/calib3d.h:5:
In file included from /usr/local/Cellar/opencv/4.0.0/include/opencv4/opencv2/opencv.hpp:52:
In file included from /usr/local/Cellar/opencv/4.0.0/include/opencv4/opencv2/core.hpp:52:
/usr/local/Cellar/opencv/4.0.0/include/opencv4/opencv2/core/cvdef.h:659:10:
fatal error: 'array' file not found

Lipo: input file must be a fat file

I'm getting following error:
Extracting arm64 from Alamofire fatal error: lipo: input file
(../myApp.app/Frameworks/Alamofire.framework/Alamofire) must be a fat
file when the -extract option is specified
always when I want to run the app. It doesn't show up when I clean before, but it takes super long time.
This => Lipo Error!! can't open input file is not my case and it doesn't work for me.
Any ideas,
Thank you
In target -> Build Phases -> Run script I had some incompatible script.
I removed it and the app works now!

Library not found for -llib. (clang: error: linker command failed with exit code 1 (use -v to see invocation))

I am working on a project that was previously done and uploaded on app store.When I run this app in Xcode 5.0 it is working fine but when I run this on Xcode Version 5.1.1 (5B1008) I am getting Linker error on both device and simulator.
Error Message- Library not found for -llib. (clang: error: linker command failed with exit code 1 (use -v to see invocation)).
I have searched a lot but I didn't get any thread about Library not found for -llib error. Is there anything I have to change in build settings to resolve this?
Look at the linker command line in detail for the -L options being used:
Then use Terminal or Finder to see if your libXXX.a file exists in those directories. If the library exists elsewhere then you need to configure your Library Search Paths:
However there several details which you have not provided in your question when using a library within an app:
Is the library built as part of the Xcode project/workspace (as in the first image)?
Is the library supplied by a third-party with binary (.a) and header files (as in the second image)?
TL;DR: I ran make in the wrong directory so the paths were messed up.
Problem:
>make
linking ../build/release/yubikey-personalization-gui
/usr/x86_64-suse-linux/bin/ld: cannot find -llib
...
I ran into this when compiling the Yubikey Personalisation Tool. I tracked down the -llib call in my Makefile which looked like this:
...
LINK = #echo linking $# && g++
...
LIBS = $(SUBLIBS) -L/usr/lib64 -L../lib/release -llib -lyubikey -lykpers-1 -lQtGui -L/usr/lib64 -L/usr/X11R6/lib -lQtCore -lpthread
...
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
So it was setting a variable called LINK which would print "linking" and then call g++, which is the compiler.
Then it set the var LIBS which would hold the ominous -llib.
Then it composes and runs the command $(LINK) ... $(LIBS).
Which runs g++ with the parameter -llib.
And what does that do? Turns out -l<something> is telling the compiler to use the something-library. So it asks for the library called lib here. Which is strangely generic. I figured out that the sources came with a directory called lib/, which was at ../lib.
So starting make from a directory higher up fixed it.
You should remove libstdc++ from other linker flags in your xcode project
https://stackoverflow.com/a/53103383/1344237

c lang error in xcode 5.0 after adding "fno-objc-arc" for some classes

I am working on Xcode 5.0,i copied JSON library files in to my project which are built with non arc, so i added complier flag "fno-objc-arc"for those JSON library compiler sources.
After doing this i am getting apple LLVM 5.o error.
clang: error: no such file or directory: 'fno-objc-arc'
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Pleas help me to resolve this error.
If that's a command line option, and it is, you need to prefix it with a hyphen, such as with:
clang -fno-objc-arc ...
If you just use fno-objc-arc, it's going to think it's a file name you want compiled, and complain bitterly that no such file exists, as indeed it seems to be doing with the no such file or directory: 'fno-objc-arc' error.
Please note that there is no new line character after -fno-objc-arc. You can be assured by entering -fno-objc-arc and click somewhere around instead of hitting enter/return key.
This got my problem fixed!

compiling stasm for mac

I'm try to to build the stasm library on my mac and hopefully port it to the iphone.
stasm download: http://www.milbo.users.sonic.net/stasm/download.html
I am using the makefile for linux provided.
after some changes to header include paths for libjpeg and opencv, I am stuck with this error
g++ -c ../stasm/violajones.cpp -O3 -Wall -pedantic -I/home/john/OpenCV-2.1.0/include/opencv -I../gsl -I../gsl/gsl -I../image -I../jpeg -I../mat -I../rowley -I../stasm -I../tasm
In file included from ../stasm/violajones.cpp:24:
/opt/local/include/opencv/cv.h:63:33: error: opencv2/core/core_c.h: No such file or directory
/opt/local/include/opencv/cv.h:64:33: error: opencv2/core/core.hpp: No such file or directory
/opt/local/include/opencv/cv.h:65:39: error: opencv2/imgproc/imgproc_c.h: No such file or directory
/opt/local/include/opencv/cv.h:66:39: error: opencv2/imgproc/imgproc.hpp: No such file or directory
/opt/local/include/opencv/cv.h:67:38: error: opencv2/video/tracking.hpp: No such file or directory
/opt/local/include/opencv/cv.h:68:45: error: opencv2/features2d/features2d.hpp: No such file or directory
/opt/local/include/opencv/cv.h:69:35: error: opencv2/flann/flann.hpp: No such file or directory
/opt/local/include/opencv/cv.h:70:39: error: opencv2/calib3d/calib3d.hpp: No such file or directory
/opt/local/include/opencv/cv.h:71:43: error: opencv2/objdetect/objdetect.hpp: No such file or directory
/opt/local/include/opencv/cv.h:72:37: error: opencv2/legacy/compat.hpp: No such file or directory
/opt/local/include/opencv/cv.h:79:37: error: opencv2/core/internal.hpp: No such file or directory In file included
from ../stasm/violajones.cpp:25:
/opt/local/include/opencv/highgui.h:47:39: error: opencv2/highgui/highgui_c.h: No such file or directory
/opt/local/include/opencv/highgui.h:48:39: error: opencv2/highgui/highgui.hpp: No such file or directory
the original makefile is uploaded here https://github.com/tsaizhenling/stuff/blob/master/makefile
i have tried changing the directory as trojanfoe suggested
but still same error :(
I have opencv and opencv2 residing in /opt/local/include/
Update:
tried J-16 SDiZ's suggestion and this brought me forward. I had to remove the pedantic flag but i'm still stuck with the following error
g++ -c ../stasm/tab.cpp -O3 -Wall -I/opt/local/include/opencv
-I/opt/local/include -I../gsl -I../gsl/gsl -I../image -I../jpeg -I../mat -I../rowley -I../stasm -I../tasm make: * No rule to make target -lm', needed bystasm'. Stop.
makefile is updated
Update:
Finally got everything fixed with help from J-16 SDiZ.
had to update the linker flags because opencv changed the library names
makefile is updated in case anyone needs it
Change
INCL=\
-I$(OPENCV_HOME)/include/opencv\
-I../gsl\
to
INCL=\
-I$(OPENCV_HOME)/include/opencv\
-I$(OPENCV_HOME)/include \
-I../gsl\
And you should not use ${LIB} in the dependency.
change
something: xxxxxx $(LIBS) $(OBJ)
to
something: xxxxxx $(OBJ)
I think you should learn how Makefile works, this is a makefile problem.
There are Mac/Linux build scripts for Stasm here:
https://github.com/juan-cardelino/stasm
You can build for iOS easily using this:
https://code.google.com/p/ios-cmake/wiki/HowTo

Resources