How to tell gcc where to find openssl?
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    I wrote a short C program for Linux (Ubuntu 16.10 64bit) and I wanted to see if it would compile and run as expected on MorphOS but... Even though all the OpenSSL include files seem to be part of the SDK, gcc doesn't find them.

    btw This is my source file: https://github.com/Voluntary-zcash/wif_wrangler/blob/master/raw_to_zcash_keypair.c
    PPC assembly ain't so bad... ;)
  • »04.12.16 - 01:06
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    eliot
    Posts: 565 from 2004/4/15
    The includes for open ssl are in:
    GG:ssl/include

    So call the compiler with with gcc -IGG:ssl/include
    You can statically link your binary with gcc -lGG:ssl/lib/ssl -static

    This way it worked:

    Code:

    gcc -c raw_to_zcash_keypair.c -ISystem:Development/GG/ssl/include

    gcc raw_to_zcash_keypair.o -LSystem:Development/GG/ssl/lib -lssl -lcrypto -static -o raw_to_zcash_keypair



    here is the result: bin
    regards
    eliot
  • »04.12.16 - 07:59
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    eliot
    Posts: 565 from 2004/4/15
    Update: look at he solution above.
    regards
    eliot
  • »04.12.16 - 11:38
    Profile
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    Thank you. A couple of things though...

    I've only got v50.10 of the ixemul.library and the binary you created uses v50.17

    That file is huge! And I thought the 14kb linux executable was big... ;) I don't think I've ever created a statically linked program on Amiga / MorphOS. I gather that's the only option here because there's no Amiga / MorphOS style library for these dependencies.
    PPC assembly ain't so bad... ;)
  • »04.12.16 - 19:12
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    Aha. I put off installing the latest SDK while waiting for the next OS release (and planned to do some much needed partition house-keeping at the same time...).

    Edit: Current SDK installed... The MorphOS version of my program creates a private key consistent with the Linux version but the receiving address doesn't match. My guess is this is related to ec.h and / or ripemd.h

    2nd Edit: Disregard the above... I can't reproduce this error - I should have saved the output I thought was wrong.

    [ Edited by ausPPC 12.12.2016 - 07:17 ]
    PPC assembly ain't so bad... ;)
  • »04.12.16 - 19:48
    Profile Visit Website