Menu

#18 Driver failing to compile. make: *** [default] Error 2

v1.0 (example)
open
None
5
2016-03-20
2015-12-23
No

Compilation failing on multiple different systems with this same error.

/~/~/trunk/audio.c:1:9: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘<’ token include ^ /~/~/trunk/audio.c: In function ‘line6_init_audio’: /~/~/trunk/audio.c:28:2: error: implicit declaration of function ‘snd_card_create’ [-Werror=implicit-function-declaration] err = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, ^ cc1: some warnings being treated as errors make[2]: [/home/marlon/trunk/audio.o] Error 1 make[1]: [module/home/marlon/trunk] Error 2 make[1]: se sale del directorio «/usr/src/linux-headers-3.19.0-25-generic» make: *** [default] Error 2

Discussion

  • Tobias Förster

    Tobias Förster - 2015-12-30

    I get similar error messages. This is the output of make (in German):

    ./set_revision.sh
    ./set_revision.sh: 9: test: http://svn.code.sf.net/p/line6linux/code/driver/trunk: unexpected operator
    make -C /lib/modules/3.13.0-74-generic/build CONFIG_LINE6_USB=m SUBDIRS=/home/tobe/line6linux-code/driver/trunk modules
    make[1]: Verzeichnis »/usr/src/linux-headers-3.13.0-74-generic« wird betreten
      CC [M]  /home/tobe/line6linux-code/driver/trunk/driver.o
    In file included from /home/tobe/line6linux-code/driver/trunk/driver.c:24:0:
    /home/tobe/line6linux-code/driver/trunk/revision.h:3:25: warning: missing terminating " character [enabled by default]
     #define DRIVER_REVISION " (revision http://svn.code.sf.net/p/line6linux/code/driver/trunk
                             ^
    /home/tobe/line6linux-code/driver/trunk/revision.h:4:10: error: expected =, ,, ;, asm or __attribute__ before ^ token
     Relative ^/driver/trunk@1085)"
              ^
    /home/tobe/line6linux-code/driver/trunk/revision.h:4:24: error: stray @ in program
     Relative ^/driver/trunk@1085)"
                            ^
    /home/tobe/line6linux-code/driver/trunk/revision.h:4:30: warning: missing terminating " character [enabled by default]
     Relative ^/driver/trunk@1085)"
                                  ^
    /home/tobe/line6linux-code/driver/trunk/revision.h:4:10: error: missing terminating " character
     Relative ^/driver/trunk@1085)"
              ^
    In file included from /home/tobe/line6linux-code/driver/trunk/driver.c:25:0:
    /home/tobe/line6linux-code/driver/trunk/toneport.h:39:18: warning: struct usb_line6_toneport declared inside parameter list [enabled by default]
               struct usb_line6_toneport *toneport);
                      ^
    /home/tobe/line6linux-code/driver/trunk/toneport.h:39:18: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
    /home/tobe/line6linux-code/driver/trunk/toneport.h:40:48: warning: struct usb_line6_toneport declared inside parameter list [enabled by default]
     extern void line6_toneport_reset_resume(struct usb_line6_toneport *toneport);
                                                    ^
    /home/tobe/line6linux-code/driver/trunk/driver.c: In function line6_probe:
    /home/tobe/line6linux-code/driver/trunk/driver.c:758:17: error: invalid application of sizeof to incomplete type struct usb_line6_toneport
       size = sizeof(struct usb_line6_toneport);
                     ^
    /home/tobe/line6linux-code/driver/trunk/driver.c:927:14: warning: passing argument 2 of line6_toneport_init from incompatible pointer type [enabled by default]                                                                                                         
          (struct usb_line6_toneport *)line6);                                                                                           
                  ^                                                                                                                      
    In file included from /home/tobe/line6linux-code/driver/trunk/driver.c:25:0:                                                         
    /home/tobe/line6linux-code/driver/trunk/toneport.h:38:12: note: expected struct usb_line6_toneport * but argument is of type struct usb_line6_toneport *                                                                                                              
     extern int line6_toneport_init(struct usb_interface *interface,                                                                     
                ^                                                                                                                        
    /home/tobe/line6linux-code/driver/trunk/driver.c: In function line6_reset_resume:                                                  
    /home/tobe/line6linux-code/driver/trunk/driver.c:1110:39: warning: passing argument 1 of line6_toneport_reset_resume from incompatible pointer type [enabled by default]                                                                                                
       line6_toneport_reset_resume((struct usb_line6_toneport *)line6);                                                                  
                                           ^                                                                                             
    In file included from /home/tobe/line6linux-code/driver/trunk/driver.c:25:0:                                                         
    /home/tobe/line6linux-code/driver/trunk/toneport.h:40:13: note: expected struct usb_line6_toneport * but argument is of type struct usb_line6_toneport *                                                                                                              
     extern void line6_toneport_reset_resume(struct usb_line6_toneport *toneport);                                                       
                 ^                                                                                                                       
    /home/tobe/line6linux-code/driver/trunk/driver.c: At top level:                                                                      
    /home/tobe/line6linux-code/driver/trunk/driver.c:1135:1: error: missing terminating " character                                      
     MODULE_VERSION(DRIVER_VERSION);                                                                                                     
     ^                                                                                                                                   
    make[2]: *** [/home/tobe/line6linux-code/driver/trunk/driver.o] Fehler 1                                                             
    make[1]: *** [_module_/home/tobe/line6linux-code/driver/trunk] Fehler 2                                                              
    make[1]: Verzeichnis »/usr/src/linux-headers-3.13.0-74-generic« wird verlassen
    make: *** [default] Fehler 2
    
     
  • Tobias Förster

    Tobias Förster - 2015-12-30

    First of all, to make clear what I am talking about, this is the content of set_revision.sh:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    #!/bin/sh
    
    echo "#ifndef DRIVER_REVISION" > revision_new.h
    
    if info=$(svn info . 2> /dev/null); then
        echo "/* current subversion revision */" >> revision_new.h
        url=$(echo "$info" | grep 'URL:' | sed 's/URL: //')
        version=$(svnversion)
        if test $url == "https://line6linux.svn.sourceforge.net/svnroot/line6linux/driver/trunk"; then
        revision="$version"
        else
        revision="$url@$version"
        fi
        echo "#define DRIVER_REVISION \" (revision $revision)\"" >> revision_new.h
    else
        echo "/* current subversion revision not available */" >> revision_new.h
        echo "#define DRIVER_REVISION \"\"" >> revision_new.h
    fi
    
    echo "#endif" >> revision_new.h
    
    if diff --brief revision.h revision_new.h > /dev/null 2>&1; then
        rm -f revision_new.h
    else
        mv revision_new.h revision.h
    fi
    

    I could solve my problem: The actual problem was that in set_revision.sh, we grep the url from the output of "svn info", which in my case (German) is

    Pfad: .
    Wurzelpfad der Arbeitskopie: /home/tobe/line6linux-code
    URL: http://svn.code.sf.net/p/line6linux/code/driver/trunk
    Relative URL: ^/driver/trunk
    Basis des Projektarchivs: http://svn.code.sf.net/p/line6linux/code
    UUID des Projektarchivs: 87a33c3d-1c25-0410-a0e4-a977fe0255b3
    Revision: 1085
    Knotentyp: Verzeichnis
    Plan: normal
    Letzter Autor: mgrabner
    Letzte geänderte Rev: 1069
    Letztes Änderungsdatum: 2013-08-31 23:39:07 +0200 (Sa, 31. Aug 2013)
    

    The variavble url in set_revision.sh is set by

    url=$(echo "$info" | grep 'URL:' | sed 's/URL: //')
    

    Hence, url is given a wrong value, namely

    tobe@tobe-PC:~/line6linux-code/driver/trunk$ echo $url
    http://svn.code.sf.net/p/line6linux/code/driver/trunk Relative ^/driver/trunk
    

    For me, the solution was so to change line 7 of set_revision.sh from

    url=$(echo "$info" | grep 'URL:' | sed 's/URL: //')
    

    to

    url="http://svn.code.sf.net/p/line6linux/code/driver/trunk"
    

    Of course, this can not work globally. One would have to change the command properly such that the correct URL is grepped from the output of svn info. Moreover, the if-statement in line 9, where the value of url is tested, should probably not be tested with

    if test $url == "https://line6linux.svn.sourceforge.net/svnroot/line6linux/driver/trunk";
    

    but rather with

    if test $url == "http://svn.code.sf.net/p/line6linux/code/driver/trunk";
    
     

    Last edit: Tobias Förster 2015-12-30
  • Matt Cadusch

    Matt Cadusch - 2016-01-13

    Hi Tobias,

    Thanks for that. I tried doing that, but I keep getting the same errors.
    This my modified set_revision.sh:

    !/bin/sh

    echo "#ifndef DRIVER_REVISION" > revision_new.h

    if info=$(svn info . 2> /dev/null); then
    echo "/ current subversion revision /" >> revision_new.h
    url="http://svn.code.sf.net/p/line6linux/code/driver/trunk";
    version=$(svnversion)
    if test $url == "http://svn.code.sf.net/p/line6linux/code/driver/trunk"; then
    revision="$version"
    else
    revision="$url@$version"
    fi
    echo "#define DRIVER_REVISION \" (revision $revision)\"" >> revision_new.h
    else
    echo "/ current subversion revision not available /" >> revision_new.h
    echo "#define DRIVER_REVISION \"\"" >> revision_new.h
    fi

    echo "#endif" >> revision_new.h

    if diff --brief revision.h revision_new.h > /dev/null 2>&1; then
    rm -f revision_new.h
    else
    mv revision_new.h revision.h
    fi

    And this is the error message from make:

    ./set_revision.sh
    ./set_revision.sh: 9: test: http://svn.code.sf.net/p/line6linux/code/driver/trunk: unexpected operator
    make -C /lib/modules/3.19.0-25-lowlatency/build CONFIG_LINE6_USB=m SUBDIRS=/home/largefinger/code/driver/trunk modules
    make[1]: Entering directory /usr/src/linux-headers-3.19.0-25-lowlatency' CC [M] /home/largefinger/code/driver/trunk/audio.o /home/largefinger/code/driver/trunk/audio.c: In function ‘line6_init_audio’: /home/largefinger/code/driver/trunk/audio.c:27:2: error: implicit declaration of function ‘snd_card_create’ [-Werror=implicit-function-declaration] err = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1, ^ cc1: some warnings being treated as errors make[2]: *** [/home/largefinger/code/driver/trunk/audio.o] Error 1 make[1]: *** [_module_/home/largefinger/code/driver/trunk] Error 2 make[1]: Leaving directory/usr/src/linux-headers-3.19.0-25-lowlatency'
    make: *** [default] Error 2

    I can't seem to spot any errors and the svn address appears to be the same for me. It's got me stumpe. Thanks again.

     
  • lhtd

    lhtd - 2016-03-20

    Hello everybody,

    I have the same error as Matt. Have you found a way to get through it ? I Copied and tried both versions, Matt's and Tobias' for the file revision.sh.

    I executed make -d to have some extra details about the error. It just doesn't like the impicit déclaration of a function in the fileaudio.c.

    Concerning the error baout the svn adress, both revision.sh files cause the same message:
    ./set_revision.sh: 9: test: svn://svn.code.sf.net/p/line6linux/code/driver/trunk: unexpected operator.

    I would like to help more but i'm not a C programmer.

    Hope this helps solve the problem

     
  • Jean-Michaël Celerier

    Hello,

    I could get it to build with a recent linux (4.5) by changing audio.c lines 27/28 from this :

    err = snd_card_create(SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
                  THIS_MODULE, 0, &card);
    

    to this :

    err = snd_card_new(&line6->usbdev->dev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1,
               THIS_MODULE, 0, &card);
    

    Sadly my dmesg then tells me :

    [70222.724451] usbcore: registered new interface driver line6usb
    [70224.173164] line6usb 1-1:1.0: Line6 POD X3 Live now disconnected
    [70224.173237] line6usb 1-1:1.1: Line6 POD X3 Live now disconnected
    [70226.038138] line6usb 1-1:1.0: Line6 POD X3 Live found
    [70226.038755] line6usb 1-1:1.0: Line6 POD X3 Live now attached
    [70226.038757] line6usb 1-1:1.0: NOTE: the Line6 POD X3 Live is detected, but not yet supported
    
     

    Last edit: Jean-Michaël Celerier 2016-03-20
  • lhtd

    lhtd - 2016-03-20

    Thank you Jean-Michaël,

    Your solution allowed to pas over that error. Now i'm on an error on driver.c at the last line 1135: missing terminating " character MODULE_VERSION(DRIVER_VERSION);

    After I corrected the set_revision.sh file as proposed by Tobias it went smoothly

    I'm using the kernel 4.4.0-13-generic, It's the latest on the repositories -i'm a bit of a noob-.

    Jean-Michaël, the note you are getting comes from driver.c lines 948-954, Maybe it can help you.

    I can use my line6 UX1 pod, even before installing this drivers, but the return on the headset is all digital crunchy. I cannot listen to what I play as I record. The recording is just as good as before installing it :-S

    Thank you very much for your help

     

    Last edit: lhtd 2016-03-20

Log in to post a comment.