Link to home
Start Free TrialLog in
Avatar of SkyWolf
SkyWolf

asked on

Network Programming

I m writing a TCP/IP network program using C on MS Visual C++ 5.0 on a WinNT platform . I get LNK2001 error whenever i link my files ... any ideas ?
ASKER CERTIFIED SOLUTION
Avatar of stsanz
stsanz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of billyh
billyh

I usually get that error when I have defined a method in one of my classes and then forgetting to implement it in my defination file. Other causes of this error are using the wrong case when implementing a method, remember C is case-sensitive.
Avatar of SkyWolf

ASKER

Now that u added both lib to the Object/Library i got these errors ....

LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/alarmman.exe : fatal error LNK1120: 1 unresolved externals

Avatar of SkyWolf

ASKER

sorry ...typo...i mean now that i added the lib into Object/Library ...
Is your program a console program (with a main() function) or a windows program (with a WinMain() function)

Do you have a main or WinMain function ?
Does the same link error message appear if you compile to Release configuration, instead of Debug ?


Avatar of SkyWolf

ASKER

I am using a main() ... I still get the error if the output file is to Release .....
If you want to create a windows program you have to replace your main() function by the WinMain() function :

int APIENTRY WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  {
  // Do the startup stuff

  return 0 ;
  }

Instead, if you want to create an old-fashioned "DOS" program and use main() function, you have to select "Win32 Console Application" when you create a new project in Visual C++

Avatar of SkyWolf

ASKER

erm...i hav a qs though , is it that , if i use socket tp pass data, i am ACTUALLY not implementing TCP/IP ?
Sorry I can't understand your question. Do you mean you want to know if your program implements a TCP/IP protocol when it uses socket layers functions ? Can you please ask your question again ?



Avatar of SkyWolf

ASKER

"whack" me if I am wrong here *smile* ..TCP/IP is a connectionless protocol which  doesnt use the bind() functional call ? so the standard procedures of creating a socket(),recv(),send() is as usual ?
I don't know how to use socket functions. You should create a new question on "C language" home page about it.