User Tools

Site Tools


eclipse

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
eclipse [2018/10/13 15:03]
beenisss Update to settings under Preprocessor Include Paths, Macros etc.
eclipse [2019/04/02 16:59] (current)
beenisss Updates to advice on includes and symbols, mainly for Mac
Line 102: Line 102:
     * Replace ''​%VERSION%''​ with the folder name for your version of Qt.     * Replace ''​%VERSION%''​ with the folder name for your version of Qt.
     * You may also have to manually add to the system PATH setting to include, for example, /​usr/​local/​bin and /​usr/​local/​include. Do this the same way as the above. Separate individual paths with colons.     * You may also have to manually add to the system PATH setting to include, for example, /​usr/​local/​bin and /​usr/​local/​include. Do this the same way as the above. Separate individual paths with colons.
-    * To build with clang rather than gcc (recommended) add the below: <​code>​+    * To build with clang (recommended) ​rather than gcc add the below: <​code>​
 CC        | clang  ​ CC        | clang  ​
 CXX       | clang++ CXX       | clang++
Line 142: Line 142:
   * For stepping through the Qt source, you need to place it in your workspace folder <code bash>   * For stepping through the Qt source, you need to place it in your workspace folder <code bash>
 cd eclipse-workspace cd eclipse-workspace
-apt-get source ​libqt5core5+apt-get source ​qtbase5-dev
 ln -s qtbase-opensource-src-5.2.1+dfsg qt5 # adjust version ​ ln -s qtbase-opensource-src-5.2.1+dfsg qt5 # adjust version ​
 +sudo apt-get install qtbase5-dbg
 </​code>​ </​code>​
   * Non-Mac users should use GDB for debugging in Eclipse ([[https://​www.gnu.org/​software/​gdb/​|GDB]]).   * Non-Mac users should use GDB for debugging in Eclipse ([[https://​www.gnu.org/​software/​gdb/​|GDB]]).
Line 163: Line 164:
 import sys import sys
  
-sys.path.insert(0,​ '/​home/<​user_name>/​workspace'​)+sys.path.insert(0,​ '/​home/<​user_name>/​eclipse-workspace'​)
 from qt import register_qt_printers from qt import register_qt_printers
 register_qt_printers (None) register_qt_printers (None)
Line 199: Line 200:
 by checking "Show built-in values"​ by checking "Show built-in values"​
  
-If the discovering fails, you may add the required info manually: ​+This process does not always work perfectly. ​If the discovering fails, you can help things along by adding ​the required info manually: ​
  
 === Linux === === Linux ===
Line 238: Line 239:
  
   * Right click on the project -> Properties -> C/C++ General -> Paths and Symbols   * Right click on the project -> Properties -> C/C++ General -> Paths and Symbols
-  * Under the '​Includes' and '​Symbols' tabs, choose GNU C++ and add:+  * Under the '​Includes'​ tabs, choose GNU C++ and add:
     * /​usr/​local/​include     * /​usr/​local/​include
-    * /​usr/​local/​Cellar/​qt/​5.10.1/include +    * ${QTDIR}/include 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtCharts +    * ${QTDIR}/​include/​QtCharts 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtConcurrent +    * ${QTDIR}/​include/​QtConcurrent 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtCore +    * ${QTDIR}/​include/​QtCore 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtGui +    * ${QTDIR}/​include/​QtGui 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtNetwork +    * ${QTDIR}/​include/​QtNetwork 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtOpenGL +    * ${QTDIR}/​include/​QtOpenGL 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtScript +    * ${QTDIR}/​include/​QtScript 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtScriptTools +    * ${QTDIR}/​include/​QtScriptTools 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtSql +    * ${QTDIR}/​include/​QtSql 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtSvg +    * ${QTDIR}/​include/​QtSvg 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtTest +    * ${QTDIR}/​include/​QtTest 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtWidgets +    * ${QTDIR}/​include/​QtWidgets 
-    * /​usr/​local/​Cellar/​qt/​5.10.1/​include/​QtXml+    * ${QTDIR}/​include/​QtXml
  
-  * (replace ​/usr/​local/​Cellar/​qt/​5.10.1 above with your QtDir)+Note that the use of ${QTDIR} depends on you having set this variable under Project Properties > C/C++ Build > Environment
  
 After changing these settings, the index needs to be rebuilt. Eclipse will usually detect that changes have been made and will rebuild the index on clicking Apply and Close. To do it manually: After changing these settings, the index needs to be rebuilt. Eclipse will usually detect that changes have been made and will rebuild the index on clicking Apply and Close. To do it manually:
eclipse.1539457437.txt.gz · Last modified: 2018/10/13 15:03 by beenisss