Editing and compiling install_name_tool - ipa

I want to add an LC_LOADDYLIB command to my mach o binary file present inside the ipa file. The install_name_tool is used to change any existing library linked to another library. I want to add a new library to the ipa. So i thought if I edit the install_name_tool.c file i will be able to add this functionality. I downloaded the cctools project from Apple open source. The problem is that I am not able to compile the c file. I am getting errors. Can anyone please suggest any solution to link libraries to IPA or compile install_name_tool file.

Install the Xcode command line tools, and you should be able to compile it.
install_name_tool can only do in place editing of library paths in existing LC_LOAD_DYLIB commands. Adding a command requires you to do a lot more...

Related

How to make a list of file extensions read only in JetBrains IDEs?

I have a code generation tool (build_runner) that generates source code based on existing source files.
Every generated file is meant to be read-only.
How to tell JetBrains IDE to prevent me (as a developer) to edit those files? (or at least warn me a confirmation dialog before I actually edit the file)
Those files are identified with specific extensions
*.generated.dart
*.unwrapped.dart
Make your tool set file permissions on the files it generates: chmod 444.
Make your tool put the files in the generated folder like other libraries do.
Sample from Android Studio after setting the file permission on this file and trying to edit it:

How to add external references in MonoDevelop?

I've downloaded a charting library called NPlot and I have no idea how to add it as a reference in a GTK# application I'm currently making in MonoDevelop. There is no option in the Edit References window that you could add an external reference apart from the listed ones.
How do you add an external reference in MonoDevelop?
Being fairly new to Ubuntu (consequently, to using apps), I found it quite challenging to grapple with the dilemma above. After hours of searching (almost half a day actually), I found the answer. I created this post for others who might be facing this problem too.
Before proceeding, make sure you have your dll file to add as a reference.
First, create a .pc file containing the following:
Name:
Description:
Version:
Libs: -r:<where your dll is>
Example:
Name: NPlot
Description: Creates charts.
Version: 0.9.9.2
Libs: -r:/home/xxx/Downloads/NPlot/nplot-gtk-0.9.9.2/NPlot.dll
Hat tip to this site.
Remember where you've saved your .pc file. I've saved my file in /home/xxx/Documents. Next, copy the .pc file to /usr/lib/pkgconfig. I'm not sure with other Linux distros, but Ubuntu is preventing me to directly copy paste the file to the folder, so I have to use this command on the terminal:
sudo cp <source> <destination>
Example:
sudo cp /home/xxx/Documents/NPlot.pc /usr/lib/pkgconfig
It is now included in the Edit References window.
If the reference does not show, please refer to this question.
Unzip the NPlot zip file and extract the dll you need.
In the Edit References dialog select the .Net Assembly tab.
Click the Browse button and browse to the NPlot dll file and select Open.
Click OK on the Edit References dialog.

syntax highlight (.tmLanguage) in Sublime Text 3 for packages

