!strcmp(语言环境,“ C”):错误:声明失败:在文件baseapi.cpp中,第209行

时间:2018-12-03 09:44:55

标签: java intellij-idea compiler-errors tess4j

用于运行Tess4j的示例代码已在“ http://tess4j.sourceforge.net/codesample.html”中给出,但是它是在Mac OS中以intellij执行的,错误消息是A fatal error has been detected by the Java Runtime Environment: SIGILL (0x4) at pc=0x000000012183ca4f, pid=44026, tid=0x0000000000001903 JRE version: Java(TM) SE Runtime Environment (8.0_144-b01) (build 1.8.0_144-b01) Java VM: Java HotSpot(TM) 64-Bit Server VM (25.144-b01 mixed mode bsd-amd64 compressed oops) Problematic frame: C [libtesseract.dylib+0x156a4f] ERRCODE::error(char const*, TessErrorLogCode, char const*, ...) const+0x183 并带有以下消息:

class Item {

  id : string
  hasUnreadData : boolean

  constructor (data: any) {
    this.id = data.id;
    // false by default
    this.hasUnreadData = data.hasUnreadData;
  }

}

@observable items: Item[];

// observes the array and re-renders when items are added/removed (this works)
@observer
class ItemListComponent extends React.Component {
  render() {
    return (
      <List> {
        items.map((item: Item, index) => {

          <ItemComponent key={item.id} itemModel={item} />

        }
      }
    )
  }
}

// should observe the 'hasUnreadData' flag and apply different styles when it re-renders (but this does not work, it only displays the initial state)
@observer
class ItemComponent extends React.Component {
  render() {
    const item = this.props.item;
    return (
      <ListItem button divider selected={item.hasUnreadData} />
    )

  }
}


// imagine this is a promise from an API call
API.fetchData().then((itemId: string) => {
  itemToUpdate = items.find(i => i.id === itemId);
  itemToUpdate.hasUnreadData = true; 
  // this does not trigger the ItemComponent to render again as expected.
});

通过阅读以上文章,导出LC_ALL = C似乎是一个问题,但是不确定在给出的示例代码中,应该添加/修改哪些确切的代码才能使该示例运行? / p>

1 个答案:

答案 0 :(得分:0)

在终端中输入export LC_ALL=C后,在同一终端窗口中打开IDE。在其他终端上运行IDE /代码将不起作用。