Hi, ALL,
I am trying to fix the following problem.
I have a Mac with OSX 10.8 with the Xcode 5.1.1. Inside I successfully created a project for my Cocoa application (plain C++). The name of the project is dbhandler
Next I made a static library project inside the main project. The project name is dbinterface and the static library it will produce will be called libdbinterface.a. I copied over the source files and successfully added the source files to the static library. Then I tried to compile my static library. It built fine. However the line under dbinterface.xcodeproj->Products->libdbinterface.a is displayed as red. Nevertheless as I said, the build was successful.
Then I created another sub-project as a dynamic library and successfully added it to the main project. This library project will be called libsqlite. I then added the source files to this second sub-project. I added the "Header Search Path" so that compiler will find the header file from the static library and in the "Build Phases->Link Binaries with Library" I hit a "+" sign and added the static library libdbinterface.a from the "Workspace" branch of the tree.
Trying to compile the dynamic library libsqlite.dylib, I got following error:
[code]
Ld /Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibsqlite.dylib normal x86_64
cd /Users/igorkorot/dbhandler/dbhandler/libsqlite
export MACOSX_DEPLOYMENT_TARGET=10.8
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -L/Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug -L/Users/igorkorot/dbhandler/dbhandler/dbinterface/build/Debug -F/Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug -filelist /Users/igorkorot/dbhandler/dbhandler/Build/Intermediates/libsqlite.build/Debug/libsqlite.build/Objects-normal/x86_64/libsqlite.LinkFileList -install_name /usr/local/lib/liblibsqlite.dylib -mmacosx-version-min=10.8 -stdlib=libc++ -ldbinterface -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/igorkorot/dbhandler/dbhandler/Build/Intermediates/libsqlite.build/Debug/libsqlite.build/Objects-normal/x86_64/libsqlite_dependency_info.dat -o /Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibsqlite.dylib
ld: warning: directory not found for option '-L/Users/igorkorot/dbhandler/dbhandler/dbinterface/build/Debug'
ld: library not found for -ldbinterface
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[/code]
I don't understand this error at all. The library "libdbinterface.a" was built successfully and now it does not want to find it?
Could someone please help me fix this error and resolve this dependency?
Thank you in advance.