0

I'm using system() to call an executable binary that runs perfectly fine in the terminal, but does not work in the iOS simulator. I get a runtime error.

The error that I'm getting is:

dyld: unloaded: /software/evpath-4.dev/lib/libcmselect.so dlopen() failed, error: 'dlopen(libcmselect.so, 1): Library not loaded: libcercs_env.1.dylib Referenced from: /software/evpath-4.dev/lib/libcmselect.so Reason: image not found' dlerror() Failed to load required select dll. Search path includes '.', '/usr/local/pkg/working/evpath_base/nightly_build_area/evpath/build', '/software/evpath-4.dev/lib' and any default search paths supported by ld.so

I also have the source code for the binary. I imported all the header files and all the libraries pertaining to the source code. It also builds successfully, but when I try and execute it, it gives me the same error.

Gaurd Malloc is unchecked and I've tried adding a Run Script in the Build Phases that sets all the environments that would have been set given I had run it in a terminal shell.

Avi Frankl
  • 211
  • 4
  • 6
  • When running from Xcode, the working directory will be the root. When running from Terminal, it'll be the current directory. Could this be the problem? – StilesCrisis Jun 03 '14 at 21:10
  • No that's not the problem. I think the problem is that xcode cannot find the library path. I just tested that it gave me the same error in terminal when I did not set the environments. As I said though, I tried to set the environment using the Run Script in XCode. I also tried having system run a terminal command that set the environments and called my program, but that didn't work either. – Avi Frankl Jun 03 '14 at 21:48
  • If the library is present under iOS, then add it's directory search parth to the linker options. You can set a runpath, so environment isn't required. – Rob11311 Jun 03 '14 at 22:01

0 Answers0