Thread: module definition file

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    1,579

    module definition file

    Hello everyone,


    I am using Visual Studio 2005 to develop C++ DLL (in-process COM). There is a setting in Linker --> Input called Module definition file. This setting makes me confused,

    1. I have tried that if input a file name (.def), then the generated DLL be larger than the time when we leave the module definition file to empty. Should we leave it empty or non-empty (input a .def file name);

    2. What is the function of the module definition file? Should developer write it manually or generated by system.


    thanks in advance,
    George

  2. #2
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,817
    Highlight the "Module Definition File" line in the property page for your project and click on the "?" in the upper right hand corner to get help on that item.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    1,579
    Hi hk_mp5kpdw,


    After reading the help information and also some resources in MSDN, I am confused.

    http://msdn2.microsoft.com/en-us/lib...5y(VS.80).aspx

    Quote Originally Posted by hk_mp5kpdw View Post
    Highlight the "Module Definition File" line in the property page for your project and click on the "?" in the upper right hand corner to get help on that item.
    Previously I always use import library files (.lib) as linker input of the application if I need to make my application dependent on a DLL, seems we can replace the import library file (.lib) with .DEF files?

    I am interested to learn from you. Could you show me some steps in Visual Studio? I am using Visual Studio 2005, but if you are using other versions, it is ok.


    regards,
    George

  4. #4
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    1. Should we leave it empty or non-empty (input a .def file name);
    Use a .def file if that's your preferred method to export identifiers to make them visible by applications using your dll.

    2. What is the function of the module definition file? Should developer write it manually or generated by system.
    There is a wizard but only for mfc-dll's iirc. else you have to write them manually. its not that hard. you have to create a .map file first, which lists all c++ function names. than you are able to map that inside your .def file.
    look up the msdn, its pretty well explained there.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. Function basics
    By sjleonard in forum C++ Programming
    Replies: 15
    Last Post: 11-21-2001, 12:02 PM