Compilation Fails

David Campbell avatarDavid Campbell created an issue

Using the most recent source from hg the make step of the compilation appears to be failing. Below is what I got when I tried it:

$ make
make  all-recursive
make[1]: Entering directory `/home/davekong/code/fdisk'
Making all in m4
make[2]: Entering directory `/home/davekong/code/fdisk/m4'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/home/davekong/code/fdisk/m4'
Making all in po
make[2]: Entering directory `/home/davekong/code/fdisk/po'
make[2]: Leaving directory `/home/davekong/code/fdisk/po'
Making all in src
make[2]: Entering directory `/home/davekong/code/fdisk/src'
gcc -DLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H -I. -I..  -I../lib -I../lib   -g -O2 -D_FILE_OFFSET_BITS=no -MT common.o -MD -MP -MF .deps/common.Tpo -c -o common.o common.c
common.c: In function ‘snap’:
common.c:366:79: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c:366:9: error: ‘PED_ASSERT’ undeclared (first use in this function)
common.c:366:9: note: each undeclared identifier is reported only once for each function it appears in
common.c: In function ‘prefer_snap’:
common.c:402:69: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c:402:9: error: ‘PED_ASSERT’ undeclared (first use in this function)
common.c:434:48: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c: In function ‘snap_to_boundaries’:
common.c:496:61: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c:496:9: error: ‘PED_ASSERT’ undeclared (first use in this function)
common.c:507:60: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c:513:58: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c:524:79: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c:525:77: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c:527:72: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c: In function ‘get_disk_type’:
common.c:940:38: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c:940:2: error: ‘PED_ASSERT’ undeclared (first use in this function)
common.c: In function ‘perform_mkpart’:
common.c:1622:54: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c:1622:9: error: ‘PED_ASSERT’ undeclared (first use in this function)
common.c:1625:53: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
common.c:1714:79: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1
make[2]: *** [common.o] Error 1
make[2]: Leaving directory `/home/davekong/code/fdisk/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/davekong/code/fdisk'
make: *** [all] Error 2

Comments (3)

  1. Anonymous

    At first I was getting this error,

    common.c: In function ‘_get_aligned_device_constraint’:
    common.c:183: warning: return makes pointer from integer without a cast
    common.c:185: warning: return makes pointer from integer without a cast
    common.c: In function ‘_is_partition_aligned’:
    common.c:223: warning: assignment makes pointer from integer without a cast
    common.c:226: warning: assignment makes pointer from integer without a cast
    common.c: In function ‘init_disk_flags’:
    common.c:626: error: ‘PED_DISK_CYLINDER_ALIGNMENT’ undeclared (first use in this function)
    common.c:626: error: (Each undeclared identifier is reported only once
    common.c:626: error: for each function it appears in.)
    make[2]: *** [common.o] Error 1
    make[2]: Leaving directory `/home/vikram/Desktop/Gnufdisk/fdisk/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/vikram/Desktop/Gnufdisk/fdisk'
    make: *** [all] Error 2
    

    Then after a little search I got this link http://volker-dietze.dnsalias.net/Computer/Docu/Linux/packages/parted/NEWS which said that the define is true.

    libparted: new per disk flag: PED_DISK_CYLINDER_ALIGNMENT. This flag
    (which defaults to true)
    

    After that change, I am getting another undefined reference error.

    gcc  -g -O2 -D_FILE_OFFSET_BITS=64   -o fdisk main.o command.o fdisk.o common.o hacks.o strlist.o ui.o -lparted -luuid  -ldl -ltermcap
    common.o: In function `_get_aligned_device_constraint':
    /home/vikram/Desktop/Gnufdisk/fdisk/src/common.c:186: undefined reference to `ped_device_get_minimal_aligned_constraint'
    /home/vikram/Desktop/Gnufdisk/fdisk/src/common.c:184: undefined reference to `ped_device_get_optimal_aligned_constraint'
    common.o: In function `init_disk_flags':
    /home/vikram/Desktop/Gnufdisk/fdisk/src/common.c:627: undefined reference to `ped_disk_is_flag_available'
    /home/vikram/Desktop/Gnufdisk/fdisk/src/common.c:628: undefined reference to `ped_disk_set_flag'
    common.o: In function `_is_partition_aligned':
    /home/vikram/Desktop/Gnufdisk/fdisk/src/common.c:224: undefined reference to `ped_device_get_optimum_alignment'
    common.o: In function `_partition_warn_unaligned':
    /home/vikram/Desktop/Gnufdisk/fdisk/src/common.c:227: undefined reference to `ped_device_get_minimum_alignment'
    collect2: ld returned 1 exit status
    make[2]: *** [fdisk] Error 1
    make[2]: Leaving directory `/home/vikram/Desktop/Gnufdisk/fdisk/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/vikram/Desktop/Gnufdisk/fdisk'
    make: *** [all] Error 2
    

    I am using Ubuntu 9.10 with "parted (GNU parted) 1.8.8.1.159-1e0e"

    Any ideas?

  2. Anonymous

    The PED_ASSERT makro in parted 2.4 was changed and now only takes a single argument instead of two. Currently fdisk still gives a second argument (second argument is always "return 0" which is the default behaviour in parted now).

    This can lead to compile errors together with parted 2.4 as seen in the first post: common.c:366:79: error: macro "PED_ASSERT" passed 2 arguments, but takes just 1 ...

    I guess all occurrences of PED_ASSERT in fdisk need the second argument removed like parted did in their code: http://anonscm.debian.org/gitweb/?p=parted/parted.git;a=commit;h=81c82ad7d495c983abe1ccb8bf983d9949854f80

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.