Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2019-10

Linking with putty C code, various linker errors

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

Hello,
I am trying to make an SFTP client class based on putty. It will be open source and I think quite useful for many people, but it looks like I need some help :=)

I need to link in over 100 .o files compiled with gcc. I am using the fpc 3.1.1 snapshot on Win64 for now.

ISSUE #1:
Undefined symbol: fopen
this line does not help:
function fopen(filename: PAnsiChar; mode: PAnsiChar): Pointer; cdecl; external 'MSVCRT.DLL' name 'fopen'; It works only when I write the function myself using cdecl; export; Can this be fixed?

ISSUE #2:
Undefined symbol: __imp_isspace
Undefined symbol: __imp_GetTickCount
and similar ones ... I think gcc added the __imp prefix ... apparently I need to add an import library, but how?

Overall the linker errors are not so many and I believe it will eventually work.

Cheers,
Tobias

Tobias Giesen
to Unknown author

Hello again,

here's a quick update, I decided to make a DLL instead. Much easier and cleaner. Making good progress. Will publish when done.

Cheers,
Tobias

PM wrote 29 lines
Hello, I am trying to make an SFTP client class based on putty. It will be open source and I think quite useful for many people, but it looks like I need some help :=) I need to link in over 100 .o files compiled with gcc. I am using the fpc 3.1.1 snapshot on Win64 for now. ISSUE #1: Undefined symbol: fopen this line does not help: function fopen(filename: PAnsiChar; mode: PAnsiChar): Pointer; cdecl; external 'MSVCRT.DLL' name 'fopen'; It works only when I write the function myself using cdecl; export; Can this be fixed? ISSUE #2: Undefined symbol: __imp_isspace Undefined symbol: __imp_GetTickCount and similar ones ... I think gcc added the __imp prefix ... apparently I need to add an import library, but how? Overall the linker errors are not so many and I believe it will eventually work. Cheers, Tobias