1

我从gnu 的 ftp获得了 ncurses-5.9 ,提取并更改了 dir 到 ncurse 目录并执行此操作:

mkdir build && cd build
../configure --prefix=/usr/local/GNU-CROSS/ncurses-6.0/ CC="clang -fembed-bitcode -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -Wno-error -Wno-implicit-function-declaration -mios-version-min=8.4 -no-integrated-as -arch armv7 -target armv7-apple-darwin" CPP="clang -E" CPPFLAGS="-fembed-bitcode -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk -Wno-error -Wno-implicit-function-declaration -mios-version-min=8.4 -no-integrated-as -arch armv7 -target armv7-apple-darwin" --host=armv7-apple-darwin --with-widec

配置进行得很顺利,但make -j 4触发了这个:

In file included from ../../c++/cursesf.cc:35:
../../c++/cursesf.h:684:7: error: no matching constructor for initialization of
      'NCursesForm'
    : NCursesForm (Fields, with_frame, autoDelete_Fields) {
      ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../c++/cursesf.h:420:3: note: candidate constructor not viable: no known
      conversion from 'NCursesFormField *' to 'NCursesFormField **' for 1st
      argument; take the address of the argument with &
  NCursesForm (NCursesFormField* Fields[],
  ^
../../c++/cursesf.h:404:3: note: candidate constructor not viable: no known
      conversion from 'NCursesFormField *' to 'int' for 1st argument
  NCursesForm( int  nlines,
  ^
../../c++/cursesf.h:462:3: note: candidate constructor not viable: requires
      single argument 'rhs', but 3 arguments were provided
  NCursesForm(const NCursesForm& rIn file included from ../../c++/cursesm.cc:35:
../../c++/cursesm.h:642:7: error: no matching constructor for initialization of
      'NCursesMenu'
    : NCursesMenu (Items, with_frame, autoDelete_Items) {
      ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../c++/cursesm.h:281:3: note: candidate constructor hs)
  ^
../../c++/cursesf.h:435:3: note: candidate constructor not viable: requires at
      least 5 arguments, but 3 were provided
  NCursesForm (NCursesFormField* Fields[],
  ^
not viable: no known
      conversion from 'NCursesMenuItem *' to 'NCursesMenuItem **' for 1st
      argument; take the address of the argument with &
  NCursesMenu (NCursesMenuItem* Items[],
  ^
../../c++/cursesf.h:697:7: ../../c++/cursesm.h:296error:: 3: no matchingnote : constructor candidatefor  constructorinitialization  notof 
viable:       'NCursesForm'no 
known
      conversion from 'NCursesMenuItem *' to 'NCursesMenuItem **' for 1st
      argument; take the address of the argument with &
  NCursesMenu (NCursesMenuItem* Items[],
  ^
../../c++/cursesm.h:265:3: note: candidate constructor not viable: no known
      conversion from 'NCursesMenuItem *' to 'int' for 1st argument
  NCursesMenu( int  nlines,
  ^
../../c++/cursesm.h:323:3: note: candidate constructor not viable: requires
      single argument 'rhs', but 3 arguments were provided
  NCursesMenu(const NCursesMenu& rhs)
  ^
../../c++/cursesm.h:654:7: error: no matching constructor for initialization of
      'NCursesMenu'
    : NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
      ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) {
      ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../c++/cursesf.h:435:3: note: ../../c++/cursesm.hcandidate: 296constructor: 3not:  viable: nonote : known
candidate       conversionconstructor  fromnot  'NCursesFormField *'viable:  tono  'NCursesFormField **'known 
for       conversion1st 
from       argument;'NCursesMenuItem *'  taketo  the'NCursesMenuItem **'  addressfor  of1st 
the       argument;argument  takewith  the& address
 of the argument with &
  NCursesForm (NCursesFormField* Fields[],
  ^
  NCursesMenu (NCursesMenuItem* Items[],
  ^
../../c++/cursesf.h:404:3: note: candidate constructor not viable: requires at
      most 4 arguments, but 7 were provided
  NCursesForm( int  nlines,
  ^
../../c++/cursesf.h:420:3: note: candidate constructor not viable: requires at
      most 3 arguments, but 7 were provided
  NCursesForm (NCursesFormField* Fields[],
  ^
../../c++/cursesf.h:462:3: note: candidate constructor not viable: requires
      single argument 'rhs', but 7 arguments were provided
  NCursesForm(const NCursesForm& rhs)
  ^
../../c++/cursesm.h:265:3: note: candidate constructor not viable: requires at
      most 4 arguments, but 6 were provided
  NCursesMenu( int  nlines,
  ^
../../c++/cursesm.h:281:3: note: candidate constructor not viable: requires at
      most 3 arguments, but 6 were provided
  NCursesMenu (NCursesMenuItem* Items[],
  ^
../../c++/cursesm.h:323:3: note: candidate constructor not viable: requires
      single argument 'rhs', but 6 arguments were provided
  NCursesMenu(const NCursesMenu& rhs)
  ^
2 errors generated.
make[1]: *** [../objects/cursesm.o] Error 1
make[1]: *** Waiting for unfinished jobs....
2 errors generated.
make[1]: *** [../objects/cursesf.o] Error 1
make: *** [all] Error 2

我挖了一下,发现了这个:https ://gist.github.com/akisute/7227384这让我编辑了configure脚本并评论了以下几行:

    if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then
        { { echo "$as_me:4429: error: Cross-build requires two compilers.
Use --with-build-cc to specify the native compiler." >&5
echo "$as_me: error: Cross-build requires two compilers.
Use --with-build-cc to specify the native compiler." >&2;}
   { (exit 1); exit 1; }; }
    fi

然后我configure又做了一次make -j 4,触发了同样的错误:

In file included from ../../c++/cursesf.cc:35:
../../c++/cursesf.h:684:7: error: no matching constructor for initialization of
      'NCursesForm'
    : NCursesForm (Fields, with_frame, autoDelete_Fields) {
      ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../c++/cursesm.cc:35:
../../c++/cursesm.h:642:7: error: no matching constructor for initialization of
      'NCursesMenu'
    : NCursesMenu (Items, with_frame, autoDelete_Items) {
      ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../c++/cursesf.h../../c++/cursesm.h::420281::33::  notenote: : candidatecandidate  constructorconstructor  notnot  viable:viable:  nono  knownknown

            conversionconversion  fromfrom  'NCursesFormField *''NCursesMenuItem *'  toto  'NCursesFormField **''NCursesMenuItem **'  forfor  1st1st

            argument;argument;  taketake  thethe  addressaddress  ofof  thethe  argumentargument  withwith  &&

  NCursesForm (NCursesFormField* Fields[],
  NCursesMenu (NCursesMenuItem* Items[],
  ^
  ^
../../c++/cursesm.h:296:3: note: candidate constructor not viable: no known
      conversion from 'NCursesMenuItem *' to 'NCursesMenuItem **' for 1st
      argument; take the address of the argument with &
  NCursesMenu (NCursesMenuItem* Items[],
  ^
../../c++/cursesm.h:265:3:../../c++/cursesf.h :404:note3::  candidate noteconstructor:  notcandidate  viable:constructor  nonot  knownviable:
       noconversion  knownfrom
       'NCursesMenuItem *'conversion  tofrom  'int''NCursesFormField *'  forto  1st'int'  argumentfor 
1st argument
  NCursesMenu( int  nlines,
  ^  NCursesForm( int  nlines,

  ^
../../c++/cursesm.h:323../../c++/cursesf.h::3462:: 3: note: notecandidate:  constructorcandidate  notconstructor  viable:not  requiresviable:
       requiressingle
       argumentsingle  'rhs',argument  but'rhs',  3but  arguments3  werearguments  providedwere 
provided
  NCursesMenu(const NCursesMenu& rhs)
  NCursesForm(const NCursesForm& rhs)
  ^
  ^
../../c++/cursesf.h:435:3: note: candidate constructor not viable: requires at
      least 5 arguments, but 3 were provided
  NCursesForm (NCursesFormField* Fields[],
  ^
../../c++/cursesm.h:654:7: error: no matching constructor for initialization of
      'NCursesMenu'
../../c++/cursesf.h:697:7: error: no matching constructor for initialization of
      'NCursesForm'
    : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) {
      ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    : NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
      ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../c++/cursesm.h:296:3: note: candidate constructor not viable: no ../../c++/cursesf.hknown:
435      :conversion3 :from  'NCursesMenuItem *' noteto:  'NCursesMenuItem **'candidate  forconstructor  1stnot
       viable:argument;  notake  knownthe
       addressconversion  offrom  the'NCursesFormField *'  argumentto  with'NCursesFormField **'  &for 
1st
      argument; take the address of the argument with &  NCursesMenu (NCursesMenuItem* Items[],

  ^
../../c++/cursesm.h:265:3:   NCursesForm (NCursesFormField* Fields[],note
:   ^candidate
 constructor not viable: requires at
../../c++/cursesf.h      :most404 :43 :arguments,  but note6:  werecandidate  providedconstructor 
not viable: requires at
      most 4   NCursesMenu( int  nlines,arguments,
 but  ^ 
7 were provided
../../c++/cursesm.h:281:3: note: candidate constructor  NCursesForm( int  nlines, 
not   ^viable:
 requires at
      most 3../../c++/cursesf.h :arguments,420 :but3 :6  were noteprovided: 
candidate constructor not viable: requires at
      most 3 arguments, but  NCursesMenu (NCursesMenuItem* Items[], 
7   ^were
 provided
../../c++/cursesm.h:323:3: note: candidate constructor   NCursesForm (NCursesFormField* Fields[],not
 viable:  ^ 
requires
      single argument 'rhs', ../../c++/cursesf.hbut: 4626: 3arguments:  were providednote: 
candidate constructor not viable: requires
      single argument 'rhs', but  NCursesMenu(const NCursesMenu& rhs) 
7   ^arguments
 were provided
  NCursesForm(const NCursesForm& rhs)
  ^
2 errors generated.
2 errors generated.
make[1]: *** [../objects/cursesm.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [../objects/cursesf.o] Error 1
make: *** [all] Error 2

我怎么能防止这种情况?

4

1 回答 1

0

不久前,在 5.9 发布后不久,该问题已修复(请参阅有关 clang 在20122011中的说明)。

6.0 是当前版本(自2015 年8 月起)。

于 2015-11-01T16:55:08.710 回答