undefined reference to `__imp_WSAStartup'...Devc++ error solution

       Recently, my roommate encountered some problems when writing the course design for Jiwang. He was going to borrow some code from the Internet (hehe, everyone knows it...), but found that the code related to ftp client design could not run on the computer, and kept reporting errors on devc++. So he came to ask me for advice, because I was confused because of other things at that time. After running it locally, the console kept displaying a bunch of undefined reference to `__..... I changed a few places randomly at that time, but there were more and more errors, so I simply...hang it up. ...

        A few days later, I remembered this matter again, so I studied it again and tried Baidu. The error message was undefined reference to `__. There are indeed many blog posts about this on the Internet. I tried it several times by comparing several articles, including adding headers. The files don't work either. At this time, I saw an article that dealt with this problem from compile-time options. I thought that the several articles I had seen before were all about how to compile. My mind got hot and I simply confused myself, but I didn’t expect that it was actually solved! ! !

        Solution: Click Tools--Compilation Options in the menu bar of devc++, in the window that opens, check the box to add the following command when compiling , enter -lwsock32, and then click OK at the bottom. At this time, compile and run again, and the running window will appear perfectly...nice! ! !

 

 

Guess you like

Origin blog.csdn.net/m0_63080216/article/details/128428406