Copy link to clipboard
Copied
I create a new Plugin,
But occur error LNK1181: cannot open input file '..\..\..\build\win\objR\PMRuntime.lib'
Why?
1 Correct answer
I looked at the project and have successfully fixed it, but unfortunately i can't send that across because of the way the project has been sent originally. The paths used in the project file are mostly absolute paths and due to this your project needs changes at lots of placed when ported to a new machine. I will give you pointers on how to fix your issue and how to improve the way project is setup for better portability.
How to fix your issue.
- Remove $(MODEL_PLUGIN_LINKLIST) from the list and it
Copy link to clipboard
Copied
The project requires to link to some libraries shipped with the SDK, i suppose the file is not present at the location that it is trying to look into. Just check if the path is valid or not, if its not then find where you have the lib placed in the sdk. If you have not changed the structure of the sdk then it should be at <Path Where SDK is Unzipped>\build\win\objr for Release library which will be used by the release configuration and <Path Where SDK is Unzipped>\build\win\objd for the debug library for debug configuration of your plugin project.
Once you verify the path that needs to be used, and if it does not match the one currently in use. Change the values under the Linker section of the project properties, under Input>Additional Dependencies.
Hope this clears out why you get this error and how you can resolve it. Let me know if you still have issues
-Manan
Copy link to clipboard
Copied
My Setting At Linker> Input>Additional Dependencies:
$(MODEL_PLUGIN_LINKLIST)
E:\Adobe InDesign CS6 Plugin SDK\external\afl\libs\win\release\AFL.lib
E:\Adobe InDesign CS6 Plugin SDK\build\win\objr\PMRuntime.lib
E:\Adobe InDesign CS6 Plugin SDK\build\win\objr\Public.lib
But it still show error [error LNK1181: cannot open input file '..\..\..\build\win\objR\PMRuntime.lib'] when build
Copy link to clipboard
Copied
That's strange, it seems that there is some override. You could run some tests to isolate where is the project picking the path
- Open the project file, .vcproj or .vcxproj file and see if it indeed has somewhere the path causing the issue. If you find the erroneous path in the file, replace it with the correct one.
- Try and removing all the entries in the Linker>Input>Additional Dependencies: and then add these library path one by one.
Make sure that we are looking the setting of the correct configuration that we are trying to build
-Manan
Copy link to clipboard
Copied
After Remove all:
Error: [
Error | 1 | error LNK2019: unresolved external symbol "__declspec(dllimport) public:] |
Add: $(MODEL_PLUGIN_LINKLIST) is ok
Error:
Error | 1 | error LNK1181: cannot open input file '..\..\..\build\win\objD\PMRuntime.lib' |
Add: E:\Adobe InDesign CS6 Plugin SDK\build\win\objr\PMRuntime.lib, not ok.
Copy link to clipboard
Copied
Did you search the project file by opening it in a text editor. Send me the project file as well, let me see if i can find something amiss
Copy link to clipboard
Copied
This is my project: Dropbox - AK_Plugin.rar
folder sdk: E:\Adobe InDesign CS6 Plugin SDK
folder project: E:\AK_Plugin
Thank you your help.
Copy link to clipboard
Copied
I looked at the project and have successfully fixed it, but unfortunately i can't send that across because of the way the project has been sent originally. The paths used in the project file are mostly absolute paths and due to this your project needs changes at lots of placed when ported to a new machine. I will give you pointers on how to fix your issue and how to improve the way project is setup for better portability.
How to fix your issue.
- Remove $(MODEL_PLUGIN_LINKLIST) from the list and it will work fine for you. The wrong path is written in the sdk props file that are included by your props file
- After following the first point, you will again get a linking error, to resolve it add ASLSupport.lib to the additional dependencies in the linker section.
How to setup a project in a more portable manner
- You should avoid using absolute paths at multiple locations, because when you move the project to another machine you will have to change the paths at all these locations
- Even using the relative paths does not solve the issue properly, because in this case you need to place the project relative to particular location on every machine for it to work properly. This was the reason why $(MODEL_PLUGIN_LINKLIST) was failing for you. Adobe sdk samples use relative paths hence moving the project around while using their configuration fails if the relativeness of the path is not maintained
- In order to be totally portable, we should make use of macros and define them at a single location. So that when you have to move the project, changing paths in this single file fixes everything. An example of this is how you have set id_sdk_dir macro in your props file.
Hope these points help you resolve your issue and set up project in a better way.
-Manan
Copy link to clipboard
Copied
Thank you very much.
If i add new project and setting path the same sample projects of sdk. I had built ok.
But if i add new project and setting path to outside folder sdk. i build error.
error LNK2001: unresolved external symbol "__declspec(dllimport) struct adobe::version_1::new_delete_t const adobe::version_1::local_new_delete_g"
Copy link to clipboard
Copied
The linking error is due to the reason that you are not linking a library, i suppose its ASLSupport.lib that you need to add to your linking paths. Actually this is the problem with using sdk settings file and project as the base for your project because the sdk setting file uses paths relative to sdk, so the moment you place your project file outside of sdk folder everything stops working.
So the best bet over here is to use understand how things are setup in property files and use macros, which are defined in a single place so that you can modify all the paths quickly whenever you move the project.
-Manan

