NO

Author Topic: POLINK: Error: Can not find the symbol '_GetHttpURL@8'.  (Read 2386 times)

Offline alderman

  • Member
  • *
  • Posts: 25
POLINK: Error: Can not find the symbol '_GetHttpURL@8'.
« on: December 12, 2016, 09:48:08 pm »
Excuse my bad English!

I have programmed with LccWin32 many years. I am completely satisfied!
Now I switched to Windows 10 and unfortunately does not work LccWin32 quite well there. Among other things, the program closes abruptly if I should import a file, and similar problems have arisen with Windows 10.

Therefore, I have begun to use Pelles C. But the program codes that worked in LccWin32 does not work straight off with Pelle. I've got to change a lot for it to work.

One of the errors I can not solve, tried everything in two days:

POLINK: Error: Can not find the symbol '_GetHttpURL@8'.

What am I doing that this error will not occur?

(Lib and header is copied to Pelles and the linker have this: "kernel32.lib user32.lib gdi32.lib comctl32.lib comdlg32.lib advapi32.lib delayimp.lib netutils.lib shell32.lib winhttp.lib" )
« Last Edit: December 12, 2016, 10:00:34 pm by alderman »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1893
Re: POLINK: Error: Can not find the symbol '_GetHttpURL@8'.
« Reply #1 on: December 12, 2016, 11:56:38 pm »
function declaration is:
Code: [Select]
int __cdecl GetHttpURL(char *URL,char *OutFileName);netutils.lib had small problem: __stdcall strcpy (strcpy@8) function.
I had to rename that name to an another, like strcpx ;)

PS: you can use UrlMon URLDownloadToFile() instead.
URLDownloadToFile
« Last Edit: December 14, 2016, 02:59:21 pm by TimoVJL »
May the source be with you

Offline alderman

  • Member
  • *
  • Posts: 25
Re: POLINK: Error: Can not find the symbol '_GetHttpURL@8'.
« Reply #2 on: December 13, 2016, 12:33:47 pm »
function declaration is:
Code: [Select]
int __cdecl GetHttpURL(char *URL,char *OutFileName);netutils.lib had small problem: __stdcall strcpy (strcpy@8) function.
I had to rename that name to an another, like strcpx ;)

PS: you can use UrlMon URLDownloadToFile() instead.
URLDownloadToFile
Thanks for the answer, it is very much appreciated!

If it is wrong to change the names, I wonder why the error is not corrected.
Anyway, the "URLDownloadToFile" exactly the same as "GetHttpURL" (I have not watch it yet).

Where is the lib, etc. to download?

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1893
Re: POLINK: Error: Can not find the symbol '_GetHttpURL@8'.
« Reply #3 on: December 13, 2016, 02:37:04 pm »
LccWin32 is a odd case, C compiler with some extra c++ features and incompatibilities.
standard function strcpy should use __cdecl calling convention.

Code: [Select]
HRESULT URLDownloadToFile(
             LPUNKNOWN            pCaller,
             LPCTSTR              szURL,
             LPCTSTR              szFileName,
  _Reserved_ DWORD                dwReserved,
             LPBINDSTATUSCALLBACK lpfnCB
);
urlmon.lib is part of Windows SDK and urlmon.h and urlmon.lib are included in PellesC
Code: [Select]
#include <urlmon.h>
#pragma comment(lib, "urlmon.lib")
...
HRESULT hr = URLDownloadToFile(NULL,szURL,szFileName,0,NULL);
May the source be with you

Offline alderman

  • Member
  • *
  • Posts: 25
Re: POLINK: Error: Can not find the symbol '_GetHttpURL@8'.
« Reply #4 on: December 13, 2016, 04:54:09 pm »
Thanks!!
LccWin32 has worked for me for many years. All code I used worked.
The worst is Wedit (bundled editor) which is very buggy has otherwise Wedit many great features. Another problem is the creator of LccWin32, he is very
unpleasant!!

I have now tested URLDownloadToFile, it works but I have enough to change the return value, I use int now but this gives HRESULT.

I notice that PellesC is much more precise, with the string assignment. I have to change a lot.

Otherwise, I am glad I made the move to Pelles C.
« Last Edit: December 13, 2016, 05:00:00 pm by alderman »

Offline alderman

  • Member
  • *
  • Posts: 25
Re: POLINK: Error: Can not find the symbol '_GetHttpURL@8'.
« Reply #5 on: December 14, 2016, 01:36:04 pm »
I tested URLDownloadToFile several hours now. Have discovered that URLDownloadToFile returns are not compatible with GetHttpURL. Much code must be rewritten.
Another problem is when the internet connection is down. GetHttpURL returned error code directly. URLDownloadToFile returns error code after 5-60 sec. During that long time to get tired of it does not work.

How to fix the error __stdcall:
Quote
netutils.lib had small problem: __stdcall strcpy (strcpy@8) function.
I had to rename that name to an another, like strcpx

If I try to rename GetHttpURL was more, the name changed?
« Last Edit: December 14, 2016, 01:39:13 pm by alderman »