Closed vygr closed 3 years ago
Hi, the preferred way to submit fixes on github is pull requets, do you think you could submit that as a pull request? Makes it much easier to review
Never done one before so I just thought I'd let you know what the problem was :)
You had a FIXME comment that showed you didn't yet know what the issue was so if you'd like to fix it now you know, go ahead.
The gist of my fix was just to check if there was an ID present in the file using otool -D, and if so just chop the second line out of the output from the subsequent otool -L output. Not exactly the most elegant solution, there may be a far better way !
Best regards
Chris
Fixed in 63b13da
The reason this is happening is that using 'otool -L' on a dylib includes the ID in the output !!!
So you need to find out if there is an ID and remove it from the output line list !
Here is a quick fix I did, that you may like to use, or your own variation on this. Note I use 'auto', so put -std=c++11 on your makefile lines !
Best regards
Chris
void collectDependencies(std::string filename, std::vectorstd::string& lines) { // execute "otool" on the given file and collect the command's output std::string cmd = "otool -D " + filename; std::string id_output = system_get_output(cmd); auto start = std::find(id_output.begin(), id_output.end(), '\n') + 1; auto end = std::find(start, id_output.end(), '\n');
}