顯示具有 eclipse 標籤的文章。 顯示所有文章
顯示具有 eclipse 標籤的文章。 顯示所有文章

2016年7月25日 星期一

Eclipse / macro

Project Macros

This topic describes the various macros that are available for use within projects. They can be used when specifying build command or build options and in general are quite useful when trying to make projects portable and more maintainable.

MacroDescription
${InputFileName}Represents the input file name.
${InputFileExt}Represents the extension of the input file.
${InputFileBaseName}Represents the base name of the input file. That is the file name with an extension stripped.
${InputFileRelPath}Represents the input file path relative to the builder current directory.
${InputDirRelPath}Represents the input file directory path relative to the builder current directory.
${OutputFileName}Represents the output file name.
${OutputFileExt}Represents the output file extension.
${OutputFileBaseName}Represents the output file base name. That is the output file name with an extension stripped.
${OutputFileRelPath}Represents the output file path relative to the current builder directory.
${OutputDirRelPath}Represents the output file directory path relative to the current builder directory.
${ConfigName}Represents the name of a given configuration.
${ConfigDescription}Represents the description of a given configuration.
${BuildArtifactFileName}Represents the name of the build artifact.
${BuildArtifactFileExt}Represents the extension of the build artifact.
${BuildArtifactFileBaseName}Represents the base name of the build artifact.
${BuildArtifactFilePrefix}Represents the prefix of the build artifact.
${ProjName}Represents the name of a given project.
${ProjDirPath}Represents the absolute path of a given project.
${WorkspaceDirPath}Represents the workspace absolute path.
${DirectoryDelimiter}Represents the directory delimiter used on the system. That is the “\? for Win32 systems and the “/? for Unix-like systems. This could be useful, e.g. in the case a user needs the absolute path of an input file. The absolute path would be represented in the following way: ${CWD}${DirectoryDelimiter}${InputFileRelPath}
${PathDelimiter}Represents the default path delimiter used on the system to separate paths in the path environment variables. That is the “;? for Win32 systems and the “:? for Unix-like systems
This might be used in the environment variable definitions
${EclipseVersion}Represents the current Eclipse version.
${CDTVersion}Represents the current CDT version.
${HostOsName}Represents the operating system name on which eclipse is running.
${C2000_CG_ROOT}Installation folder of the C28x code generation tools.
${C5500_CG_ROOT}Installation folder of the C55x code generation tools.
${C6000_CG_ROOT}Installation folder of the C6x code generation tools.
${MSP430_CG_ROOT}Installation folder of the MSP430 code generation tools.
${TMS470_CG_ROOT}Installation folder of the ARM code generation tools.
${CCS_INSTALL_ROOT}Root installation directory of CCS. i.e. the directory installed in + /ccsv4 or /ccsv5
${CG_TOOL_ROOT}Installation folder of the currently selected code generation tools. Will be the same value as the matching <ISA>_CG_ROOT macro.
${CG_TOOL_SUFFIX}Contains the ISA of the currently selected code generation tools. i.e. 2000 for C2000.

2016年6月7日 星期二

Eclipse C++ 打包

在程式的主資料夾建立folder : build
裡面放一個執行檔 build.sh

***
WORKDIR=$(cd "$(dirname "$0")"; pwd)
cd $WORKDIR/../

#將系統內建的也打包進去
find . -type f -perm /a+x -exec ldd {} \; | grep so | sed -e '/^[^\t]/ d' | sed -e 's/\t//' | sed -e 's/.*=..//' | sed -e 's/ (0.*)//' | sort | sed '/^\s*$/d' |  uniq | sed -e '/x86_64-linux-gnu/d' | sed -e '/lib64/d' | sed 's/^/sudo cp /' | sed 's?$? '`pwd`/lib'?' >> copy.sh

#find . -type f -perm /a+x -exec ldd {} \; | grep so | sed -e '/^[^\t]/ d' | sed -e 's/\t//' | sed -e 's/.*=..//' | sed -e 's/ (0.*)//' | sort | sed '/^\s*$/d' |  uniq | sed 's/^/sudo cp /' | sed 's?$? '`pwd`/lib'?' >> copy.sh

