C cli application build error in Debian

scus's Avatar

scus

09 Apr, 2015 10:11 AM

Hi there,
I am using Debian Jessy and tried to build the C cli application. I am getting the following error:

Building target: mpw...
lib/scrypt/scrypt-crypto_aesctr.o: In function `crypto_aesctr_stream':
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/libcperciva/crypto/crypto_aesctr.c:66: undefined reference to `crypto_aes_encrypt_block'
lib/scrypt/scrypt-sha256.o: In function `insecure_memzero':
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
lib/scrypt/scrypt-sha256.o:/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: more undefined references to `insecure_memzero_ptr' follow
lib/scrypt/scrypt-scryptenc.o: In function `scryptenc_buf':
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/lib/scryptenc/scryptenc.c:338: undefined reference to `crypto_aes_key_expand'
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/lib/scryptenc/scryptenc.c:344: undefined reference to `crypto_aes_key_free'
lib/scrypt/scrypt-scryptenc.o: In function `insecure_memzero':
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
lib/scrypt/scrypt-scryptenc.o: In function `scryptdec_buf':
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/lib/scryptenc/scryptenc.c:401: undefined reference to `crypto_aes_key_expand'
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/lib/scryptenc/scryptenc.c:407: undefined reference to `crypto_aes_key_free'
lib/scrypt/scrypt-scryptenc.o: In function `insecure_memzero':
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
lib/scrypt/scrypt-scryptenc.o: In function `scryptenc_file':
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/lib/scryptenc/scryptenc.c:462: undefined reference to `crypto_aes_key_expand'
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/lib/scryptenc/scryptenc.c:475: undefined reference to `crypto_aes_key_free'
lib/scrypt/scrypt-scryptenc.o: In function `insecure_memzero':
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
lib/scrypt/scrypt-scryptenc.o: In function `scryptdec_file':
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/lib/scryptenc/scryptenc.c:560: undefined reference to `crypto_aes_key_expand'
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/lib/scryptenc/scryptenc.c:587: undefined reference to `crypto_aes_key_free'
lib/scrypt/scrypt-scryptenc.o: In function `insecure_memzero':
/home/username/Downloads/MasterPassword/MasterPassword/C/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
collect2: error: ld returned 1 exit status

I already found http://help.masterpasswordapp.com/help/discussions/problems/183-bui... and tried adding -L/usr/lib/x86_64-linux-gnu to the build command. libssl-dev is installed. Any help is appreciated.

