0

I have already read Tiny C Compiler (TCC) and winsock?, but I still can't compile sockets with TCC, because when I try

 tiny_impdef winsock.dll -o winsock.def

tiny_impdef responds:

Not a PE file: C:\WINDOWS\system32\winsock.dll

So how can I do to compile properly a program that use sockets? Any help will be appreciated

Community
  • 1
  • 1
chubakueno
  • 565
  • 4
  • 18
  • I gave the answer to this question on this post: http://stackoverflow.com/questions/4069770/tiny-c-compiler-tcc-and-winsock/9351171#9351171 – Mathieu Rodic Apr 03 '12 at 10:18

1 Answers1

1

I'm guessing that you have a 64 bit machine and TCC is 32 bit. In that situation C:\WINDOWS\system32\winsock.dll is the 64 bit version of winsock. Try it this way:

tiny_impdef C:\WINDOWS\SysWOW64\winsock.dll -o winsock.def

to pick up winsock from the 32 bit system directory.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • You are possibly aiming too high, winsock.dll was the 16-bit version of ws2_32.dll. So was tcc.exe. A bits/4 problem. We need a "asked 15 years too late" close reason at SO, please vote along. – Hans Passant Oct 01 '11 at 21:57
  • @hans I think there are >16 bit winsock.dlls in existance. Also tcc can target 32 and 64 bit code. – David Heffernan Oct 01 '11 at 22:09
  • @hans This is Tiny C not Turbo C. No I never used either. As you must know by now I'm not really one for languages with braces. ;-) – David Heffernan Oct 01 '11 at 22:14
  • I do have an active memory of it from Byte magazine. Not sure what it takes to extinguish it, you're not helping :) – Hans Passant Oct 01 '11 at 22:26
  • @Hans Passant Thank you! Worked with ws2_32.dll.And to clear doubts: My OS is WinXP 32 bits service pack 2, and my computer is an Pentium 4 HT – chubakueno Oct 01 '11 at 23:11
  • 1
    Well, that was a drive-by accident. Don't hesitate to post it and accept it as an answer. Feel free to embellish. – Hans Passant Oct 01 '11 at 23:15