我正在编写一个Fortran代码,用于绘制一些数据,我遇到以下错误:
<iframe src="https://example.com" width="900" height="800" frameborder="0"></iframe>
错误来自:
Undefined symbols for architecture x86_64:
"_hplots_", referenced from:
_MAIN__ in ifortaBEBFS.o
_clspak_ in ifortaBEBFS.o
_opnpak_ in ifortaBEBFS.o
"_number_", referenced from:
_MAIN__ in ifortaBEBFS.o
(maybe you meant: _for__this_image_number_or_zero)
"_plot_", referenced from:
_MAIN__ in ifortaBEBFS.o
_pltline_ in ifortaBEBFS.o
ld: symbol(s) not found for architecture x86_64
我只是想用ifort或gfortran编译.f代码。
代码来自以下git存储库https://github.com/usgs/finite-fault/blob/db126a5e05dd2ca1950909ac0be9811cfe115019/src/plot/vangodshJ.f
答案 0 :(得分:0)
首先,我没有使用通用映射工具,所以我必须安装它。该程序还需要两个不在同一文件夹中的其他fortran代码,因此将它们移动到同一个文件夹并按如下方式编译它解决了问题。
class Update extends Component {
constructor(props) {
super(props);
const { match } = this.props;
this.state = {
phoneNumber: match.params.phoneNumber,
points: 0,
error: ''
}
}
getPoints = () => {
firebase.auth().onAuthStateChanged((user) => {
if(user) {
const docRef = database.collection('users').doc(user.uid).collection('customers').doc(this.state.phoneNumber);
docRef.get().then((doc) => {
if (doc.exists) {
const points = doc.data().points;
this.setState(() => ({ points }));
console.log(points);
} else {
// doc.data() will be undefined in this case
console.log("No such document!");
const error = 'This phone number is not registered yet...'
this.setState(() => ({ error }));
}
}).catch(function(error) {
console.log("Error getting document:", error);
});
} else {
history.push('/')
}
});
}
componentDidMount() {
if(this.state.phoneNumber) {
this.getPoints();
} else {
return null;
}
}
render() {
return (
<div>
<div>
<p>{this.state.phoneNumber} has {this.state.points} points...</p>
<p>Would you like to redeem or add points?</p>
</div>
<div>
<button>Redeem Points</button>
<button>Add Points</button>
</div>
</div>
);
}
}
export default Update;