I work on this plugin
Syntax highlight does not work with Sublime Text 3 when plugin is installed using package control.
Error loading syntax file "Sublime Text 3/Installed Packages/robot.tmLanguage": Unable to open Sublime Text 3/Installed Packages/robot.tmLanguage
The plugin is under Installed Packcages/Robot Framework Assistant.sublime-package, the file 'robot.tmLanguage' in inside Robot Framework Assistant.sublime-package archive.
Here is how I set paths
https://github.com/andriyko/sublime-robot-framework-assistant/blob/master/rfassistant/init.py
My question is similar to this thread, but in my case the plugin is installed as archive(.sublime-package) not folder with with files.
I am not sure that my path settings mentioned above are correct in python3.
How can I refer to tmLanguage file that is inside .sublime-package file?
Where should I put that file? It is totally confusing why does it work on Sublime Text 2 and Sublime Text 3(when installed into dir from github) but does not work when installed via Package Control.
So, how do I set path to tmLanguage file and where should I store it. Just want to clarify, that it works fine when plugin is installed from github zip file(because I put it's content into RobotFrameworkAssistant folder under Packages directory). It does not work when plugin is installed via Package Control.
Quick summary of my manual solution of adding custom .tmLanguage files based on others' suggestions:
Put the myLang.tmLanguage file into a folder with your desired syntax
name.
Zip the folder so that it's named myLang.zip
Rename the zip archive to myLang.sublime-package
Put the myLang.sublime-package into the Sublime 3 packages folder. It will now appear in the sublime syntax highlighting menu.
Based on ST3 docs, I can't seem to find an alternative to this manual method right now, but it will work.
Package control will likely do everything you need behind the scene
Do you need the content of the tmLanguage file? If so, you shouldn't be accessing it directly. Instead, you should be using sublime.load_resource(name), where name is something like Packages/Robot Framework Assistant/robot.tmLanguage. If you are just trying to set the file syntax, you should be using view.set_syntax_file(syntax_file), where syntax_file is like name for the resource. I did not look at your plugin in detail, so please clarify what you are trying to do if both of those answers are incorrect.
As a side note, based on that error, you would probably see issues in ST2 also. You are only looking at the root packages folder, not in your package.
In ST3, jps decided to make plugins runnable from .sublime-package files, rather than needing to be extracted. These files are simply renamed .zip files. Updates do need to be made if you are accessing resources within your plugin, but the API has been extended to support it.
This isn't a great list, but it covers some of the changes in ST3 from ST2.
http://www.sublimetext.com/docs/3/porting_guide.html
The issue seems to be solved. Please refer to this fix.
Why I had problems with syntax settings(.tmLanguage) in ST3?
Because it is totally confusing and not clear from ST3 docs where that file should be located.
(Even if it says that files lookup is continued in Packages directory if file was not found in Installed Packages).
There are two 'main' folders under Sublime Text 3 directory: Installed Packages and Packages.
When the plugin is installed using Package Control it goes into Installed Packages directory packed into archive file called like Robot Framework Assistant.sublime-package (which is actually ZIP file).
The robot.tmLanguage file (syntax file) is inside Robot Framework Assistant.sublime-package.
So, in few words, my question was: how to refer to that file (what path should be provided to view.set_syntax_file method)?
Unintuitive, but I should refer to non-existent path Packages/Robot Framework Assistant/robot.tmLanguage. Actually, in my case the Packages directory contains only Users folder. The only thing, that I can guess is that folder name should be the same as package name(Robot Framework Assistant in my case).

Compiling Libpng in Windows 7 or getting a hold of Libpng12.dll (and understanding how to link .DLL in VS)

I've been using Libpng15 in Windows 7, but I've been getting errors in relation to the
Unresolved External _png_set_longjmp_fn error when I compile my code. I followed the directions in the aforementioned link, and while it DID compile without any errors, I wound up with a message saying that I needed libpng12.dll to continue.
So, I did some Googling for libpng12.dll...nothing came up but generic "find x.dll" websites which appeared to be scams.
I've tried reading the INSTALL docs for the libpng source code on their website, and all that I see is instructions on how to do it via Unix based systems. I tried to do this in Cygwin with no luck, so I'm kind of stuck on how to compile this library.
All in all, I'm willing to do either the compilation or just using the .dll, though the problem is that I can't find a working .dll for version 12.
Another thing I tried was downloading binaries from here, which claimed to be "libpng12 for windows". I then copied the files into my VC compiler directory, which overrode libpng15, I think. Still, when I link against it statically and run my program in VC, it says that I require the .DLL file. The libpng12.dll file was in fact a .dll.a file instead. I honestly am not sure to link these (I tried linking it statically by typing "libpng12.dll.a" in the Linker Input setting through VS).
If I can go the .dll route for libpng12, how do I do this? Where is the file? How do I link it in VS?
Any help would be appreciated, as it seems there really isn't a whole lot of information on this. Either that, or I'm just not looking properly.
Look in the "projects" directory of the libpng distribution, and use one of the visual projects.
As mentioned above Look in the "projects" directory of the libpng distribution
Then make the adjustments outlined here
https://stackoverflow.com/a/38547948/293792
Which I note here for simplicities sake
(as stated there) adding two lib values to
Config -> Linker -> Input -> Additional Dependencies
these values are ucrt.lib;vcruntime.lib
Ensuring the build type is /MD
Allowed me to build these older versions, and fix that error on Windows 10 VS2015.
This link seems to have an installer for 1.2 for you:
http://gnuwin32.sourceforge.net/packages/libpng.htm
it's 32 bit. Not sure if that makes a difference for you.

Ogre3d Error: cannot open file OgreMain_d.lib

Error 2 error LNK1104: cannot open file 'OgreMain_d.lib' C:\Users\Owner\Documents\Code\C++\Test\ogrevcpp\ogrevcpp\LINK ogrevcpp
This is the error I get when trying to build an Ogre3D application (with steps followed from here).
I've followed everything to the T, yet I still get the error. It honestly shouldn't be happening. I've also followed everything from here.
Edit
What's happening is there are two different files, one is meant for release, the other is meant for debug. I need the one for debug mode to compile properly (which is OgreMain_d.lib).
Update
I figured out what the problem was - I was using the incorrect binaries; there was a few releases which were meant for Visual C++, and one which was meant for MinGW, along with a few other compilers. My apologies.
You need to check your library paths to make sure that the path where OgreMain_d.lib lives is part of the library path.
I guess the library for Debug mode is not present in the lib folder. Try putting two different libraries folder for each Assembly mode in Visual Studio. Go to ProjectProperties -> Configuration Properties -> Linker -> Additional Library Directories on Right hand. Make sure to check the Configuration Dropdown on the top.

Resources