2
votes

I am using C+ library Ex:sample.lib. Now I want to add this library path in to Other linker flag in xcode.

I added like this

-L/(library path) -llibsample

or

-L/(library path) -lsample

or

-L/(library path) -lsample.lib

ld: library not found for -llibsample or -lsample or -lsample.lib collect2: ld returned 1 exit status Command /Xcode Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

How to add my lib file into Other linker flag?

1
The second example is the correct one. However, is the path correct? The first slash in marking the path as absolute, and is not part of the -L option. - Some programmer dude
Can you add the generated linker command? - lucas clemente

1 Answers

0
votes

Please check the LD_LIBRARY_PATH because if the LD_LIBRARY_PATH is not properly set then also this problem comes