Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

ws2_3.lib missing - [newbie question]

2012-04-10
2013-07-17
  • I have this lib here:
    C:\Program Files\Microsoft SDKs\Windows\v7.1\Lib
    I just need to tell the project where it is. How do I it?

     
  • Jim Pattee
    Jim Pattee
    2012-04-10

    You are going to use VC libraries in a MinGW compile. VC libraries have a .lib
    extension. MinGW have a lib prefix and a .a extension. Also there may be
    differences in the header files associated with the library. But if you want
    to try it...

    You need to add the path to the "project properties" dialog. You can either
    include it as part of the library file ID or as an additional path name. I
    don't have Devcpp installed so I cant tell you exactly where. In both cases
    you may need to rename the file. For example ole32.lib would be renamed to
    libole32.a.

    If the library doesn't work there is a way to convert it. But you should be
    sure that all the other problems are resolved first, such as any problems with
    the header. If you are using something not supported by MinGW it may not be
    possible to fix it.

    Another problem I just noticed. The VC files are probably 64 bit. Are there
    equivalent files in the "Program Files (x86)" folder?

     
  • Jim Pattee
    Jim Pattee
    2012-04-10

    I checked the MinGW library files on my computer. The ws2_3.lib is there as
    libws2_32.a. It is in the MinGW\lib folder. Do you have it? You may just need
    to update your MinGW compiler files.

     
  • Thank you for the answer! I also have the libws2_32.a. Thank you for the
    advice! I still get the same errors. I should probably try to learn how to
    make the Makefile and do enerything by hand. As someone pointed out: This IDE
    is (maybe too) old.

     
  • Here is the makefile

    Project: FTPTest

    Makefile created by Dev-C++ 4.9.9.2

    CPP = g++.exe -DDEBUG
    CC = gcc.exe -DDEBUG
    WINDRES = windres.exe
    RES =
    OBJ = main.o BlockingSocket.o FtpClient.o FTPFileState.o FTPListParse.o
    FTPDataTypes.o $(RES)
    LINKOBJ = main.o BlockingSocket.o FtpClient.o FTPFileState.o FTPListParse.o
    FTPDataTypes.o $(RES)
    LIBS = -L"C:/Dev-Cpp/lib" -L"C:/Program Files/Microsoft SDKs/Windows/v7.1/Lib"
    "../../../../../Program Files/Microsoft SDKs/Windows/v7.1/Lib/WS2_32.Lib"
    ../../../../../MinGW/lib/libws2_32.a -g3
    INCS = -I"C:/Dev-Cpp/include"
    CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-
    Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C
    :/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -I"C:/Program
    Files/Microsoft SDKs/Windows/v7.1/Include"
    BIN = FTPTest.exe
    CXXFLAGS = $(CXXINCS) -fexceptions -g3
    CFLAGS = $(INCS) -fexceptions -g3
    RM = rm -f

    .PHONY: all all-before all-after clean clean-custom

    all: all-before FTPTest.exe all-after

    clean: clean-custom
    ${RM} $(OBJ) $(BIN)

    $(BIN): $(OBJ)
    $(CPP) $(LINKOBJ) -o "FTPTest.exe" $(LIBS)

    main.o: main.cpp
    $(CPP) -c main.cpp -o main.o $(CXXFLAGS)

    BlockingSocket.o: BlockingSocket.cpp
    $(CPP) -c BlockingSocket.cpp -o BlockingSocket.o $(CXXFLAGS)

    FtpClient.o: FtpClient.cpp
    $(CPP) -c FtpClient.cpp -o FtpClient.o $(CXXFLAGS)

    FTPFileState.o: FTPFileState.cpp
    $(CPP) -c FTPFileState.cpp -o FTPFileState.o $(CXXFLAGS)

    FTPListParse.o: FTPListParse.cpp
    $(CPP) -c FTPListParse.cpp -o FTPListParse.o $(CXXFLAGS)

    FTPDataTypes.o: FTPDataTypes.cpp
    $(CPP) -c FTPDataTypes.cpp -o FTPDataTypes.o $(CXXFLAGS)

     
  • Jim Pattee
    Jim Pattee
    2012-04-11

    You are including both the Microsoft and the MinGW file. Remove the Microsoft
    file (-L"C:/Program Files/Microsoft SDKs/Windows/v7.1/Lib" AND
    "../../../../../Program Files/Microsoft SDKs/Windows/v7.1/Lib/WS2_32.Lib" ).
    It should make no difference if you are using the Devcpp project file or a
    Makefile to compile.

    What errors are you getting?

    You can get a newer version of Devcpp at https://sourceforge.net/projects/orw
    elldevcpp/
    . It will have a
    newer compiler version also.

     

  • Anonymous
    2012-04-14

    It helped to delete this reference to the .Lib-file and using the MingW lib in
    stead. I didn't need the Windows SDK lib. AND then Code::Blocks works and
    Devcpp is too old. Luckily Code::Blocks can import devcpp-projects. I am up
    and running. Thanks for your help!
    (I was ill for some days - hence the late answer)

     
  • Thanks for sharing!

     
  • gina
    gina
    2013-07-17

    Post awaiting moderation.