library not found for.....? - c++

i added new framework(3rd party) and build.
Unfortunately, since the execution was not.
How do I solve this problem?
The whole four nights were spent.:(
Ld /Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Products/Distribution-iphoneos/iBaseballManager.app/iBaseballManager normal armv7s
cd /DevLibs/BaseballManager_KOR/iBaseballManager
setenv IPHONEOS_DEPLOYMENT_TARGET 6.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 armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk -L/Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Products/Distribution-iphoneos -L/DevLibs/BaseballManager_KOR/iBaseballManager/Classes/BaseballManager/kakaoUtil/kakao-ios-sdk -F/Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Products/Distribution-iphoneos -filelist /Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Intermediates/iBaseballManager.build/Distribution-iphoneos/iBaseballManager_Device.build/Objects-normal/armv7s/iBaseballManager.LinkFileList -dead_strip -fobjc-link-runtime -miphoneos-version-min=6.0 -framework StoreKit -framework SystemConfiguration -framework CoreData -weak_framework AdSupport -framework MediaPlayer -framework CoreTelephony -framework Security -lzlib -lstdc++ -lCxImage -lj2k -ljasper -lkakao-ios-sdk-i386-armv7-armv7s -ljbig -ljpeg -lpng -ltiff -framework AudioToolbox -framework AVFoundation -framework Foundation -framework UIKit -framework CoreGraphics -framework OpenAL -framework OpenGLES -framework QuartzCore -liClet -Xlinker -dependency_info -Xlinker /Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Intermediates/iBaseballManager.build/Distribution-iphoneos/iBaseballManager_Device.build/Objects-normal/armv7s/iBaseballManager_dependency_info.dat -o /Users/hansehee/Library/Developer/Xcode/DerivedData/iBaseballManager-dbrtdyfdzzunktexlyibuzjbftoy/Build/Products/Distribution-iphoneos/iBaseballManager.app/iBaseballManager
ld: library not found for -lzlib
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Remove the reference to the library and add it again, it will solve the problem.

Use xcworkspace it will solve your problem.
I also faced same once I install cocoa pods; Close and launch with xcworkspace again will solve your problem.

Make sure you have added the necessary search path for your library in Library Search Paths in Build Settings.
There should be something like:
${SOURCE_ROOT}/Framework/Classes
For .a files you need to set Target Dependencies in Build Phases in section.
Just click "+" and add your .a file there.

Had the same problem and none of these answers fix it for me.
Problem was Pod project in workspace had the following config:
Build Active Architecture Only: YES
For that reason, when I wanted to build for i386 (Simulator), XCode did not build Pods projects, so it could not meet dependencies. As soon as I changed it to NO it started working

If anyone is here looking specifically for the "library not found for -lPods" error, this was solved by opening the workspace instead of the xcodeproject. Searching google for library not found for -lPods without quotes turns this SO post as the first result, whereas if you wrap the search in quotes you'll get a post with the answer I just gave.

I changed -all_load to -force_load

In Xcode goto select your project
Build Settings -> Search Paths -> Library Search Paths set the path with /usr/local/lib
note : make sure that you have added dylib at frameworks

OS X 10.11 Xcode7.0.1
my case:
library not found for -lPods-BlocksKit
error:linker command failed with exit code 1(use -v to see invocation)
I delete all pod related content, add "$(inherited)" then fix it.
Other Linker Flags image

my case: use cocoapods, open xcworkspace, and meet "library not found for -lPods-AFNetworking" error.
my solution: Preference -> Location -> Derived Data, click "Advanced" button -> choose 'shared Folder'. (when meet error, the original location is Legacy).

None of the above solutions worked for me, so I downloaded the missing library:
https://github.com/danielctull-forks/GoogleAnalytics-SDK-iOS

7.3.1 Pods 1.0.0
Had same stuff today, after cocoapods update from 0.39.0 to 1.0.0.
Had an error : "ld: library not found -lPods".
I've got linked two "Pod" libs, accidentally. One was lPods, and other was lPods-ProjectName. I deleted "libPods.a: from Project>General>Linked Frameworks and Libraries
AND! I changed Pods>Build Active Build Architecture to NO, of course.
And it worked.

Related

iOS Framework: image not found

When trying to embed a shared Framework generated from CMake into an Xcode iOS app, I encounter the following issue:
dyld: Library not loaded: /Users/jones/Documents/project/build/ios/foo.framework/foo
Referenced from: /var/Containers/Bundle/Application//myapp.app/myapp
Reason: image not found
It seems like it has an incorrect "dylib id", but I am not sure what that means exactly. Note that my framework appears in the "Frameworks" folder of the app (the built "Product" that is installed on the phone).
Checking my app with otool -L, I see:
myapp:
/Users/name/Documents/project/build/ios/foo.framework/foo
/System/Library/Frameworks/Foundation.framework/Foundation
/usr/lib/libobjc.A.dylib
...
Which seems to show that the path to my framework is wrong in the app. But I can't seem to change it from Xcode.
On the Apple dev forum, somebody mentions changing DYLIB_INSTALL_NAME_BASE to #rpath from Build Settings -> Dynamic Library Install Name Base, but it doesn't solve my problem.
The linker log coming from Xcode looks like so (maybe easier to read here:
Ld /Users/jones/Library/Developer/Xcode/DerivedData/myapp-gngqigiisiapqjflqkjjadvdbneu/Build/Products/Debug-iphoneos/myapp.app/myapp normal arm64
cd /Users/jones/Documents/project/ios-playground/myapp
export IPHONEOS_DEPLOYMENT_TARGET=11.2
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk -L/Users/jones/Library/Developer/Xcode/DerivedData/myapp-gngqigiisiapqjflqkjjadvdbneu/Build/Products/Debug-iphoneos -F/Users/jones/Library/Developer/Xcode/DerivedData/myapp-gngqigiisiapqjflqkjjadvdbneu/Build/Products/Debug-iphoneos -F/Users/jones/Documents/project/ios-playground/myapp -F/Users/jones/Documents/project/ios-playground/myapp/Frameworks -filelist /Users/jones/Library/Developer/Xcode/DerivedData/myapp-gngqigiisiapqjflqkjjadvdbneu/Build/Intermediates.noindex/myapp.build/Debug-iphoneos/myapp.build/Objects-normal/arm64/myapp.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -miphoneos-version-min=11.2 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/jones/Library/Developer/Xcode/DerivedData/myapp-gngqigiisiapqjflqkjjadvdbneu/Build/Intermediates.noindex/myapp.build/Debug-iphoneos/myapp.build/Objects-normal/arm64/myapp_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -stdlib=libc++ -fobjc-link-runtime -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/jones/Library/Developer/Xcode/DerivedData/myapp-gngqigiisiapqjflqkjjadvdbneu/Build/Intermediates.noindex/myapp.build/Debug-iphoneos/myapp.build/Objects-normal/arm64/myapp.swiftmodule -framework foo -Xlinker -dependency_info -Xlinker /Users/jones/Library/Developer/Xcode/DerivedData/myapp-gngqigiisiapqjflqkjjadvdbneu/Build/Intermediates.noindex/myapp.build/Debug-iphoneos/myapp.build/Objects-normal/arm64/myapp_dependency_info.dat -o /Users/jones/Library/Developer/Xcode/DerivedData/myapp-gngqigiisiapqjflqkjjadvdbneu/Build/Products/Debug-iphoneos/myapp.app/myapp
How can I fix this?
There is actually a way to set the "install_name_dir" in CMake:
set_target_properties(dynamicFramework PROPERTIES
...
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_NAME_DIR #rpath
)

GCC 5.4 linker error after upgrading to Xcode 8

Recently I updated to XCode Version 8.0 (8A218a) on El Capitan (OS X 10.11 using Macports 2.3.4), and ever since, I have been getting the following link error when I try to compile my project inside Qt Creator.
/opt/local/bin/g++-mp-5 -headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.8 -Wl,-rpath,/Users/zero/builds/Qt5.7.0/5.7/clang_64/lib -o uniMR.app/Contents/MacOS/uniMR ALL_OBJECT_FILES_GO_HERE.o -F/Users/zero/builds/Qt5.7.0/5.7/clang_64/lib -L/opt/local/lib -L/usr/local/lib -funit-at-a-time -fopenmp -lmlpack -larmadillo -framework CoreFoundation -DNDEBUG -lpthread -lALL_ITK_LIBS_GO_HERE -framework QtOpenGL -framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework QtXml -framework OpenGL -framework AGL
**ld: unexpected token: !tapi-tbd-v2 file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd' for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [uniMR.app/Contents/MacOS/uniMR] Error 1**
I am compiling the main project with gcc 5.4 (not clang) inside QtCreator (Qt 5.7), and all my dependent libraries (ITK, BOOST, etc) are compiled using gcc 5.4 as well. I also recompiled all my dependent libraries after upgrading XCode, but that did not help either. I could find only one post that is related to the error I am seeing, but it doesnt seem useful:
https://trac.macports.org/ticket/51701
All was fine before I upgraded XCode. Now I am not sure how to fix the issue. I would appreciate any help on this. Thanks.
UPDATE:
This doesnt seem like a problem with any of the external libraries I am linking with. This is what I did. I created a new "QT widgets application" in QtCreator, and chose to compile with gcc5. I get the same error ld: unexpected token: !tapi-tbd-v2. If I switch to clang, then there is no error.
I had this "ld: unexpected token: !tapi-tbd-v2" error building an unrelated project and was able to solve it by editing the .tbd file for the framework that was giving the error.
For me that file was:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate.tbd
I simply removed the entire line "--- !tapi-tbd-v2" while building, and then put it back once finished.
had yesterday the same problem. I had XCode 7.3 and 8 on my system. Removing 7.3 and moving 8 into the apps location solved the problem.
I had the same problem. I used macport's GCC 6 as compiler and linker. It seems the GCC doesn't understand the new tbd format. In the MacOSX SDK path, there are now only these tbd text files which contain info about the real dylib libraries. So I just symlinked the real libraries to the SDK paths beside their tbd files. Then GCC can directly use the real libraries without parsing tbd files.
Here is a script for creating those symlinks:
https://gist.github.com/michalfapso/9abdbd5669bfdc4cd1a2179824d299e9
I had the same problem while compiling with opam.
The workaround was PATH=/usr/bin:$PATH, thus gcc will resolve to the default /usr/bin/gcc which is clang on macOS.

Qt5.5 static build cannot find -IGL on ubuntu14

I have compiled qt 5.5 for static building and it works fine.
However, when I add the widgets "QT += widgets" in the pro file I get the link error "cannot find -IGL"
From what I read this is to do with the Open GL libs. I have tried the following:
sudo apt-get install libglu1-mesa-dev
and
sudo apt-get install libgl1-mesa-dev
But no luck here... I am wondering if I need a static version of this? or maybe a symlink is missing, but I can't figure out the next step :(
Edit This is the actual error message:
g++ -static -static-libgcc -static-libstdc++ -Wl,-O1 -o ../targetRel/McpSupervisor main.o cconfig.o cconfigxml.o mcpprocessbase.o rpeprocess.o supervisor.o cipcomms.o mcpsupervisor_plugin_import.o moc_mcpprocessbase.o moc_supervisor.o moc_cipcomms.o -L/usr/lib/i386-linux-gnu/mesa -L/usr/local/Qt-5.5.1/lib -lQt5Xml -lQt5Widgets -L/usr/local/Qt-5.5.1/plugins/bearer -lqconnmanbearer -lqgenericbearer -lqnmbearer -lQt5Network -L/usr/local/Qt-5.5.1/plugins/platforms -lqxcb -L/usr/local/Qt-5.5.1/plugins/xcbglintegrations -lqxcb-glx-integration -lxcb-glx -lQt5XcbQpa -lX11-xcb -lXi -lxcb-render-util -lxcb-render -lxcb -lxcb-image -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shm -lxcb-randr -lxcb-shape -lxcb-keysyms -lxcb-xkb -lQt5PlatformSupport -lfontconfig -lfreetype -lQt5DBus -lXrender -lXext -lX11 -L/usr/local/Qt-5.5.1/plugins/imageformats -lqdds -lqicns -lqico -lqjp2 -lqmng -lqtga -lqtiff -lqwbmp -lqwebp -lQt5Gui -lpng -lqtharfbuzzng -lQt5Core -lz -licui18n -licuuc -licudata -lqtpcre -lm -ldl -pthread -lgthread-2.0 -lglib-2.0 -lrt -lGL -lpthread
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libX11.a(CrGlCur.o): In function open_library':
(.text+0x33): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: cannot find -lGL
/usr/local/Qt-5.5.1/plugins/imageformats/libqjp2.a(jas_stream.o): In functionjas_stream_tmpfile':
jas_stream.c:(.text+0x7a4): warning: the use of tmpnam' is dangerous, better usemkstemp'
/usr/local/Qt-5.5.1/lib/libQt5Core.a(qfilesystemengine_unix.o): In function QFileSystemEngine::resolveGroupName(unsigned int)':
qfilesystemengine_unix.cpp:(.text+0x943): warning: Using 'getgrgid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libglib-2.0.a(libglib_2_0_la-gutils.o): In functiong_get_user_database_entry':
(.text+0x25a): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/i686-linux-gnu/4.8/../../../i386-linux-gnu/libglib-2.0.a(libglib_2_0_la-gutils.o): In function g_get_user_database_entry':
(.text+0xa3): warning: Using 'getpwnam_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/Qt-5.5.1/lib/libQt5Core.a(qfilesystemengine_unix.o): In functionQFileSystemEngine::resolveUserName(unsigned int)':
qfilesystemengine_unix.cpp:(.text+0x592): warning: Using 'getpwuid_r' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/local/Qt-5.5.1/lib/libQt5Network.a(qhostinfo_unix.o): In function `QHostInfoAgent::fromName(QString const&)':
qhostinfo_unix.cpp:(.text+0x580): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: error: ld returned 1 exit status
make: *** [../targetRel/McpSupervisor] Error 1
09:49:17: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project qtMain (kit: Qt 5.5.1 GCC 32bit Static)
When executing step "Make"
09:49:17: Elapsed time: 00:08.
What is your actual problem :
You have unmet dependencies .
You are thinking that you have all the required dependencies because you installed
sudo apt-get install libglu1-mesa-dev
sudo apt-get install libgl1-mesa-dev
The problem is that you have a i386 system that is x32 system.
But you have installed development files for x64 systems using the commands above
Here is the ANSWER :
Intsall the following things
sudo apt-get install libgl1-mesa-dev:i386
sudo apt-get install libglu1-mesa-dev:i386
Now it should work ;)
Some other helpful stuff for visitors to this particular question
The lines below were my attempt to solve the problem but they did not work because the person who asked the question has a x32 system but the comments below work for x64 systems . But never the less the meta answer below will serve well for people who have the same problem and x64 systems. And also it will help problem to understand what are the basic steps to do after a similar problem occurs
# code_fodder I wanted to ask a question by making a comment below your question but I do not have 50 reputations to do so.
So I have to use the answer submission form to do so. :(
Do you have Miscellaneous Mesa GL utilities ?
If you dont have them then install using
sudo apt-get install mesa-utils
If you want to use OpenGl ES then you have to install Miscellaneous Mesa utilies (opengles, egl) using
sudo apt-get install mesa-utils-extra
Let me know if that works .
POSTING NEW INFORMATION ON 17-DEC-2015
I will post a portion of my project.pro file here . It specifically contains the library linking methods that I used for a simple OpenGL project.
I am using GLEW with OpenGL and SDL2
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp \
mesh.cpp \
display.cpp \
shader.cpp
HEADERS += \
mesh.h \
display.h\
shader.h
unix|win32: LIBS += -lGL \
-lGLEW \
/usr/local/lib/libSDL2-2.0.so
As you can notice I am using both static and dynamically linked libraries.
You may need to add:
unix | win32: LIBS += -L/usr/lib/x86_64-linux-gnu/mesa/ to your .pro file. However the path may be different for 32 bit systems. In that folder there are is the required mesa library files. These are the files for my system.
zehel#zehel-PC:/usr/lib/x86_64-linux-gnu/mesa$ ls
ld.so.conf libGL.so libGL.so.1 libGL.so.1.2.0
Try compiling now and see if that works
If that doesn't then either you have unmet dependencies or you are using old OpenGL.
Now after running the sudo apt-get install mesa-utils you will be able to use a command called glxinfo . It will show you all required information about your graphics card.
Run glxinfo | grep "OpenGl version string"
It will show you what version of OpenGl and mesa you have
mine is like this
OpenGL version string: 3.0 Mesa 10.3.2
If they are less than 3.0 then you are not using modern OpenGL and you may want to update your graphics drivers.
But if they are 3.0 or above then you are probably okay.
I cant reproduce your problem so I think that you have missing dependencies
See this posts on the QT forum where people with same problem as you are saying that there problems were fixed after installing the dependencies
http://forum.qt.io/topic/36282/solved-qt-5-2-0-and-lgl-issue
The last answer in the qt forum is quite good please refer it.
Update me whether it works or not .
Hope That helps .
You might need to specify the path where the GL library can be found, for exmaple by using the -L option to GCC, which has the following man page description:
-Ldir
Add directory dir to the list of directories to be searched for -l.

Linker error with GLFW on OS 10.10

I'm trying to compile the following
#include <GLFW/glfw3.h>
int main()
{
glfwInit();
return 0;
}
just to verify that my GLFW installation is working. I use the terminal with
clang++ -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo -I/opt/local/include/ test.c
but I receive a linker error for the glfwInit function:
Undefined symbols for architecture x86_64:
"_glfwInit", referenced from:
_main in test-d8c21e.o
ld: symbol(s) not found for architecture x86_64
I have installed glfw with sudo port install glfw and followed every possible tutorial I've found. I can verify that the libglfw.dylib file can be found at /opt/local/lib/ as (I think) it should.
Any suggestions?
You need to link with GLFW[3] as well, e.g., add:
-L/opt/local/lib -lglfw3
If you have the pkgconfig port installed, you can also take advantage of that with:
clang `pkg-config glfw3 --cflags` test.c -o test \
`pkg-config glfw3 --static --libs`
You may not need the --static flag if you have: libglfw3.dylib, as opposed to using: libglfw3.a, but it doesn't hurt.
If you are using Xcode, you must add the libglfw3.a library when linking binaries.
Heres the trick
Show hidden folders. Paste this into terminal: defaults write com.apple.finder AppleShowAllFiles YES
Relaunch a finder window and navigate to Macintosh HD\usr
Drag the usr folder to the "Favorites" side in the terminal
In xcode, click the add "+" to link binaries, then click "Add Other"
navigate to the libglfw3.a and add it!
If it still does not work, here are some instructions that helped me.
https://engineering-game-dev.com/2013/08/14/glfw-compiling-source-and-creating-an-xcode-project/comment-page-1/#comment-1400

SFML 2.1 Undefined symbols for architecture x86_64 error

I have recently installed SFML 2.1 and am trying to compile and run from the terminal, NOT Xcode, the sample program that they have on their website at http://www.sfml-dev.org/tutorials/2.0/start-linux.php.
Path to where I installed SFML:
/Users/.../Desktop/C++_Code/SMFL/SFML-2.1-osx-gcc-universal
However, I keep getting the error of:
Undefined symbols for architecture x86_64:
"sf::String::String(char const*, std::__1::locale const&)", referenced from:
_main in window-48cb4a.o
After googling it, I came across this question: SFML 2.1 RenderWindow linking error
In the accepted answer, the person said that if I wanted to use g++, I had to download the "GCC" version. So, I proceeded to download the GCC - universal 32+64 bits (OS X 10.5+) version and then followed the instructions for installing and compiling SFML on linux, since there were none for mac (http://www.sfml-dev.org/tutorials/2.0/start-linux.php) by doing the following:
Since I had installed SFML in a non-standard location, I told my compiler where to find the header files like so:
-I /Users/.../Desktop/C++_Code/SMFL/SFML-2.1-osx-gcc-universal/Frameworks/SFML.framework/Headers
I also had to tell my compiler where to find the SMFL libraries:
-L /Users/.../Desktop/C++_Code/SMFL/SFML-2.1-osx-gcc-universal/lib
I needed to also tell the library loader where to find the SFML libraries from:
export LD_LIBRARY_PATH=/Users/.../Desktop/C++_Code/SMFL/SFML-2.1-osx-gcc-universal/lib
Then, I put the sfml-audio.framework, sfml-window.framework, sfml-graphics.framework, sfml-network.framework, and sfml-system.framework in my Frameworks directory (/Library/Frameworks).
Finally, I tried to compile my program in the following ways:
g++ window.cpp -I /Users/.../Desktop/C++_Code/SMFL/SFML-2.1-osx-gcc-universal/Frameworks/SFML.framework/Headers/SFML -L /users/.../Desktop/C++_Code/SMFL/SFML-2.1-osx-gcc-universal/lib -framework sfml-graphics -framework sfml-window -framework sfml-system
g++ window.cpp -framework sfml-graphics -framework sfml-window -framework sfml-system
But, I keep getting the same error. I have continued to google the error, but all I keep getting are questions where people are using Xcode and not the terminal. Any help would be greatly appreciated!
I figured it out at last! First off, as Joachim Pileborg pointed out, I need to install the clang version of SFML for mac since I was using g++ to compile which is clang++ in disguise, as Joachim Pileborg also pointed out. Next, I had to go through the instructions again for setting up SFML with Linux (http://www.sfml-dev.org/tutorials/2.0/start-linux.php).
However, the icing on the cake was when I read this question:
OSX GCC how to specify sfml library source?
...and this question:
FreeType error when building in XCode
...which got me thinking: maybe I should try moving my freetype.framework folder (which can be found in the extlibs directory) into my /Library/Frameworks directory. Once I did this and compiled using
g++ window.cpp -framework sfml-graphics -framework sfml-window -framework sfml-system
It compiled and ran successfully!!! I am very happy now!