页面“C 语言 undefined reference to 'sqrt' 问题”与“Eclipse”之间的差异

来自linux中国网wiki
(页面间的差异)
跳到导航 跳到搜索
 
 
第1行: 第1行:
 +
=下载=
 +
[https://www.eclipse.org/downloads/packages/release/Oxygen/2  eclipse c 下载地址]
 +
最新版的漂亮还快哦
 +
<pre>
 +
pkg install openjdk8
 +
sudo pkg install eclipse-cdt
 +
  pkg install eclipse-cdt # freebsd
 +
</pre>
  
[[category:c]]
+
=usage=
 
<pre>
 
<pre>
 +
Eclipse中添加多行注释的快捷键 
 +
 +
第一种 //注释
 +
选择你要注释的那一行或多行代码,按 Ctrl+/ 即可,取消注释也是选中之后按 Ctrl+/ 即可。此快捷键是 //注释 而不是 /**/注释。
  
 +
第二种 /**/注释
  
ndefined reference to 'sqrt'
+
Ctrl+Shift+/
实际上是没有链接math数学库
+
说明:添加/* */注释
  
/*gcc -Wall -lm  distance.c
+
Ctrl+Shift+\
*
+
说明:消除/* */注释
*gcc test.c –lm  //-lm就是链接到math库
+
 
* */
+
要修改在eclispe中的命令的快捷键方式我们只需进入windows -> preference -> General -> key设置就行了
  
 
</pre>
 
</pre>
 +
[https://stackoverflow.com/questions/43623643/how-to-open-terminal-inside-eclipse How to open Terminal inside Eclipse]
 +
 +
=trouble shooting=
 +
<pre>
 +
launch failed Binary not found  每个项目都是改一下 不然不行
 +
 +
select "Run". -> Run Configurations. ->Choose "C++ Application".  ->  build  configuration  --> select debug    auto build#is me
 +
 +
Click on the "New Launch Configuration" icon on the top left of the open window.
 +
Select "Browse" under the C/C++ Application.
 +
Browse to the folder where you made your project initially.
 +
Enter the Debug folder.
 +
Click on the binary file with the same name as the project.
 +
Select "OK".
 +
Click "Apply" to confirm the link you just set.
 +
Close that window.</pre>
 +
 +
=参考=
 +
[http://blog.linuxchina.net/?p=1019 eclipse 简单使用]
 +
 +
[http://blog.linuxchina.net/?p=2911 eclipse使用]
 +
 +
 +
[https://blog.csdn.net/faihung/article/details/60780646 用Eclipse完成C语言编程的几个简单步骤]
 +
  
  
[https://blog.csdn.net/weiyuanzhuo/article/details/52382283 C 语言 undefined reference to 'sqrt' 问题解决]
+
[[category:c]]  [[category:ops]]

2019年10月30日 (三) 06:51的版本

下载

eclipse c 下载地址 最新版的漂亮还快哦

pkg install openjdk8
 sudo pkg install eclipse-cdt
  pkg install eclipse-cdt # freebsd

usage

Eclipse中添加多行注释的快捷键  

第一种 //注释
选择你要注释的那一行或多行代码,按 Ctrl+/ 即可,取消注释也是选中之后按 Ctrl+/ 即可。此快捷键是 //注释 而不是 /**/注释。

第二种 /**/注释

Ctrl+Shift+/ 
说明:添加/* */注释 

Ctrl+Shift+\ 
说明:消除/* */注释 

要修改在eclispe中的命令的快捷键方式我们只需进入windows -> preference -> General -> key设置就行了

How to open Terminal inside Eclipse

trouble shooting

launch failed Binary not found  每个项目都是改一下 不然不行 

select "Run". -> Run Configurations. ->Choose "C++ Application".  ->   build  configuration  --> select debug     auto build#is me 

Click on the "New Launch Configuration" icon on the top left of the open window.
Select "Browse" under the C/C++ Application.
Browse to the folder where you made your project initially.
Enter the Debug folder.
Click on the binary file with the same name as the project.
Select "OK".
Click "Apply" to confirm the link you just set.
Close that window.

参考

eclipse 简单使用

eclipse使用


用Eclipse完成C语言编程的几个简单步骤