-1

I am getting an error which I shouldn't get according to this and this.

My library does exist though (here is the proof):

./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibdatabaseview.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibdbloader.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibdialogs.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibodbc.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibshapeframework.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/liblibsqlite.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/libodbc_lib.dylib
./Users/igorkorot/dbhandler/dbhandler/Build/Products/Debug/libsqlite_lib.dylib

How do I fix the error?

Igor
  • 5,620
  • 11
  • 51
  • 103
  • That's not really proof since the library it's complaining about would be called "liblibdbwindow.dylib". – Phillip Mills Aug 03 '16 at 14:17
  • @PhillipMills, oops, sorry. I was in a rush. However, can you point me where the library is coming from in the linker statement. It's not in the "Other Linker Flag". – Igor Aug 03 '16 at 14:20
  • @Armin, check the screenshots linked. – Igor Aug 03 '16 at 14:22
  • Your screen shots don't tell me where the library is referenced. Is it linked in your "Build Phases" section? – Phillip Mills Aug 03 '16 at 14:39
  • @PhillipMills, I am at work right now. I will check that tonight and post the screenshot. But is there a place where I should check for references of the library? This: http://stackoverflow.com/questions/38711456/need-an-xcode-expert-project-does-not-contain-option-which-appears-alive?noredirect=1#comment64811399_38711456 indicates I shouldn't be using "Other Linker Flags". – Igor Aug 03 '16 at 15:03
  • I normally specify libraries in the Link Binary With Libraries section of Build Phases. Using "-lname" in the flags section *should* work as long as you specify the path in the library path section, but that's not the first place someone would look for a list of libraries, I think. – Phillip Mills Aug 03 '16 at 15:20
  • @PhillipMills, OK, but where this "-lname" is coming from? I went thru the options of Xcode and didn't see anything. – Igor Aug 03 '16 at 15:26
  • This goes back to an earlier comment. It may be coming from Build Phases but, if not, there's nothing in what you've posted that explains it. Somehow, you've told Xcode to use "liblibdbwindow" but not where to find it. Perhaps you can figure it out by finding where that library actually exists. – Phillip Mills Aug 03 '16 at 16:09
  • @PhillipMills, OK, I will post more tonight when I get home. Thank you and hopefully you will keep that thread open. – Igor Aug 03 '16 at 16:15
  • @PhillipMills, this is weird. Apparently this is circular dependency issue. But what I don't understand is how come both Windows/MSVC 2010 and Linux/gcc-5.4.0 both compiled and ran that same code. I tried to mimic what MSVC solution or gcc Makefile does, but I am getting link error. Do you have a suggestion on how to resolve it? Its LibraryA call function from LibraryB and vice versa. – Igor Aug 04 '16 at 00:47
  • Whether or not that's a problem, it's not the problem from the error message you showed. I suggest concentrating on having the linker find the missing file/path first. – Phillip Mills Aug 04 '16 at 02:55

1 Answers1

0

I refactored the code to get rid of the circular dependency and it's now compiling fine on all 3 platforms.

Its still weird though that only OSX Xcode didn't compile the code.

Igor
  • 5,620
  • 11
  • 51
  • 103