我的公司传统上使用Linux命令行开发环境.我们使用脚本来管理PATH和LD_LIBRARY_PATH编译和运行时的环境变量.通过将此脚本添加到命令的开头来调用此脚本,如下所示:
sbs make
sbs ../bin/foo.exe
Run Code Online (Sandbox Code Playgroud)
我试图让我们的代码从Eclipse CDT运行,并在开发工具中向前迈进十年左右.我可以在构建配置中控制make命令的内容,但我还没想出如何在运行配置中控制可执行命令.这样的事情可能吗?或者我们是否必须在运行配置中设置环境变量,而不是依赖脚本来执行此操作.该脚本的目的是在为不同版本的GTK构建或在不同平台(Linux,Solaris等等)上构建时最小化工作.
当我双击Eclipse CDT编辑器中的单词来选择它时,冒号(:)不被视为单词分隔符.如何进行双击选择将冒号视为分隔符?
如果解决方案依赖于文件类型,我需要在编辑makefile时使用它.
我找到了一个关于扩展编辑器以改变双击选择策略的常见问题解答,但我正在寻找一个配置或插件解决方案,它不需要我的Eclipse开发.
在撰写本文时,我使用的是最新的Eclipse CDT:
Eclipse IDE for C/C++ Developers 1.2.1.20090918-0703 epp.package.cpp
Eclipse Platform 3.5.1.M20090917-0800 org.eclipse.platform.ide
EPP CPP Feature 1.2.1.20090918-0703 org.eclipse.epp.package.cpp.feature.feature.group
Run Code Online (Sandbox Code Playgroud) 我的问题与Boost和OpenCV库与Eclipse CDR的静态链接有些关系.错误,而我正在尝试做的比这里描述的更多:如何创建一个程序,可以使用Boost和OpenCV读取文件夹中的所有图像?,即使用Boost的文件系统库遍历目录,并使用OpenCV对图像文件进行一些处理.
我使用MinGW编译了文件系统和其他库,并尝试在Windows 7 64位系统上使用Eclipse CDT运行Boost 1.45,OpenCV 2.2和Eigen2.如果在项目中单独使用文件系统库,则编译和运行没有问题,但是与上面的其他两个库组合,我得到以下错误:
In file included from C:\boost_1_45_0/boost/filesystem/v3/path_traits.hpp:22:0,
from C:\boost_1_45_0/boost/filesystem/v3/path.hpp:25,
from C:\boost_1_45_0/boost/filesystem.hpp:32,
from ..\src\ComputeNatScaleFunction.cpp:18:
C:\boost_1_45_0/boost/type_traits/decay.hpp: In instantiation of 'boost::decay<cv::<anonymous enum> >':
C:\cmake_binaries\include/opencv2/core/operations.hpp:766:23: instantiated from here
C:\boost_1_45_0/boost/type_traits/decay.hpp:28:66: error: 'cv::' is/uses anonymous type
C:\boost_1_45_0/boost/type_traits/decay.hpp:28:66: error: trying to instantiate 'template struct boost::remove_reference'
C:\boost_1_45_0/boost/type_traits/decay.hpp:38:17: error: 'cv::' is/uses anonymous type
C:\boost_1_45_0/boost/type_traits/decay.hpp:38:17: error: trying to instantiate 'template struct boost::remove_reference'
C:\boost_1_45_0/boost/type_traits/decay.hpp: In instantiation of 'boost::decay<cv::<anonymous enum> >':
C:\cmake_binaries\include/opencv2/core/operations.hpp:917:21: instantiated from here
C:\boost_1_45_0/boost/type_traits/decay.hpp:28:66: error: 'cv::' is/uses …Run Code Online (Sandbox Code Playgroud) 我使用Eclipse,我想在其中使用gtkmm.我有以下代码:
#include <gtkmm.h>
#include <iostream>
int main(int argc, char *argv[]) {
Gtk::Main kit(argc, argv);
Gtk::Window mainWindow;
Gtk::Button button("Click here");
mainWindow.set_title("Eclipse/GTKmm Demo");
mainWindow.set_border_width(4);
mainWindow.set_default_size(200, 50);
mainWindow.add(button);
button.show();
Gtk::Main::run(mainWindow);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我添加pkg-config --cflags --libs gtkmm-3.0(当然有严重的口音)将Cross G ++ Compiler Miscellanous选项添加到Other标记中,并将Cross G ++ Compiler Miscellanous选项添加到Linker标记中.它不起作用!
这是编译日志:
**** Build of configuration Debug for project User Directory Changer ****
make all
Building file: ../main.cpp
Invoking: Cross G++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 `pkg-config --cflags --libs gtkmm-3.0` -MMD -MP -MF"main.d" -MT"main.d" -o …Run Code Online (Sandbox Code Playgroud) 我已经安装了Eclipse CDT,因此我将能够编写和编译C代码.
编译进度失败,出现以下错误:
LNK1104 : cannot open file kernel32.lib
Run Code Online (Sandbox Code Playgroud)
我一直在我的电脑里搜索这个文件,发现它出现在一些文件夹中,
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib
Run Code Online (Sandbox Code Playgroud)
我怎么能"引用"eclipse到这些特定的路径之一,这样kernel32.lib才能找到文件,我将能够编译和运行C文件?
编辑
感谢@mux回答 LNK1104 : cannot open file kernel32.lib现在已经不见了,但现在出现了一个新的错误: LNK1104 : cannot open file 'C:\Program.lib'.再一次,任何建议都会有所帮助.
我想在Eclipse Luna(Windows - > Linux)中进行交叉编译,但是当我想在远程系统视图中添加连接时, 列表为空
我在Eclipse中安装了最新的RSE.也许我错过了一个我不知道的重点,这就是为什么它是空的.
有什么建议?谢谢!
最近,我从Visual Studio切换到Eclipse CDT.我已经很好地设置它,以便我的Cygwin安装中的G ++编译器可以无需ado地定位和编译我的代码.
然而,有一点轻微的不满.每次G ++报告警告或错误时,单个引号都会引用‘并分别’显示.这似乎是一个字符编码问题; G ++或Cygwin正在吐出一个CDT或Eclipse不喜欢的字符编码.‘’
这只是我能找到的相关Google结果,但是LANG在Eclipse的首选项中设置C++环境变量C.UTF-8或者en_US.UTF-8没有效果.
从Cygwin运行C++直接显示单引号.有没有办法完全禁用这些?我可以设置一些环境变量或我可以传递的参数吗?
Eclipse在各个地方展示了象形文字:
Cygwin显示正确的符号(忽略致命错误):
我已经使用Eclipse CDT一段时间了,我喜欢它,但有一些乏味的事情我想解决它.
创建新文件时,其中一个选项是"新建" - >"类".我想知道是否有人知道编辑这个"类"模板的"$ {declarations}"部分的方法.
更具体地说,我查看了"窗口" - >"首选项"菜单,但无法找到任何内容.我更改了"C/C++" - >"代码样式" - >"代码模板"和"C/C++" - >"编辑器" - >"模板".实际上只有两个中的第一个似乎改变了创建类时出现的内容,并且它不允许我更改"$ {declarations}"部分中的内容.有谁知道如何改变这个?
谢谢,克里斯
我似乎无法弄清楚如何使用C++在Eclipse中构建一个Windows GUI应用程序.我只能建立一个控制台.当我创建一个新项目时,它没有为我提供Windows应用程序的选项.我正在使用Eclipse IDE进行C/C++.我下载错误的Eclipse风味吗?我究竟做错了什么?
我是CDT的新手,我正在尝试自动生成makefile.我注意到它包含三个根本不存在的文件,makefile.init,makefile.defs,makefile.targets.只是想知道,他们做了什么?他们为什么在那里?
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include objects.mk
#Other codes
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
#Other codes
-include ../makefile.targets
Run Code Online (Sandbox Code Playgroud)