Best regards
scus

  1. 1 Posted by scus on 09 Apr, 2015 10:13 AM

    scus's Avatar

    I forgot to mention: I had no problems building mpw under Ubuntu 14.04 Trusty...

  2. 2 Posted by scus on 09 Apr, 2015 12:11 PM

    scus's Avatar

    I found out the reason (sort of): The scrypt version obtained through svn differs from the version obtained by downloading libscrypt-b12b554.tar.gz. I deinstalled subversion and ran the build script again. Voilá: mpw builds just fine...

  3. 3 Posted by Christoph Roede... on 23 May, 2015 11:44 AM

    Christoph Roeder's Avatar

    Same problem on Ubuntu 15.04

  4. 4 Posted by foo on 11 Aug, 2015 11:58 PM

    foo's Avatar

    Same problem in Debian 7.8.

  5. 5 Posted by Patrick Wozniak on 30 Aug, 2015 01:10 PM

    Patrick Wozniak's Avatar

    Try:

    sed -i '/^svn=/d' ./lib/scrypt/.source
    ./build
    
  6. 6 Posted by Christoph Roede... on 29 Sep, 2015 09:47 AM

    Christoph Roeder's Avatar

    Sorry for my late reply, didn't receive a notification.

    Yes it's working, but the tests did not compile:
    ---
    Building target: mpw-tests...
    mpw-tests-util.o: In Funktion `mpw_xmlTestCaseNode':
    mpw-tests-util.c:(.text+0xc4): Nicht definierter Verweis auf `xmlStrcmp'
    mpw-tests-util.c:(.text+0x109): Nicht definierter Verweis auf `xmlStrcmp'
    mpw-tests-util.c:(.text+0x1a8): Nicht definierter Verweis auf `xmlStrcmp'
    mpw-tests-util.c:(.text+0x1ba): Nicht definierter Verweis auf `xmlFree'
    mpw-tests-util.c:(.text+0x1d0): Nicht definierter Verweis auf `xmlFree'
    mpw-tests-util.o: In Funktion `mpw_xmlTestCaseString':
    mpw-tests-util.c:(.text+0x270): Nicht definierter Verweis auf `xmlNodeGetContent'
    mpw-tests-util.o: In Funktion `mpw_xmlTestCaseInteger':
    mpw-tests-util.c:(.text+0x2af): Nicht definierter Verweis auf `xmlFree'
    /tmp/ccZ3744F.o: In Funktion `main':
    mpw-tests.c:(.text+0x25): Nicht definierter Verweis auf `xmlParseFile'
    mpw-tests.c:(.text+0x2d): Nicht definierter Verweis auf `xmlDocGetRootElement'
    mpw-tests.c:(.text+0x63): Nicht definierter Verweis auf `xmlStrcmp'
    mpw-tests.c:(.text+0x247): Nicht definierter Verweis auf `xmlStrcmp'
    mpw-tests.c:(.text+0x2a3): Nicht definierter Verweis auf `xmlFree'
    mpw-tests.c:(.text+0x2b3): Nicht definierter Verweis auf `xmlFree'
    mpw-tests.c:(.text+0x2c3): Nicht definierter Verweis auf `xmlFree'
    mpw-tests.c:(.text+0x2d3): Nicht definierter Verweis auf `xmlFree'
    mpw-tests.c:(.text+0x2e3): Nicht definierter Verweis auf `xmlFree'
    /tmp/ccZ3744F.o:mpw-tests.c:(.text+0x2f3): Weitere nicht definierte Verweise auf `xmlFree' folgen
    collect2: error: ld returned 1 exit status

  7. Support Staff 7 Posted by Maarten Billemo... on 29 Sep, 2015 11:23 AM

    Maarten Billemont's Avatar

    You need libxml2. The build script should be requesting the compiler to link it in; do you have it available in a standard linker search path?

  8. 8 Posted by Christoph Roede... on 29 Sep, 2015 02:21 PM

    Christoph Roeder's Avatar

    I've libxml2 and libxml2-dev packages installed, so it should work!?

  9. 9 Posted by Patrick Wozniak on 29 Sep, 2015 02:29 PM

    Patrick Wozniak's Avatar

    Or build only the main package:

    targets="mpw" ./build
    
  10. Support Staff 10 Posted by Maarten Billemo... on 29 Sep, 2015 02:31 PM

    Maarten Billemont's Avatar

    It should work if you have libxml2 libraries in your system library search paths for the architectures mpw is built for. I will make no statement to whether "having the libxml2-dev package installed" should make it work. Patrick's suggestion is adequate if you don't care about the tests.

  11. 11 Posted by Mockey on 18 Oct, 2015 08:13 PM

    Mockey's Avatar

    The libxml2 problem is apparently an issue with Ubuntu:
    https://bugs.launchpad.net/ubuntu/+source/libxml2/+bug/1032639
    Moving "${LDFLAGS[@]}" to the end of the linker command makes it work.

  12. 12 Posted by Pietre Arby on 13 Feb, 2016 11:42 PM

    Pietre Arby's Avatar

    Same prob here. I tried everything described above and still no luck. I am not hacker, just ordinary Linux user. Is there any way how to get this work? Is the CLI version still maintained?

    This is my build output:

    Will build targets: mpw...

    Checking dependency: scrypt...

    Building target: mpw...
    lib/scrypt/scrypt-crypto_aesctr.o: In function `crypto_aesctr_stream':
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/libcperciva/crypto/crypto_aesctr.c:66: undefined reference to `crypto_aes_encrypt_block'
    lib/scrypt/scrypt-sha256.o: In function `insecure_memzero':
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
    lib/scrypt/scrypt-sha256.o:/home/zopa/Downloads/masterpassword-cli/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: more undefined references to `insecure_memzero_ptr' follow
    lib/scrypt/scrypt-scryptenc.o: In function `scryptenc_buf':
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/lib/scryptenc/scryptenc.c:338: undefined reference to `crypto_aes_key_expand'
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/lib/scryptenc/scryptenc.c:344: undefined reference to `crypto_aes_key_free'
    lib/scrypt/scrypt-scryptenc.o: In function `insecure_memzero':
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
    lib/scrypt/scrypt-scryptenc.o: In function `scryptdec_buf':
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/lib/scryptenc/scryptenc.c:401: undefined reference to `crypto_aes_key_expand'
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/lib/scryptenc/scryptenc.c:407: undefined reference to `crypto_aes_key_free'
    lib/scrypt/scrypt-scryptenc.o: In function `insecure_memzero':
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
    lib/scrypt/scrypt-scryptenc.o: In function `scryptenc_file':
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/lib/scryptenc/scryptenc.c:462: undefined reference to `crypto_aes_key_expand'
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/lib/scryptenc/scryptenc.c:475: undefined reference to `crypto_aes_key_free'
    lib/scrypt/scrypt-scryptenc.o: In function `insecure_memzero':
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
    lib/scrypt/scrypt-scryptenc.o: In function `scryptdec_file':
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/lib/scryptenc/scryptenc.c:560: undefined reference to `crypto_aes_key_expand'
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/lib/scryptenc/scryptenc.c:587: undefined reference to `crypto_aes_key_free'
    lib/scrypt/scrypt-scryptenc.o: In function `insecure_memzero':
    /home/zopa/Downloads/masterpassword-cli/lib/scrypt/./libcperciva/util/insecure_memzero.h:30: undefined reference to `insecure_memzero_ptr'
    collect2: error: ld returned 1 exit status

  13. Support Staff 13 Posted by Maarten Billemo... on 14 Feb, 2016 12:18 AM

    Maarten Billemont's Avatar

    @Pietre Arby, it looks like you don't have the openssl library in your system's library path.

  14. 14 Posted by Pietre Arby on 14 Feb, 2016 07:55 AM

    Pietre Arby's Avatar

    @Maarten, I have no idea what it needs but ldconfig -p produces this regarding the 'ssl':

    libssl3.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl3.so
    libssl.so.1.0.0 (libc6,x86-64) => /lib/x86_64-linux-gnu/libssl.so.1.0.0
    libssl.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libssl.so
    libgnutls-openssl.so.27 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libgnutls-openssl.so.27

  15. Support Staff 15 Posted by Maarten Billemo... on 15 Feb, 2016 06:48 PM

    Maarten Billemont's Avatar

    That looks like GNUTLS, not OpenSSL. This is likely an issue you should try to resolve with the help of the support forums of your OS/distribution.

    If you are confident you have a library installed which provides the missing symbols, you can attempt to add that library to the linker by adding the library to LDFLAGS before running the build:

    LDFLAGS='-lmylib' ./build

  16. 16 Posted by Geoff Corey on 09 May, 2016 06:11 PM

    Geoff Corey's Avatar

    The solutions from Patrick Wozniak worked for me on Fedora 23. Make sure you start with a clean source and issue these commands. If you tried and build before fixing scrypt it one pull down a new copy. you need to wipe the directory and extract mpw source again.

    ```bash
    sed -i '/^svn=/d' ./lib/scrypt/.source
    ./build
    ```

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

09 Oct, 2023 03:28 PM
09 Oct, 2023 02:56 PM
22 Jun, 2022 11:22 AM
02 Feb, 2022 02:22 PM
25 Jan, 2022 11:25 PM

 

31 Dec, 2021 11:42 AM
22 Dec, 2021 06:41 PM
04 Nov, 2021 01:24 AM
30 Oct, 2021 08:29 PM
21 Oct, 2021 08:44 AM
14 Sep, 2021 08:02 AM