clang: error: no such file or directory: '–lJSON' - xcode4.6

I have been struggling with the issue of clang error. I am using 4.6.3 xcode. I have added the lJSON in the
Project-->Build settings --> Other linker flags, if you can see the image here..
I get to see the below error in the xcode:
Settings where the ljason value is being stored
Error generated at the Compile time
Ld build/Distribution-iphoneos/HologicSalesUI-ipad4.app/HologicSalesUI-ipad4 normal armv7
cd /Users/development1/Desktop/Hologic_NEw
setenv IPHONEOS_DEPLOYMENT_TARGET 5.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk -L/Users/development1/Desktop/Hologic_NEw/build/Distribution-iphoneos -Ldist5/JSON-1.1.0.5/Distribution-iphoneos/lib -Ldist5/AMPiPhoneUtilities-1.0.0.7/Distribution-iphoneos/lib -Ldist5/Log4Cocoa-1.0.0.3/Distribution-iphoneos/lib -Ldist5/AMPMessaging-1.1.0.6/Distribution-iphoneos/lib -Ldist5/AMPMessengerBase-1.0.0.7/Distribution-iphoneos/lib -Ldist5/WSMessaging-1.0.0.5/Distribution-iphoneos/lib -F/Users/development1/Desktop/Hologic_NEw/build/Distribution-iphoneos -filelist /Users/development1/Desktop/Hologic_NEw/build/HologicSalesUI-ipad4.build/Distribution-iphoneos/HologicSalesUI-ipad4.build/Objects-normal/armv7/HologicSalesUI-ipad4.LinkFileList -Xlinker -map -Xlinker /Users/development1/Desktop/Hologic_NEw/build/HologicSalesUI-ipad4.build/Distribution-iphoneos/HologicSalesUI-ipad4.build/HologicSalesUI-ipad4-LinkMap-normal-armv7.txt -dead_strip -ObjC -all_load -lAMPMessengerBase -lAMPMessaging -lAMPiPhoneUtilities -lLog4Cocoa_iOS -lWSMessaging "–lJSON" -fobjc-link-runtime -miphoneos-version-min=5.0 -lxml2 -framework CoreData -framework Foundation -framework CoreFoundation -framework SystemConfiguration -lz -weak_framework UIKit -framework QuartzCore -framework Security -framework CoreGraphics -framework AudioToolbox -framework MessageUI -framework MapKit -weak_framework MediaPlayer -framework CFNetwork -framework MobileCoreServices -framework CoreLocation -framework AddressBook -weak_framework CoreTelephony -weak_framework EventKit /Users/development1/Desktop/Hologic_NEw/build/Distribution-iphoneos/libAntenna.4.0.3.8299-ipad4.a -o /Users/development1/Desktop/Hologic_NEw/build/Distribution-iphoneos/HologicSalesUI-ipad4.app/HologicSalesUI-ipad4
clang: error: no such file or directory: '–lJSON'
Honestly, I have no idea on what xcode is trying to do with this. A help greatly appreciated.
Here is the error that is being thrown:

I'm not sure if this is a typo or the problem, but the hyphen you're using for -lJSON isn't the same as all the others, note how it's longer. Try cut and pasting an existing hyphen. Also, do you have the JSON library somewhere on your library path? Did you quote it to make it stand out, if not you should try to find out why it's being quoted.

Related

ld: library not found for

