Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've fixed my program as below but still got 2 errors:
Here is my first path of program:
#include "stdafx.h"
#include "iostream"
#include "sstream"
#include "winsock.h"
#include "ws2tcpip.h"
#include "netinet/in.h"

In this line i have problem:
#include "netinet/in.h

The errors are:
C1083: Can't open the 'include' file ,
#include netinet/in.h
:No such file and directory
E1696: Cant't open Source file
How can i fixed this
thank you so much.

What I have tried:

I have many errors which call LNK 2019 as in my others question and when i added
"netinet/in.h"
into #include function all these errors were gone.
Posted
Updated 23-Oct-19 1:48am

 
Share this answer
 
v2
If you are building in Windows then you need to include Winsock2.h, the netinet subset is for UNIX/Linux, I think. You should also put file names of system headers in < and > rather than double quotes.
 
Share this answer
 
Comments
Member 14629414 24-Oct-19 2:34am    
@Richard MacCutchan
Even when i tried to add winsock2.h to my library. It didn't work. Only <netinet in.h=""> make all LNK 2019 errors dismissed . 1 thing is this program I've fixing is working parallel with second program call 'C controller' and this program will took the signal value of my fixing program to control robot and in the include it has #include<arpa inet.h=""> so i think the program i've fixing must have a compatible header file
Richard MacCutchan 24-Oct-19 2:49am    
Header files are used by the C preprocessor, and do not have anything to do with LINK errors. Those are resolved by including the correct .lib files at link time. If you are using including the winsock2.h header then you also need to link with its associated library.
Member 14629414 24-Oct-19 4:29am    
@Richard MacCutchan
Thank you now iknow how to add the right link to library. I've missing ws2_32.lib and I've added it in the linker in library
Thank all of you for all your precious help!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900