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

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!

Related

Xcode 7.2 - clang: error: no such file or directory:

I keep trying to run my Xcode project titled 'Simple Calculator' and it keeps giving me the following error,
clang: error: no such file or directory:
'/Users/computerscienceyr1/Desktop/Simple Calculator/Simple
Calculator/ViewController.m'
Here is a screenshot of the whole issue Screenshot.
Each time I create a 'Simple Calculator' Directory, the error extends into: '/Users/computerscienceyr1/Desktop/Simple Calculator/Simple Calculator/Simple Calculator/ViewController.m' and goes on and on.
**UPDATED**
This is what happens when double clicked Screenshot.
Targets> Build Phases> Compile Sources - File exists.
Removed ViewController.m and others again. No changes occurred.
Try this: open the .pbxproj file, search for the file name and delete the rows where it appears, then add the file again to your project.
This post may help you as well.

'warning: directory not found for option' error on build

All of a sudden my app has started giving me an error when I try to build it. This is the error I'm getting:
ld: warning: directory not found for option '-L/Users/user/Documents/Developer/Alton-Towers-Times/build/Debug-iphoneos'
ld: file too small (length=0) file '/Users/user/Library/Developer/Xcode/DerivedData/Mouse_Times_Florida-eqhrhnbxmmkxtahdghmnvehbzbgt/Build/Intermediates/Mouse Times Florida.build/Debug-iphonesimulator/Mouse Times Florida WatchKit Extension.build/Objects-normal/x86_64/SecondInterfaceController.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Only thing I've really done since I last managed to get it to run was changing the bundle IDs and I also changed the app name. I've tried a few things including deleting the derived data, but nothing seems to have helped.
Anyone have any ideas?
I solved this warning removing the following setting: "$(SDKROOT)/Developer/Library/Frameworks"
This options is located in Settings -> Build Settings -> Search Paths -> Framework Search Paths
Setting location
My project continues compiling and working fine, after removing this option.
Veladan answer helped me to sort out that issue on an iOS8 project freshly migrated to iOS9.
This worked fine on the main target of my project, but the warning lasted on the unit tests target, so in the end I edited directly the project.pbxproj file and modified the entries :
FRAMEWORK_SEARCH_PATHS = (
"$(SDKROOT)/Developer/Library/Frameworks",
"$(inherited)",
);
to :
FRAMEWORK_SEARCH_PATHS = "";

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++ in MonoDevelop: clang: error: no input files

I have a question that is probably trivial, but I can't see the solution now. I have a .cpp file that I would like to run through MonoDevelop. Unfortunately, instead of a small Bantumi simulation, I only get:
Building Solution: Bantumi (Debug)
Building: Bantumi (Debug)
Performing main compilation...
Precompiling headers
Compiling source to object files
Generating binary "Bantumi" from object files
g++ -o "/Users/myname/Projects/Bantumi/Bantumi/bin/Debug/Bantumi"
clang: error: no input files
Build complete -- 1 error, 0 warnings
---------------------- Done ----------------------
Build: 1 error, 0 warnings
From what I found, most people had this problem when there was no such file in the current directory, or the compiler did not have a valid address. However, my file is exactly where the compiler looks for it, but it still produces an error. Do you know what else could lead to this error message?
Thanks a lot! If this type of question has already been solved, you can just send me a link to it.

Apple Mach-O Librarian Error

I download the cocos2d-x project from our SVN, but an problem happened when I opened it with Xcode, error information is as follows:
/Applications/Xcode .app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: -dynamic not specified the following flags are invalid: -ObjC
/Applications/Xcode .app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lwebp
/Applications/Xcode .app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lwebp is not an object file (not allowed in a library)
Command /Applications/Xcode .app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1
can anyone give me some advice, thank you very much.
[edit]
#trojanfoe, you're right.
sry didn't read the last part. I check my cocos2s-x project and give you a right anwer.
[edit 2]
OK, I tested my project and the empty from github. Where have you downloaded the SVN from?
And what is your Xcode Version?
have you used this repository: get cocos2d-x?
If not, go ahead and clone it, open the build>cocos2d_samples.xcodeproj and select Test cpp iOS > iPhone > iOS 7.0 for example and run the build. This should work at least.

Resources