I'm hitting a linker error (compile time, not run time):
ld: library not found for -l:/usr/lib/libobjc.A.dylib
That's just the latest version of the error. I'm trying to link against /usr/lib/libobjc.A.dylib, and I want to hard-code the path; the library is guaranteed to exist at this path on the platform I'm on. And it does:
bhaller#lanois % ls -l /usr/lib/libobjc.A.dylib
-rwxr-xr-x 1 root wheel 859536 Jan 23 08:59 /usr/lib/libobjc.A.dylib
I have tried:
-L/usr/lib/ -llibobjc.A.dylib
-L/usr/lib/ -llibobjc.A
-l/usr/lib/libobjc.A.dylib
-l:/usr/lib/libobjc.A.dylib
In every case I get the same error, that ld couldn't find the library. But it's right there, and I'm giving the complete path to it! What am I missing??
Here's the full invocation, with a bunch of other cruft:
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -headerpad_max_install_names -macosx_version_min 10.10.0 -o QtSLiM.app/Contents/MacOS/QtSLiM -L/Users/bhaller/Desktop/QtSLiM QMAKE/QtSLiM/../core/ -L/Users/bhaller/Desktop/QtSLiM QMAKE/QtSLiM/../eidos/ -L/Users/bhaller/Desktop/QtSLiM QMAKE/QtSLiM/../treerec/tskit/ -L/Users/bhaller/Desktop/QtSLiM QMAKE/QtSLiM/../gsl/ -L/Users/bhaller/Desktop/QtSLiM QMAKE/QtSLiM/../eidos_zlib/ -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -rpath #executable_path/Frameworks -rpath /Users/bhaller/Qt5.9.8/5.9.8/clang_64/lib main.o QtSLiMWindow.o QtSLiMAppDelegate.o QtSLiMWindow_glue.o QtSLiMChromosomeWidget.o QtSLiMExtras.o QtSLiMPopulationTable.o QtSLiMIndividualsWidget.o QtSLiMEidosPrettyprinter.o QtSLiMAbout.o QtSLiMPreferences.o QtSLiMSyntaxHighlighting.o QtSLiMFindRecipe.o QtSLiMHelpWindow.o QtSLiMScriptTextEdit.o QtSLiMEidosConsole.o QtSLiMEidosConsole_glue.o QtSLiMConsoleTextEdit.o QtSLiM_SLiMgui.o QtSLiMTablesDrawer.o QtSLiMFindPanel.o QtSLiMGraphView.o QtSLiMGraphView_FixationTimeHistogram.o QtSLiMGraphView_FrequencySpectra.o QtSLiMGraphView_LossTimeHistogram.o QtSLiMGraphView_PopulationVisualization.o QtSLiMGraphView_FitnessOverTime.o QtSLiMGraphView_FrequencyTrajectory.o QtSLiMHaplotypeManager.o QtSLiMHaplotypeOptions.o QtSLiMHaplotypeProgress.o QtSLiMVariableBrowser.o qrc_buttons.o qrc_icons.o qrc_recipes.o qrc_help.o moc_QtSLiMWindow.o moc_QtSLiMAppDelegate.o moc_QtSLiMChromosomeWidget.o moc_QtSLiMExtras.o moc_QtSLiMPopulationTable.o moc_QtSLiMIndividualsWidget.o moc_QtSLiMAbout.o moc_QtSLiMPreferences.o moc_QtSLiMSyntaxHighlighting.o moc_QtSLiMFindRecipe.o moc_QtSLiMHelpWindow.o moc_QtSLiMScriptTextEdit.o moc_QtSLiMEidosConsole.o moc_QtSLiMConsoleTextEdit.o moc_QtSLiMTablesDrawer.o moc_QtSLiMFindPanel.o moc_QtSLiMGraphView.o moc_QtSLiMGraphView_FixationTimeHistogram.o moc_QtSLiMGraphView_FrequencySpectra.o moc_QtSLiMGraphView_LossTimeHistogram.o moc_QtSLiMGraphView_PopulationVisualization.o moc_QtSLiMGraphView_FitnessOverTime.o moc_QtSLiMGraphView_FrequencyTrajectory.o moc_QtSLiMHaplotypeManager.o moc_QtSLiMHaplotypeOptions.o moc_QtSLiMHaplotypeProgress.o moc_QtSLiMVariableBrowser.o -lcore -leidos -ltskit -lgsl -leidos_zlib -l:/usr/lib/libobjc.A.dylib -framework QtOpenGL -framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.osx.a -F/Users/bhaller/Qt5.9.8/5.9.8/clang_64/lib
ld: library not found for -l:/usr/lib/libobjc.A.dylib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [QtSLiM.app/Contents/MacOS/QtSLiM] Error 1
make: *** [sub-QtSLiM-make_first] Error 2
I feel like I must just be an idiot, but I can't see it. Help?
Your linkage command shows that your linker is the OS X linker. Refer to it's manual
with respect to the -l option:
-lx
This option tells the linker to search for libx.dylib or libx.a in the library search path.
If string x is of the form y.o, then that file is searched for in the same places, but
without prepending lib or appending .a or .dylib to the filename.
This will show you why all of:
-L/usr/lib/ -llibobjc.A.dylib
-L/usr/lib/ -llibobjc.A
-l/usr/lib/libobjc.A.dylib
-l:/usr/lib/libobjc.A.dylib
are wrong. In each of your attempts, where name is whatever you have typed after -l,
the linker will be directed to search for libname.dylib or libname.a. Of course
none of those files - e.g. liblibobjc.A.dylib.dylib,liblibobjc.A.dylib.a - exists
in /usr/lib/ or any of the other specified or default search directories, and
in the third and fourth attempts, libname.(dylib|a) resolves to strings that that
cannot even possibly be unqualified filenames.
Your final variation evidently wants to used -l:name in an attempt to make the linker
search precisely for name ( = /usr/lib/libobjc.A.dylib). However,
-l:name is an option for the GNU Binutils linker, (the default linker in Linux)
and as per the documentation, is not an option for the OS X linker. (Furthermore, that option of the Binutils linker
directs the linker to search in each directory for a file with the exact unqualified name name, which /usr/lib/libobjc.A.dylib
could not be).
To get the linker to locate libobjc.A.dylib in /usr/lib/ you require the option:
-lobjc.A
Consider for example the other -l options in your your linkage command:
-lcore -leidos -ltskit -lgsl -leidos_zlib
Before you try that however, I suggest that you check in /usr/lib for the existence
of a symbolic link:
libobjc -> libobjc.A
This would indicate that libobjc.A is the version of libobjc that your toolchain
is configured to select, and that the linkage option you require is simply:
-lobjc
The search option -L/usr/lib/ is in any case redundant, since /usr/lib/ is a default
linker search directory.

