User forums > Using Code::Blocks
How to configure C::B to use DEF file when creating DLL?
(1/1)
sean:
I am a newbie with C::B. I am using Visual c++6.0 compiler. I am trying to build a DLL project and it seems that C::B doesn't recognize the DEF file.
Is there a way to configure C::B to pick up the DEF file?
Thanks so much!!
morning:
you may add the followning flags to linker flags
/def:"yourfilename.def"
in vc/vs,m$ do this job for you automatically ,it will insert this flag when invoke linker,but you need you do this manual in code::blocks.
adimsh:
--- Quote from: morning on July 07, 2008, 03:53:32 am ---you may add the followning flags to linker flags
/def:"yourfilename.def"
in vc/vs,m$ do this job for you automatically ,it will insert this flag when invoke linker,but you need you do this manual in code::blocks.
--- End quote ---
Hi, thnaks for the tip, but did not work with me,
I choose from "Project"-> Build Options -> Linker Settings tab -> Other linker options box, and add
/def:"yourfilename.def"
I get file not found error, I added an absolute path, "c:\yourfilename.def", and I get the error
--- Code: ---mingw32-g++.exe: /def:c:\yourfilename.def: Invalid argument
--- End code ---
I have the following in the def file:
--- Code: ---LIBRARY MT_TestDll
EXPORTS
MyMsg
--- End code ---
then I tried keep the def file inside my project main path, and added the absolute path of my project to Linker Search Directories in build options, and use the form: /def:"yourfilename.def" in liker options, the build was completed successfully but no ".DLL" file is generated, only a ".a" file.
Would you please tell me what I did wrong?
Regards,
keyser:
--- Quote from: adimsh on July 08, 2008, 04:51:02 pm ---
--- Quote from: morning on July 07, 2008, 03:53:32 am ---you may add the followning flags to linker flags
/def:"yourfilename.def"
in vc/vs,m$ do this job for you automatically ,it will insert this flag when invoke linker,but you need you do this manual in code::blocks.
--- End quote ---
Hi, thnaks for the tip, but did not work with me,
I choose from "Project"-> Build Options -> Linker Settings tab -> Other linker options box, and add
/def:"yourfilename.def"
I get file not found error, I added an absolute path, "c:\yourfilename.def", and I get the error
--- Code: ---mingw32-g++.exe: /def:c:\yourfilename.def: Invalid argument
--- End code ---
I have the following in the def file:
--- Code: ---LIBRARY MT_TestDll
EXPORTS
MyMsg
--- End code ---
then I tried keep the def file inside my project main path, and added the absolute path of my project to Linker Search Directories in build options, and use the form: /def:"yourfilename.def" in liker options, the build was completed successfully but no ".DLL" file is generated, only a ".a" file.
Would you please tell me what I did wrong?
Regards,
--- End quote ---
i am using MinGW packed with Code::Blocks. I found a way to use DEF file.
in Project => Build Option... => Linker settings , add the .DEF file to your project's link libraries , and then build the project, you will got what you need.
shen_li_li:
-Wl,--kill-at --def=test.def
Navigation
[0] Message Index
Go to full version