D
D
Daniil Demidko2015-12-08 10:12:37
C++ / C#
Daniil Demidko, 2015-12-08 10:12:37

What is the problem with wininet.h?

MinGW, codeblocks
flatly refuses to compile any code with wininet, although this header seems to be in place.
For example this code:

#include<windows.h>
#include<wininet.h>
int main()
{
    /// инициализируем WinInet
    HINTERNET hInternet=InternetOpen(TEXT("WinInet Test"), INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0);
}

Doesn't compile, gives
undefined reference to `[email protected]'

And so with any function.
libwininet.a is in the MinGW folder, what's the problem? What to do?
windows.h works fine, but what about wininet.h?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
Boris Dergachev, 2015-12-08
@Daniro_San

Show the line that compiles the source. The linker must eat the Wininet library with the parameter-lwininet

A
anikavoi, 2015-12-09
@anikavoi

// link with Ws2_32.lib
#pragma comment(lib, "Ws2_32.lib")
It?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question