GLUT library problems while compiling OpenGL

I'm trying to compile a sample from a project, the following code is the makefile:
CC = gcc
MACHINE= $(shell uname -s)
#declaration des options du compilateur
#PG_FLAGS = -DOPENGL_1_5
ifeq ($(MACHINE), Darwin)
GL_LDFLAGS = -framework OpenGL -framework GLUT -framework Cocoa -framework
Carbon
else
GL_LDFLAGS = -lopengl32 -lglu32 -lglut
endif
CFLAGS = -Wall
LDFLAGS = -lm $(GL_LDFLAGS)
PROGNAME = palette
HEADERS = image.h
SOURCES = Main.c ppm.c fonctions.c
I tried: "mingw32-make" and i got:
process_begin: CreateProcess(NULL, uname -s, ...) failed.
gcc Main.o ppm.o fonctions.o -lm -lopengl32 -lglu32 -lglut -o palette
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-
w64-mingw32/bin/ld.exe: cannot find -lglut
collect2.exe: error: ld returned 1 exit status
Makefile:25: recipe for target 'palette' failed
mingw32-make: *** [palette] Error
but i have the glut library installed
and i am using windows 10
i have found the solution for this problem
GLUT library have been abandoned with the most recent version 3.7. Also, GLUT's license is incompatible with some software distributions .... so i used freeGLUT insted of it and it works
and there is the link to download it :
https://www.transmissionzero.co.uk/computing/using-glut-with-mingw/
goodluck evryone :)

Glib C : program does not recognize GLIB library

I have a problem with my C program, when I want to compile it. It works on Ubuntu 11.04, but when I move to Ubuntu 13 I get this problem.
I compile with this Makefile:
all:
gcc -D_GNU_SOURCE -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include \
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include/ -lglib-2.0 -D_FILE_OFFSET_BITS=64 \
-D_LARGEFILE_SOURCE -g -Wall -Wextra -std=c99 -lm *.c -o concatener
I get these errors:
undefined reference to « g_str_equal »
undefined reference to « g_str_equal »
undefined reference to « g_array_remove_index »
undefined reference to « g_array_remove_index »
Why does it not recognize these functions? Have I linked to the glib library wrong?
The gcc command looks fine, I cannot see anything obviously wrong, linking with -lglib-2.0 should be what you want1.
What I am guessing is the case is that on your Ubuntu 11.04 system you have the glib development package installed while it is not installed on your 13 system. I think the package name should be libglib2.0-dev.
1
If you want to be a bit more generic you can replace the hardcoded compile and link options with
`pkg-config --cflags glib-2.0`
and
`pkg-config --libs glib-2.0`

Compiling a C program that uses OpenGl in Mac OS X

I am trying to compile a C program for my CS class. I have Command Line tools installed on my Mac, so I probably have OpenGL. The program description was made for Ubuntu and it says for me to compile using:
gcc -Wall -ansi -pedantic -O2 main.o graphic.o imagem.o io.o -o ep2 -lGL -lGLU -lglut
I ran that and it said:
ld: library not found for -lGL
What flags should I use? What do I do?
In MacOS X you're not using libraries to include system level APIs, but Frameworks. The proper command line to compile this program would be
gcc -Wall -ansi -pedantic -O2 \
main.o graphic.o imagem.o io.o \
-o ep2 \
-framework OpenGL -lGLU -lglut
Note that GLU is probably part of the OpenGL framework as well. And it may be required to install GLUT first.
I found you have to use
-framework OpenGL -framework GLUT
Reference

Qt5 Osx Linker Error

I am receiving the following error after this linker command from qmake generated Makefile.
clang++ -headerpad_max_install_names -mmacosx-version-min=10.6 -o bin/Clock tmp/clock.o tmp/config.o tmp/main.o tmp/qrc_resources.o tmp/moc_clock.o -L/Users/foo/Qt5.0.0/5.0.0/clang_64/lib -lQt5Widgets -lQt5Gui -lQt5Core -framework OpenGL -framework AGL
error:
ld: library not found for -lQt5Widgets
I can confirm that the library is not there with that spelling.
However there is a QtWidgets.la as well there is a QtWidgets.framework dir that has a QtWidgets.
In the lib directory none of the files have a Qt5 prefix is there some way of changing Qt so it does not look for it etc.
I understand that I could rename things and move them around but this is a big job remaining all libs to have a Qt5 prefix.

Resources