mkdir lib
chmod +x copy.sh
./copy.sh
rm copy.sh

***
註解的不將系統內建的連結檔放入lib

2016年3月24日 星期四

Multiple “could not be resolved” problems using Eclipse

最近用eclipse的時候遇到一個很奇怪的問題
我在使用C++11的新功能 chrono的時候 會發現我已經更改了
Properties > C/C++ Build > Setting > GCC C++ Complier
> Dialet  > Language standard = ISO C++1y (-std=c++1y)

但在build project的時候, 會出現很多很多error, 雖然最後仍然可以成功的build出程式
可是無法使用eclipse 來執行程式, 只能用terminate 來啟動

後來上網查到解決辦法

***
Go to Project -> Properties -> C/C++ General -> Preprocessor Include Paths, Macros, etc. -> Providers -> CDT GCC built-in compiler settings, deactivate Use global provider shared between projects and add the command line argument -std=c++11.

The eclipse live code analysis does not share the same settings with the build compiler. You can also change the setting globally (not just for the project) in Window -> Preferences -> C/C++ -> Build -> Settings -> CDT GCC Built-in Compiler Settings.

**
更改完這些設定之後Rebuild project 
錯誤訊息就會消失了!

2015年12月17日 星期四

Eclipse / proxy / eclipse market 不通

Eclipse 的 market 不通的時候到 windows -> preference -> Network Connections

  1. 改成手動
  2. http & https 都填入網路設定
  3. socket不需要填 (clear)

Eclipse 閃退 or 一閃而過 or 打不開

解決方式:
1.通過在命令行中輸入“whereis java”,找到除jdk目錄下的所有java相關程序,直接刪掉(一般會在C:\WINDOWS\system32下)
2.內存不足,打開Eclipse目錄下的eclipse.ini,把裡面的-Xmx512m改成-Xmx256m
3.檢查環境變量,path變量中將jdk路徑放在最前邊(開頭的“.;”直接後邊)
4.檢查環境變量,path變量中將jdk中的jre路徑放在最前邊(開頭的“.;”直接後邊)
5.傳言中的萬能方案(不過估計非萬能):把jdk目錄下的jre目錄直接複製到eclipse目錄下
6.刪除文件:[workspace]/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi --
我是用第六個解決

--
另外一個網頁所提到的解決方法
既然問題存在於 workspace 之中那就比較好解決,
只要依以下流程移除特定檔案後通常都可以救回,
以下的解決方法參考自:Eclipse hangs on loading workbench,
並依我自身的經驗及建議的順序做排列:

方法一(請優先使用這個方法,若無效或找不到檔案再試第二個方法):
  1. 先進工作管理員強制關閉 Eclipse 的 process
  2. 開啟檔案總管 (記得要顯示隱藏檔)
  3. 移動至 workspace\.metadata\.plugins\org.eclipse.core.resources 目錄中並删除文件 .snap
  4. 也有建議刪除 workspace\.metadata\.lock
  5. 重新開啟 Eclipse。

方案二(方法一無效時使用):
  1. 先進工作管理員強制關閉 Eclipse 的 process
  2. 開啟檔案總管 (記得要顯示隱藏檔)
  3. 移動至 workspace\.metadata\.plugins\ 目錄
  4. 將 org.eclipse.core.resources 重新命名為 org.eclipse.core.resources.old
  5. 重新啟動 Eclipse,關閉所有已編輯中之程式碼分頁 (會顯示找不到程式碼)
  6. 關閉 Eclipse
  7. 刪除剛剛建立的 org.eclipse.core.resources 資料夾
  8. 將資料夾 org.eclipse.core.resources.old 改回原本的 org.eclipse.core.resources
  9. 重新啟動 Eclipse,搞定!
以上兩個方法我都有試成功過,也不影響既有的 workspace, plugin 設定喔~