Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: ENET for pascal

  1. #1

    ENET for pascal

    Hello! Anyone managed to use ENET on pascal?
    The problem is, they just give you the C sources, but not a library (dll or so). So it's not just like translating the headers..

    What should one do here? Maybe compiling it and use the .o objects, linking them to the pascal executable?

    http://enet.cubik.org/

    Thanks
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  2. #2

    ENET for pascal

    How about using a C/C++ compiler to first build the library and then link to it like a normal dll/so?

  3. #3

    ENET for pascal

    uhm it's possible. I don't have so much C compiler experience as to build an SO in linux.. And i don't have a windows C compiler
    If anybody have hints on this (maybe how to build an SO), it would be great
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  4. #4

    ENET for pascal

    I prefer translating such code into Pascal, because then you can take advantage of FPC's system independend socket interface, allowing great portability.

    Of course, this might be too much work. In such case, translating the headers is the best option. Instead of linking to a library you link the .o files (use $l instead of $linklib).

  5. #5

    ENET for pascal

    i managed to complile the sources. I obtained some .o files, and a libenet.a:

    host.o
    list.o
    memory.o
    packet.o
    peer.o
    protocol.o
    unix.o
    win32.o
    libenet.a

    the libenet.a looks promising.. is it possible to obtain a libenet.so from it? or use it directly?

    Btw, what's the difference between a .a and a .so file?
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  6. #6

    ENET for pascal

    Simply use the .a, for the compiler .a or .so is the same.

    A .a is a compile time loaded library, a .so is a runtime loaded library.

  7. #7

    ENET for pascal

    ah ok! i'll try at home this evening.
    Btw i found this two sites in google cache:

    This one and this one.

    It looks like someone have already made an header, since the packages list contains:

    enet.dll
    enet.pas
    enet_dyna.pas
    enet_nocrc.dll

    It should be great if i could save writing the headers, but codecentral looks not reachable for me ("Server too busy" they're on .NET framework.. How sad)

    Anyone can reach it or have another link?
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  8. #8

    ENET for pascal

    nevermind, i found the package here:
    http://www.codeway.co.kr/board/bbs/b..._PDS&wr_id=302

    i'll try asap

    (ok, i'm spamming a little )
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  9. #9

    ENET for pascal

    ok, tested! the package works perfectly on windows, so the headers are ok!

    the problem is on linux: when linking the program, it can't find the functions becouse of the name they have, with a "_" at the beginning

    function enet_initialize : integer; cdecl; external enetdll name '_enet_initialize';


    if i change it to:

    function enet_initialize : integer; cdecl; external enetdll name 'enet_initialize';

    it works!
    What can it be? Maybe the functions on the DLL are named differently than on the .a library ?
    If you save your data in a proprietary format, the owner of the format owns your data.
    <br /><A href="http://msx80.blogspot.com">http://msx80.blogspot.com</A>

  10. #10

    ENET for pascal

    Perhaps name mangling...
    Feel the power of Open Source.
    <br />Feel the power of Free Pascal.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •