在Eclipse CDT

时间:2016-07-16 15:29:10

标签: c++ eclipse netbeans makefile eclipse-cdt

我希望(暂时)将C ++项目从Netbeans迁移到Eclipse(为了使用Eclipse的并行调试器)。到目前为止,我已经使用现有代码"创建了一个" Makefile项目。 Eclipse中的项目,它引用了Netbeans项目的Makefile /目录。但是,Netbeans项目接受配置选项,例如

make -f Makefile CONF=GNU_Debug

如何将此选项传递给Eclipse中的Makefile?

Eclipse版 Eclipse for Parallel Application Developers - Mars.2 Release(4.5.2)

2 个答案:

答案 0 :(得分:2)

您可以在项目属性对话框中更改默认的make调用:

enter image description here

我的版本:

  

版本:Mars.1发布(4.5.1)

请注意,import React, { PropTypes } from 'react'; import { AppRegistry, ListView, PanResponder, StyleSheet, Text, TouchableOpacity, View, } from 'react-native'; class LongPressDrag extends React.Component { constructor() { super(); this._panResponder = PanResponder.create({ onStartShouldSetPanResponder: this._handleStartShouldSetPanResponder.bind(this), onMoveShouldSetPanResponder: this._handleMoveShouldSetPanResponder.bind(this), onPanResponderMove: this._handlePanResponderMove.bind(this), onPanResponderRelease: this._handlePanResponderEnd.bind(this), onPanResponderTerminate: this._handlePanResponderEnd.bind(this), }); this._previousLeft = 0; this._previousTop = 0; this._floatingStyles = { style: { left: this._previousLeft, top: this._previousTop, position: 'absolute', height: 40, width: 100, backgroundColor: 'white', justifyContent: 'center', } }; const rows = Array(11).fill(11).map((a, i) => i); this.state = { dataSource: new ListView.DataSource({ rowHasChanged: (row1, row2) => row1 !== row2, }).cloneWithRows(rows), nativeEvent: undefined, //Pan Responder can screw with scrolling. See https://github.com/facebook/react-native/issues/1046 scrollEnabled: true, } } getDragElement() { if (!this.state.nativeEvent) { return null; } return ( <View style={[this._floatingStyles.style, {top: this._previousTop, left: this._previousLeft} ]} ref={(floating) => { this.floating = floating; }} > <Text style={{alignSelf: 'center'}}>Floating Item</Text> </View> ) } render() { return ( <View> <ListView dataSource={this.state.dataSource} renderRow={this.renderRow.bind(this)} style={styles.container} scrollEnabled={this.state.scrollEnabled} {...this._panResponder.panHandlers} /> {this.getDragElement.bind(this)()} </View> ) } renderRow(num) { return ( <TouchableOpacity style={styles.cell} onLongPress={this.handleLongPress.bind(this)} onPressIn={this.handlePressIn.bind(this)} > <Text style={styles.title}>{`Row ${num}`}</Text> </TouchableOpacity> ); } handleLongPress(event) { console.log(event); this.setState({ nativeEvent: event.nativeEvent, scrollEnabled: false, }) } handlePressIn(event) { this._previousLeft = event.nativeEvent.pageX - 50; this._previousTop = event.nativeEvent.pageY - 20; } _updateNativeStyles() { this.floating && this.floating.setNativeProps({style: {left: this._previousLeft, top: this._previousTop}}); } _handleStartShouldSetPanResponder(e, gestureState) { return true; } _handleMoveShouldSetPanResponder(e, gestureState) { return true; } _handlePanResponderMove(event, gestureState) { this._previousLeft = event.nativeEvent.pageX - 50; this._previousTop = event.nativeEvent.pageY - 20; this._updateNativeStyles(); } _handlePanResponderEnd(e, gestureState) { this._previousLeft += gestureState.dx; this._previousTop += gestureState.dy; this.setState({ nativeEvent: undefined, scrollEnabled: true}) } } const styles = StyleSheet.create({ container: { flex: 1, marginTop: 20, }, cell: { flex: 1, height: 60, backgroundColor: '#d3d3d3', borderWidth: 3, borderColor: 'white', justifyContent: 'center', }, title: { paddingLeft: 20, }, }); AppRegistry.registerComponent('LongPressDrag', () => LongPressDrag);应该是多余的。

答案 1 :(得分:2)

除了πάνταῥεῖ的答案,它会更改项目的“全局”设置,您可以在制作目标视图中定义单个制作目标。

步骤:

  1. 选择窗口 - &gt; 显示视图 - &gt; 其他...... - &gt; 制作 - &gt; 制作目标(或更简单,按 Ctrl + 3 ,然后键入Make Target并从列表中选择视图。)
  2. 右键单击视图中的项目,然后选择新建...
  3. 输入您要使用的制作目标,例如CONF=GNU_Debug,然后按确定
  4. 双击目标构建
  5. 以下是截图:

    enter image description here

    快捷方式

    • 您可以按 F9
    • 快速重建上次选择的制作目标
    • Shift + F9
    • 弹出一个弹出窗口以选择制作目标
    • 右键单击 Project Explorer 中的项目,然后选择制作目标 - &gt;,访问与上述相同的用户界面。 构建或从“项目”菜单中选择相同内容。