Recent

Author Topic: Synapse echo demo & dynlibs - am I doing the right thing?  (Read 5415 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Synapse echo demo & dynlibs - am I doing the right thing?
« on: October 14, 2011, 07:01:50 pm »
Windows x64, x32 compiler (Lazarus 0.9.31 recent SVN, FPC fixes_2_6 recent SVN)
Synapse SVN (recent)
I downloaded the Synapse demo programs from the stable distribution and converted the echo Delphi demo.

Directories:
synapse => contains sources such as asn1util.pas
synapse\demo=>demo projects
synapse\demo\echo => the one I'm working with

The converter complained it couldn't find some units; I specified the synapse directory and it seemed to work.

On compiling I got an error in sswin32.inc: could not find LoadLibrary.
So I added:

Code: [Select]
implementation
{$IFDEF FPC}
uses dynlibs;
{$ENDIF} 
Did I do the right thing? Should I have compiled & added the laz_synapse.lpk package in Lazarus?
The code does run and provides an echo server on port 8008.

If I did do the right thing, I suppose I'll have to send this as a patch to Synapse....

Thanks.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12905
  • FPC developer.
Re: Synapse echo demo & dynlibs - am I doing the right thing?
« Reply #1 on: October 14, 2011, 10:50:09 pm »
I think that is the wrong thing to do. Probably some define somewhere in synapse is "win32" which should be "mswindows" so that it covers both win32 AND win64.

Dynlibs works, but it is not the elegant solution, or I solution I would propagate back to synapse. win64 has loadlibrary in its unit windows, but somehow the synapse code fails to use it.

But probably they have to change that anyway now because of Delphi XE2.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Synapse echo demo & dynlibs - am I doing the right thing?
« Reply #2 on: October 15, 2011, 11:50:16 am »
I think that is the wrong thing to do. Probably some define somewhere in synapse is "win32" which should be "mswindows" so that it covers both win32 AND win64.
Thanks marco, but I'm using the x86 compiler so presumably that wouldn't bite me?

In any case, as you say, they'll have to change stuff for Delphi XE2 anway ;)
(Can't remember: does XE2 use FPC for Windows x64 or only for IOS/OSX?)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

 

TinyPortal © 2005-2018