|
From: Pablo I. A. <rig...@ho...> - 2006-08-09 03:13:47
|
Hi,=20 What is the difference between "unsigned long" and "unsigned long int" = when your variable is in hex representation? Thanks Pablo |
|
From: Per W. <pw...@ia...> - 2006-08-09 06:25:06
|
No difference. "long" is just a shorter form of "long int" in the same way that "short" is a shorter form of "short int" and "unsigned" is a shorter form of "unsigned int". /Per W On Tue, 8 Aug 2006, Pablo Itaim A. wrote: > Hi, > > What is the difference between "unsigned long" and "unsigned long int" when your variable is in hex representation? > > Thanks > > Pablo |
|
From: HongQuan.Zhang <hon...@i-...> - 2006-08-09 09:15:56
|
Hi=A3=ACAll:
I create a dll project and I want to export some function such as=20
void Test();
I add a def file like def file in MSVC,and of course I add a linker
opiton "-def test.def"
in project options->parameter->linker=20
In the file Test.def,there are only several code as follow:
; test.def : Declares the module parameters for the DLL.
LIBRARY "test"
DESCRIPTION 'test Windows Dynamic Link Library'
EXPORTS
; Explicit exports can go here
Test
When I compile the project and get some error:
[Linker error] undefined reference to `Test'=20
|
|
From: Thomas O'H. <To...@Re...> - 2006-08-11 13:38:30
|
Hong, et. al. I used the common way as described below. But I swear I get different results as my project continues. I had added the DEF file to the Linker and all was OK. Then at some point I had to remove the DEF from the Linker to compile. Either I overlooked something or something I am clueless about is going on. So, what is the "best" way to use a DEF file to export functions in Dev-C++??? Not only a code sample but also where to list the file. I am sure it is just me but any help will be appreciated. I am burning up way too much time on this. Thanks, ~ Thomas O'Hare ~ President, RedTile, Inc. - DBA: RedTile Software Web, Wireless, Network, Database & Systems Software +1.407.295.9148 ; +49.8651.717950 ; http://www.RedTile.Com/ Operations Manager; Virtual FoxPro User Group To...@VF... ; http://www.VFUG.Org/ HongQuan.Zhang wrote: > Hi,All: > I create a dll project and I want to export some function such as > void Test(); > I add a def file like def file in MSVC,and of course I add a linker > opiton "-def test.def" > in project options->parameter->linker > In the file Test.def,there are only several code as follow: > > ; test.def : Declares the module parameters for the DLL. > > LIBRARY "test" > DESCRIPTION 'test Windows Dynamic Link Library' > > EXPORTS > ; Explicit exports can go here > Test > > > When I compile the project and get some error: > [Linker error] undefined reference to `Test' > > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > ------------------------------------------------------------------------ > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: HongQuan.Zhang <hon...@i-...> - 2006-08-14 02:51:25
|
Hi, Thomas: In fact,you don't have to add a def file to the project made by Dev-Cpp ,you can refer to the attachment ,which is a email Per = Westermark send out and this perfect mail help me to solve my problem! Hope this can help you! HongQuan -----=D3=CA=BC=FE=D4=AD=BC=FE----- =B7=A2=BC=FE=C8=CB: dev...@li... [mailto:dev...@li...] =B4=FA=B1=ED Thomas = O'Hare =B7=A2=CB=CD=CA=B1=BC=E4: 2006=C4=EA8=D4=C211=C8=D5 21:38 =CA=D5=BC=FE=C8=CB: dev...@li... =B3=AD=CB=CD: Dev...@li... =D6=F7=CC=E2: Re: [Dev-C++] How to build a DLL with def file=A3=BF Hong, et. al. I used the common way as described below. But I swear I get different results as my project continues. I had added the DEF file to the Linker and all was OK. Then at some = point I had to remove the DEF from the Linker to compile. Either I overlooked something or something I am clueless about is going = on. So, what is the "best" way to use a DEF file to export functions in Dev-C++??? Not only a code sample but also where to list the file. I am sure it is just me but any help will be appreciated. I am burning = up way too much time on this. Thanks, ~ Thomas O'Hare ~ President, RedTile, Inc. - DBA: RedTile Software Web, Wireless, Network, Database & Systems Software +1.407.295.9148 ; +49.8651.717950 ; http://www.RedTile.Com/ Operations Manager; Virtual FoxPro User Group To...@VF... ; http://www.VFUG.Org/ HongQuan.Zhang wrote: > Hi=A3=ACAll: > I create a dll project and I want to export some function such as=20 > void Test(); > I add a def file like def file in MSVC,and of course I add a linker=20 > opiton "-def test.def" > in project options->parameter->linker=20 > In the file Test.def,there are only several code as follow: >=20 > ; test.def : Declares the module parameters for the DLL. >=20 > LIBRARY "test" > DESCRIPTION 'test Windows Dynamic Link Library' >=20 > EXPORTS > ; Explicit exports can go here > Test >=20 >=20 > When I compile the project and get some error: > [Linker error] undefined reference to `Test'=20 >=20 >=20 >=20 >=20 >=20 > ---------------------------------------------------------------------- > -- >=20 > ---------------------------------------------------------------------- > --- Using Tomcat but need to do more? Need to support web services,=20 > security? > Get stuff done quickly with pre-integrated technology to make your job = > easier Download IBM WebSphere Application Server v.1.0.1 based on=20 > Apache Geronimo > = http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D= 1216 > 42 >=20 >=20 > ---------------------------------------------------------------------- > -- >=20 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Thomas O'H. <To...@Re...> - 2006-08-18 12:53:42
|
I have "yet" to be able to export my own functions when trying to use WinPCap SDK. I am not sure this will be enough, but maybe if someone can write an "Hello World" DLL using a UDF I can finally see the light? I just want to see it work from an external program: MyFunc(@cBuffer) If cBuffer return "Hello World" I will be a happy camper. I know there is something severely stupid I am overlooking. Now I just must determine if it is my working environment or I have an option set wrong. OK, laugh, but I just need to figure out what really stupid mistake I made. In WinPCap it "seemed" that exported functions had to be in a LIB file to work. That is the only way I could get them to work in their samples. I am not sure what I am asking for will relate to WinPCap or not, but if someone has a few minutes... >From what I see on both this list & the WinPCap list, exporting functions seems to be a major topic. So at least I can have some comfort.... I also appear to see a glimpse of maybe the key is that many use MS Visual Studio, MS .Net, and of course Dev-C++. IOW, so many environments it is easy to create the wrong environment. I guess the best way, "if" someone can do this for me, is to zip the project and sent it to me off list. That is unless anyone else really wants to see it too. Way Too Frustrated & Growing too old too fast, ~ Thomas O'Hare ~ President, RedTile, Inc. - DBA: RedTile Software Web, Wireless, Network, Database & Systems Software +1.407.295.9148 ; +49.8651.717950 ; http://www.RedTile.Com/ Operations Manager; Virtual FoxPro User Group To...@VF... ; http://www.VFUG.Org/ HongQuan.Zhang wrote: > Hi, Thomas: > In fact,you don't have to add a def file to the project made by > Dev-Cpp ,you can refer to the attachment ,which is a email Per Westermark > send out and this perfect mail help me to solve my problem! > Hope this can help you! > > HongQuan > > -----邮件原件----- > 发件人: dev...@li... > [mailto:dev...@li...] 代表 Thomas O'Hare > 发送时间: 2006年8月11日 21:38 > 收件人: dev...@li... > 抄送: Dev...@li... > 主题: Re: [Dev-C++] How to build a DLL with def file? > > Hong, et. al. > > I used the common way as described below. But I swear I get different > results as my project continues. > > I had added the DEF file to the Linker and all was OK. Then at some point I > had to remove the DEF from the Linker to compile. > > Either I overlooked something or something I am clueless about is going on. > > So, what is the "best" way to use a DEF file to export functions in > Dev-C++??? Not only a code sample but also where to list the file. > > I am sure it is just me but any help will be appreciated. I am burning up > way too much time on this. > > Thanks, > ~ Thomas O'Hare ~ > President, RedTile, Inc. - DBA: RedTile Software Web, Wireless, Network, > Database & Systems Software > +1.407.295.9148 ; +49.8651.717950 ; http://www.RedTile.Com/ > Operations Manager; Virtual FoxPro User Group To...@VF... ; > http://www.VFUG.Org/ > > > HongQuan.Zhang wrote: >> Hi,All: >> I create a dll project and I want to export some function such as >> void Test(); >> I add a def file like def file in MSVC,and of course I add a linker >> opiton "-def test.def" >> in project options->parameter->linker >> In the file Test.def,there are only several code as follow: >> >> ; test.def : Declares the module parameters for the DLL. >> >> LIBRARY "test" >> DESCRIPTION 'test Windows Dynamic Link Library' >> >> EXPORTS >> ; Explicit exports can go here >> Test >> >> >> When I compile the project and get some error: >> [Linker error] undefined reference to `Test' >> >> >> >> >> >> ---------------------------------------------------------------------- >> -- >> >> ---------------------------------------------------------------------- >> --- Using Tomcat but need to do more? Need to support web services, >> security? >> Get stuff done quickly with pre-integrated technology to make your job >> easier Download IBM WebSphere Application Server v.1.0.1 based on >> Apache Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=1216 >> 42 >> >> >> ---------------------------------------------------------------------- >> -- >> >> _______________________________________________ >> Dev-cpp-users mailing list >> Dev...@li... >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > ------------------------------------------------------------------------ > > Subject: > Re: [Dev-C++] ??: ??: How to build a DLL with def file? > From: > "Per Westermark" <pw...@ia...> > Date: > Wed, 9 Aug 2006 19:41:00 +0800 > To: > "HongQuan.Zhang" <hon...@i-...> > > To: > "HongQuan.Zhang" <hon...@i-...> > CC: > <Dev...@li...> > > > I do dynamic loading of libraries in my applications too using something > like the following for Win32 applications. Normally I hide a bit more of > the code in macros, to make it work with Linux too. > > #if BUILDING_DLL > #define DLLIMPORT __declspec(dllexport) > #else > #define DLLIMPORT __declspec(dllimport) > #endif > > extern "C" { > DLLIMPORT DWORD __cdecl GetObjectFactoryCount(); > DLLIMPORT bool __cdecl GetObjectFactory(DWORD n,ObjectFactoryInfo& info); > } > > hLib = LoadLibrary(pszName); > GetObjectFactoryCount = > (suitable cast)GetProcAddress(hLib,"GetObjectFactoryCount"); > GetObjectFactory = > (suitable cast)GetProcAddress(hLib,"GetObjectFactory"); > > /Per W > > On Wed, 9 Aug 2006, HongQuan.Zhang wrote: > >> Per Westermarki"1/4s( >> Thank you for answer my question. >> I don't want to use __declspec(dllexport),because this director > will output a function name with additional characters which are added by > compiler. >> Example: >> void Test(int a); >> maybe output like this "_test@4" >> I just want to output with name "Test" , So I can use LoadLibrary > and GetProcAddress to get the function address easily! >> That is,I need to load the dll and invoke the function dynamicly! >> >> In MSVC ,I can only need to do is provide a def file and write the > function name down and compile! >> Anyway,thanks again! >> >> >> >> Hongquan >> >> >> >> >> -----é,?a"??a*Z(Y"a"??----- >> a*?‘a"??a"^(o)^(o): Per Westermark [mailto:pw...@ia...] >> a*?‘éEUR??―?é―?: 2006a*^(1)?8?oe^9?―? 17:48 >> ?”?a"??a"^(o)^(o): HongQuan.Zhang >> ?S("éEUR?: Dev...@li... >> a"??é?~: Re: [Dev-C++] c,?”a*¤?: How to build a DLL with def filei"1/4Y" >> >> Note that in C++, the external name of functions are mangled. Extra digits > and characters are added to the name to distinguish type information. This > is needed since C++ allows multiple functions with the same name but with > different signatures. For example: >> int Test() { return 0} >> int Test(int a) { return a; } >> int Test(int a,int b) { return a+b; } >> int Test(const char* s) { return strlen(s); } ... >> >> If you use a file to specify exported symbols, you have to specify the > fully mangled name. >> Or, you have to declare the function as type "C", to avoid the name > manging. The function will then just get an initial underscore in it's > external name - _Test. >> When developing on Windows systems, it is quite common to use the M$ >> extension: >> __declspec(dllexport) >> before name of exported symbols directly in the source code. >> >> The linker will then be able to extract the information about all exported > symbols automatically, without the need of the def file. >> You might have code: >> >> __declspec(dllexport) int my_variable; >> __declspec(dllexport) int Test() { return 0; } ... >> >> Normally the dll declaration is hidden in a #define, to make the code > compatible with compilers/environments that doesn't support DLL files. >> #define __declspec(dllexport) EXPORT >> >> EXPORT int my_variable; >> EXPORT int Test() { return 0; } >> >> >> In the same way, code that needs to access a function or variable defined > in a DLL may use __declspec(dllimport) instead. >> /Per W >> >> On Wed, 9 Aug 2006, HongQuan.Zhang wrote: >> >>> I am sorry that I haven't finish the post before I send it! >>> the original message is at below. >>> And I just want to know how to code the def file,or how to build a dll >>> with specify export function name! >>> Thanks a lot! >>> >>> Hongquan >>> >>> -----A~“A~S(A^1/4A~3/4A~”A^?A^1/4A~3/4----- >>> A^・A^?A^1/4A~3/4A~^A~<: HongQuan.Zhang [mailto:hon...@i-...] >>> A^・A^?A~<A~?A~S(A^±A^1/4A~¤: 2006A~"A~^(a)8A~”A~,9A~^A~. 17:16 >>> A~S(A~.A^1/4A~3/4A~^A~<: 'Dev...@li...' >>> A~A~・A~OEA~?: How to build a DLL with def fileA^?A^? >>> >>> HiA^?A^?All: >>> I create a dll project and I want to export some function such as >>> void Test(); >>> I add a def file like def file in MSVC,and of course I add a linker >>> opiton "-def test.def" >>> in project options->parameter->linker >>> In the file Test.def,there are only several code as follow: >>> >>> ; test.def : Declares the module parameters for the DLL. >>> >>> LIBRARY "test" >>> DESCRIPTION 'test Windows Dynamic Link Library' >>> >>> EXPORTS >>> ; Explicit exports can go here >>> Test >>> >>> >>> When I compile the project and get some error: >>> [Linker error] undefined reference to `Test' >>> >>> >>> >>> >> >> >> >> ------------------------------------------------------------------------- >> Using Tomcat but need to do more? Need to support web services, security? >> Get stuff done quickly with pre-integrated technology to make your job > easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> _______________________________________________ >> Dev-cpp-users mailing list >> Dev...@li... >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >> > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > ------------------------------------------------------------------------ > > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Per W. <pw...@ia...> - 2006-08-18 13:47:25
|
Note that when you build a dll file, you can also build an export library. The export library is then lined with an application to make the application able to use the exported functions of a DLL without knowing that the files resides in a DLL file. You can also use the DLL file without having the applicatino link with the export library. Then you have to manually open the DLL file and then retrieve pointers to the exported symbols in the DLL file. The export library just contains small stub functions to perform the dynamic "hookup" with an exported symbol in the DLL file. It is possible to make use of both export libraries and "manual" dynamic linking. One such setup is where the main program exports a number of symbols using a export library. The DLL file is created using the application export library. The application may then locate a DLL and load it and manually connect to exported functions in the DLL. On the other hand, the DLL file may make use of exported functions in the main application - for example to log progress or register new menu alternatives. Right now I'm working flat out with a very important project, so I can't make the time to set up a demo project for use. However, even if this list is quite silent, there should be a number of other people on the list who can help. /Per W On Fri, 18 Aug 2006, Thomas O'Hare wrote: > I have "yet" to be able to export my own functions when trying to use > WinPCap SDK. > > I am not sure this will be enough, but maybe if someone can write an > "Hello World" DLL using a UDF I can finally see the light? I just want > to see it work from an external program: > > MyFunc(@cBuffer) > > If cBuffer return "Hello World" I will be a happy camper. > > I know there is something severely stupid I am overlooking. Now I just > must determine if it is my working environment or I have an option set > wrong. > > OK, laugh, but I just need to figure out what really stupid mistake I mad= e. > > In WinPCap it "seemed" that exported functions had to be in a LIB file > to work. That is the only way I could get them to work in their samples. > > I am not sure what I am asking for will relate to WinPCap or not, but if > someone has a few minutes... > > >From what I see on both this list & the WinPCap list, exporting > functions seems to be a major topic. So at least I can have some > comfort.... > > I also appear to see a glimpse of maybe the key is that many use MS > Visual Studio, MS .Net, and of course Dev-C++. IOW, so many > environments it is easy to create the wrong environment. > > I guess the best way, "if" someone can do this for me, is to zip the > project and sent it to me off list. That is unless anyone else really > wants to see it too. > > Way Too Frustrated & Growing too old too fast, > ~ Thomas O'Hare ~ > President, RedTile, Inc. - DBA: RedTile Software > Web, Wireless, Network, Database & Systems Software > +1.407.295.9148 ; +49.8651.717950 ; http://www.RedTile.Com/ > Operations Manager; Virtual FoxPro User Group > To...@VF... ; http://www.VFUG.Org/ > > > HongQuan.Zhang wrote: > > Hi, Thomas: > > =09In fact,you don't have to add a def file to the project made by > > Dev-Cpp ,you can refer to the attachment ,which is a email Per Westerm= ark > > send out and this perfect mail help me to solve my problem! > > =09Hope this can help you! > > > > HongQuan > > > > -----=D3=CA=BC=FE=D4=AD=BC=FE----- > > =B7=A2=BC=FE=C8=CB: dev...@li... > > [mailto:dev...@li...] =B4=FA=B1=ED Thoma= s O'Hare > > =B7=A2=CB=CD=CA=B1=BC=E4: 2006=C4=EA8=D4=C211=C8=D5 21:38 > > =CA=D5=BC=FE=C8=CB: dev...@li... > > =B3=AD=CB=CD: Dev...@li... > > =D6=F7=CC=E2: Re: [Dev-C++] How to build a DLL with def file=A3=BF > > > > Hong, et. al. > > > > I used the common way as described below. But I swear I get different > > results as my project continues. > > > > I had added the DEF file to the Linker and all was OK. Then at some po= int I > > had to remove the DEF from the Linker to compile. > > > > Either I overlooked something or something I am clueless about is going= on. > > > > So, what is the "best" way to use a DEF file to export functions in > > Dev-C++??? Not only a code sample but also where to list the file. > > > > I am sure it is just me but any help will be appreciated. I am burning = up > > way too much time on this. > > > > Thanks, > > ~ Thomas O'Hare ~ > > President, RedTile, Inc. - DBA: RedTile Software Web, Wireless, Network= , > > Database & Systems Software > > +1.407.295.9148 ; +49.8651.717950 ; http://www.RedTile.Com/ > > Operations Manager; Virtual FoxPro User Group To...@VF... ; > > http://www.VFUG.Org/ > > > > > > HongQuan.Zhang wrote: > >> Hi=A3=ACAll: > >> =09I create a dll project and I want to export some function such as > >> =09void Test(); > >> =09I add a def file like def file in MSVC,and of course I add a linker > >> opiton "-def test.def" > >> =09 in project options->parameter->linker > >> =09In the file Test.def,there are only several code as follow: > >> > >> ; test.def : Declares the module parameters for the DLL. > >> > >> LIBRARY "test" > >> DESCRIPTION 'test Windows Dynamic Link Library' > >> > >> EXPORTS > >> ; Explicit exports can go here > >> Test > >> > >> > >> When I compile the project and get some error: > >> [Linker error] undefined reference to `Test' > >> > >> > >> > >> > >> > >> ---------------------------------------------------------------------- > >> -- > >> > >> ---------------------------------------------------------------------- > >> --- Using Tomcat but need to do more? Need to support web services, > >> security? > >> Get stuff done quickly with pre-integrated technology to make your job > >> easier Download IBM WebSphere Application Server v.1.0.1 based on > >> Apache Geronimo > >> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&da= t=3D1216 > >> 42 > >> > >> > >> ---------------------------------------------------------------------- > >> -- > >> > >> _______________________________________________ > >> Dev-cpp-users mailing list > >> Dev...@li... > >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > -----------------------------------------------------------------------= - > > > > Subject: > > Re: [Dev-C++] ??: ??: How to build a DLL with def file? > > From: > > "Per Westermark" <pw...@ia...> > > Date: > > Wed, 9 Aug 2006 19:41:00 +0800 > > To: > > "HongQuan.Zhang" <hon...@i-...> > > > > To: > > "HongQuan.Zhang" <hon...@i-...> > > CC: > > <Dev...@li...> > > > > > > I do dynamic loading of libraries in my applications too using somethin= g > > like the following for Win32 applications. Normally I hide a bit more o= f > > the code in macros, to make it work with Linux too. > > > > #if BUILDING_DLL > > #define DLLIMPORT __declspec(dllexport) > > #else > > #define DLLIMPORT __declspec(dllimport) > > #endif > > > > extern "C" { > > DLLIMPORT DWORD __cdecl GetObjectFactoryCount(); > > DLLIMPORT bool __cdecl GetObjectFactory(DWORD n,ObjectFactoryInfo& info= ); > > } > > > > hLib =3D LoadLibrary(pszName); > > GetObjectFactoryCount =3D > > (suitable cast)GetProcAddress(hLib,"GetObjectFactoryCount"); > > GetObjectFactory =3D > > (suitable cast)GetProcAddress(hLib,"GetObjectFactory"); > > > > /Per W > > > > On Wed, 9 Aug 2006, HongQuan.Zhang wrote: > > > >> Per Westermarki"1/4s( > >> =09Thank you for answer my question. > >> =09I don't want to use __declspec(dllexport),because this director > > will output a function name with additional characters which are added = by > > compiler. > >> =09Example: > >> =09void=09Test(int a); > >> =09maybe output like this "_test@4" > >> =09I just want to output with name "Test" , So I can use LoadLibrary > > and GetProcAddress to get the function address easily! > >> =09That is,I need to load the dll and invoke the function dynamicly! > >> > >> =09In MSVC ,I can only need to do is provide a def file and write the > > function name down and compile! > >> =09Anyway,thanks again! > >> > >> > >> > >> Hongquan > >> > >> > >> > >> > >> -----=A8=A6,?a"??a*Z(Y"a"??----- > >> a*?=A1=AEa"??a"^(o)^(o): Per Westermark [mailto:pw...@ia...] > >> a*?=A1=AE=A8=A6EUR??=A1=AA?=A8=A6=A1=AA?: 2006a*^(1)?8?oe^9?=A1=AA? 17= :48 > >> ?=A1=B1?a"??a"^(o)^(o): HongQuan.Zhang > >> ?S("=A8=A6EUR?: Dev...@li... > >> a"??=A8=A6?~: Re: [Dev-C++] c,?=A1=B1a*=A1=E8?: How to build a DLL wit= h def filei"1/4Y" > >> > >> Note that in C++, the external name of functions are mangled. Extra di= gits > > and characters are added to the name to distinguish type information. T= his > > is needed since C++ allows multiple functions with the same name but wi= th > > different signatures. For example: > >> int Test() { return 0} > >> int Test(int a) { return a; } > >> int Test(int a,int b) { return a+b; } > >> int Test(const char* s) { return strlen(s); } ... > >> > >> If you use a file to specify exported symbols, you have to specify the > > fully mangled name. > >> Or, you have to declare the function as type "C", to avoid the name > > manging. The function will then just get an initial underscore in it's > > external name - _Test. > >> When developing on Windows systems, it is quite common to use the M$ > >> extension: > >> __declspec(dllexport) > >> before name of exported symbols directly in the source code. > >> > >> The linker will then be able to extract the information about all expo= rted > > symbols automatically, without the need of the def file. > >> You might have code: > >> > >> __declspec(dllexport) int my_variable; > >> __declspec(dllexport) int Test() { return 0; } ... > >> > >> Normally the dll declaration is hidden in a #define, to make the code > > compatible with compilers/environments that doesn't support DLL files. > >> #define __declspec(dllexport) EXPORT > >> > >> EXPORT int my_variable; > >> EXPORT int Test() { return 0; } > >> > >> > >> In the same way, code that needs to access a function or variable defi= ned > > in a DLL may use __declspec(dllimport) instead. > >> /Per W > >> > >> On Wed, 9 Aug 2006, HongQuan.Zhang wrote: > >> > >>> I am sorry that I haven't finish the post before I send it! > >>> the original message is at below. > >>> And I just want to know how to code the def file,or how to build a dl= l > >>> with specify export function name! > >>> Thanks a lot! > >>> > >>> Hongquan > >>> > >>> -----A~=A1=B0A~S(A^1/4A~3/4A~=A1=B1A^?A^1/4A~3/4----- > >>> A^=A1=A4A^?A^1/4A~3/4A~^A~<: HongQuan.Zhang [mailto:hongquan.zhang@i-= zq.com] > >>> A^=A1=A4A^?A~<A~?A~S(A^=A1=C0A^1/4A~=A1=E8: 2006A~"A~^(a)8A~=A1=B1A~,= 9A~^A~. 17:16 > >>> A~S(A~.A^1/4A~3/4A~^A~<: 'Dev...@li...' > >>> A~=A8CA~=A1=A4A~OEA~?: How to build a DLL with def fileA^?A^? > >>> > >>> HiA^?A^?All: > >>> =09I create a dll project and I want to export some function such as > >>> =09void Test(); > >>> =09I add a def file like def file in MSVC,and of course I add a linke= r > >>> opiton "-def test.def" > >>> =09 in project options->parameter->linker > >>> =09In the file Test.def,there are only several code as follow: > >>> > >>> ; test.def : Declares the module parameters for the DLL. > >>> > >>> LIBRARY "test" > >>> DESCRIPTION 'test Windows Dynamic Link Library' > >>> > >>> EXPORTS > >>> ; Explicit exports can go here > >>> Test > >>> > >>> > >>> When I compile the project and get some error: > >>> [Linker error] undefined reference to `Test' > >>> > >>> > >>> > >>> > >> > >> > >> > >> ----------------------------------------------------------------------= --- > >> Using Tomcat but need to do more? Need to support web services, securi= ty? > >> Get stuff done quickly with pre-integrated technology to make your job > > easier > >> Download IBM WebSphere Application Server v.1.0.1 based on Apache Gero= nimo > >> http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&da= t=3D121642 > >> _______________________________________________ > >> Dev-cpp-users mailing list > >> Dev...@li... > >> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > >> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > >> > > > > > > -----------------------------------------------------------------------= - > > > > -----------------------------------------------------------------------= -- > > Using Tomcat but need to do more? Need to support web services, securit= y? > > Get stuff done quickly with pre-integrated technology to make your job = easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron= imo > > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > > > > > > -----------------------------------------------------------------------= - > > > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > |