| |

VerySource

 Forgot password?
 Register
Search
View: 608|Reply: 2

I wrote a DLL control, and the problem in the .def file when compiling?

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-13 12:30:02
| Show all posts |Read mode
Compiling ...
UsbApi.cpp
Linking ...
uniClient.def: error LNK2001: unresolved external symbol comm_CopyFile
Release / uniClient.lib: fatal error LNK1120: 1 unresolved externals
LINK: fatal error LNK1141: failure during build of exports file
Error executing link.exe.
Creating browse info file ...

uniClient.dll-3 error (s), 0 warning (s)

In the above error, the comm_CopyFile function is not used at all. I don't know why this prompt appears. I don't understand the role of the .def file. If you delete this in the .def file, you can't generate .dll after compilation.
   Creating library Release / uniClient.lib and object Release / uniClient.exp
LINK: warning LNK4089: all references to "SHELL32.dll" discarded by / OPT: REF
How could this happen? I have never encountered such a LINK error before? Please master a little brother
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-6-8 23:30:01
| Show all posts
The .def file is generally used to specify the function name of the imported function in the DLL and the name of the exported variable.
Reply

Use magic Report

0

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-6-9 09:30:01
| Show all posts
def files are used to export functions and variables. def files cannot be deleted unless you explicitly state which ones are to be exported.
Just delete the wrong function name in def. . . .
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list