Sign in Join

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

Mailing lists / fpc-pascal / 2001-09

FPC + GCC... Again :-)

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

Hi friends :-)

I getting some problems while trying to link both together.

I guess this time the problem is with my gcc. By the way, anybody knows where can I find a good list on this compiler?

But please, only once more :-)
I'm trying to write some functions in C that will "talk" to my serial port and provide a high level interface to a program write in freepascal. I've already solved the problems with variable and function export/inport (thank you all for that ;-)

My problem is with the C function open(), when I link my source only with gcc it works but whem I try to link it with fpc and run the program it always returns a NULL file descriptor. I guess the problem could be with the linklib directive... maybe the open function is not inside the libc ({$linklib c}) ... but if not , where can I find it?

Or maybe I'm on the wrong way... please, can you tell me whats wrogn?

TKS

Mauricio Stefani

Hi, I found the error :-)

It was a silly parameter passing (duh)...
Finally it's 100% working. I'm going home right now but, I got two "libs" working (one in FPC and other in C, with CRC16, RS485 electrical line compatibilty etc) and I really would like to put it somewhere acessible and share it with everyone.

I don't remember the names now but some people asked me samples... where can I upload the sources? Is there a way to put website?

Thank you very much :-)

Show quoted text 24 lines
>Hi friends :-) > >I getting some problems while trying to link both together. > >I guess this time the problem is with my gcc. By the way, anybody knows where can I find a good list on this compiler? > >But please, only once more :-) >I'm trying to write some functions in C that will "talk" to my serial port and provide a high level interface to a program write in freepascal. I've already solved the problems with variable and function export/inport (thank you all for that ;-) > >My problem is with the C function open(), when I link my source only with gcc it works but whem I try to link it with fpc and run the program it always returns a NULL file descriptor. I guess the problem could be with the linklib directive... maybe the open function is not inside the libc ({$linklib c}) ... but if not , where can I find it? > >Or maybe I'm on the wrong way... please, can you tell me whats wrogn? > >TKS > > > > > >_______________________________________________ >fpc-pascal maillist - >http://lists.freepascal.org/mailman/listinfo/fpc-pascal > >.