Click here to Skip to main content
15,904,024 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
When I compile a .dll file I always create a .def file which contains the exported functions, I have to use "\DEF" command to link to this .def file; that is inconvenient when I copy that folder (folder contains all of files of project) to another location (I have to re-link .def file). Which location of .def file in this folder to avoid this advantage? Or I use "/DEF" command how to avoid? Thanks in advance.
Posted

1 solution

You can specify the destination of the def file in your project settings, so it will always be copied to a specific location. Use the custom properties settings, and add a copy statement to copy it to your destination library.
 
Share this answer
 
Comments
Andrewpeter 25-Mar-14 5:21am    
Sorry I dont understand a problem: "Custom properties settings" - where is it? I dont find it in Property page. Hope you help me. Thanks.
Richard MacCutchan 25-Mar-14 5:28am    
Go to solution explorer, right click the file name in the project list and click properties.
Andrewpeter 25-Mar-14 6:04am    
Thank you. I'm bad in English so my word becomes difficult to understand. My destination is: I have a def file named "ModPeoject.def" contains exported function symbols, I add it to my project (and it is put in folder project, C:\ModProject). In linker configuration commandline I link to this file by using /DEF:"C:\ModProject\ModProject.def". I compile it successfuly. But when I cut (sorry, cut, not copy) that folder "ModProject" to another location of hard disk (D) and open project, recompile - at this time, I see an error:

Error 1 fatal error LNK1104: cannot open file 'C:\ModProject\ModProject.def'

I have re-link /DEF:"D:\ModProject\ModProject.def" then I compile successfuly.

I dont want to re-link above when I cut that folder to any location in hard disk. How to do this? Thanks.
Richard MacCutchan 25-Mar-14 6:10am    
You cannot move a file from one location to another and expect the linker to be able to guess where it is.
Andrewpeter 25-Mar-14 6:17am    
So I have to re-link it when remove it to another location. Thanks for your support.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900