eclipse无法运行kotlin(JDK 10)(eclipse cannot run kotlin (JDK 10))
我试图在eclipse IDE中的kotlin中启动新项目,我安装了kotlin成功,并且使用命令行我可以编译和运行kotlin文件。
但在日食中我有一个错误:
The archive: /Kotlin-test-4/kotlin_bin which is referenced by the classpath, does not exist.
- 我试图设置新的项目
- 将文件设置为“kotlin文件”和“kotlin类”
eclipse :Oxygen.3a版本(4.7.3a)
java: java 10.0.1 2018-04-17 Java™SE运行时环境18.3(构建10.0.1 + 10)Java HotSpot™64位服务器VM 18.3(构建10.0.1 + 10,混合模式)
kotlin插件版本: 0.8.4I tried to start new project in kotlin in eclipse IDE, I install kotlin success, and with the command line I can compile and run kotlin files.
but in eclipse I have an error:
The archive: /Kotlin-test-4/kotlin_bin which is referenced by the classpath, does not exist.
- I tried to set new project
- to set the file to "kotlin file" and "kotlin class"
eclipse: Oxygen.3a Release (4.7.3a)
java: java 10.0.1 2018-04-17 Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)
kotlin plugin version: 0.8.4
原文:https://stackoverflow.com/questions/50758889
最满意答案
缺省情况下,bitbake.conf包含在运行时传递给make命令的EXTRA_OEMAKE =“-e MAKEFLAGS =”(请参阅运行$ {MAKE} $ {EXTRA_OEMAKE}“$ @”的base.bbclass)。
-e选项意味着环境变量会覆盖makefile(来自make --help)。 您还会注意到,bitbake.conf在其他几个导出的变量中设置了导出CFLAGS =“$ {TARGET_CFLAGS}”,因此在环境中设置了CFLAGS。
这样做的原因是有一些编译器标志在交叉编译时很重要,一般来说,系统比makefile有更好的使用方法。 这有时会失败,因为你发现。
你可以从EXTRA_OEMAKE中删除-e选项,但是你可能会冒其他关键变量设置不正确的风险(比如它是否会找到交叉编译器)。 另一个稍微干净的解决方案可能是添加到TARGET_CFLAGS,例如:
TARGET_CFLAGS + =“-Wall -std = gnu99”
不幸的是,这里可能没有完美的解决方案,但希望这有助于理解它为什么会这样做。
By default, bitbake.conf contains EXTRA_OEMAKE = "-e MAKEFLAGS=" which is passed to the make command when its run (see base.bbclass, which runs ${MAKE} ${EXTRA_OEMAKE} "$@").
The -e option to make means that environment variables override makefiles (from make --help). You'll also notice that bitbake.conf sets export CFLAGS = "${TARGET_CFLAGS}" amongst several other exported variables, so CFLAGS is set in the environment.
The reason it does this is that there are some compiler flags which are important whilst cross compiling and in general, the system has a better idea of what to use than the makefile does. This does sometimes fail as you've found.
You could remove the -e option from EXTRA_OEMAKE but you run the risk of other key variables not being set correct (e.g. would it find the cross compiler). Another slightly cleaner solution might be to add to TARGET_CFLAGS, e.g.:
TARGET_CFLAGS += "-Wall -std=gnu99"
Unfortunately there is likely no perfect solution here however hopefully this helps understand why it does what it does.
相关问答
更多-
关于Makefile中的CFLAGS(about CFLAGS in Makefile)[2022-08-08]
如果您的编译器没有 -fno-stack-protector选项,它将返回错误代码(即某些东西!=0 ),否则它将返回0 (返回代码中的“true”),表示一切正常。 现在,表达式foo && bar表示只有在foo返回非错误代码(即0 )时才会执行bar 。 所以,你看,如果你的编译器没有那个标志,它将返回“false”(某些东西!=0 ),并且永远不会执行echo命令。 但如果它有标志,则会执行echo 。 If your compiler does not have the option -fno-s ... -
CFLAGS_只是一个字符串。 $(CFLAGS_)是一个变量的值。 所以你应该有: CFLAGS += $(CFLAGS_) SRCS-y += $(SRCS-y_) CFLAGS_ is just a string. $(CFLAGS_) is a variable's value. So you should have: CFLAGS += $(CFLAGS_) SRCS-y += $(SRCS-y_)
-
修改CFLAGS时,Makefile不会重建obj?(Makefile doesn't rebuild the obj's when the CFLAGS are modified?)[2023-09-16]
通过检查文件的时间戳来简化工作。 你几乎不希望每个构建工件依赖于你的Makefile (至少在积极开发它时没有)但是如果你真的想要Make来处理这种依赖,你可以将CFLAGS定义放在辅助文件buildflags.mk ,从主要包含它Makefile ,并使所有目标文件都依赖于buildflags.mk 。 不过,我几乎不认为有人会在实践中真正做到这一点。 总会有这样的情况,确保你获得一个干净的构建的唯一方法是刷新一切并重新开始。 确保您拥有良好且最新的realclean和/或distclean目标,并确保在 ... -
缺省情况下,bitbake.conf包含在运行时传递给make命令的EXTRA_OEMAKE =“-e MAKEFLAGS =”(请参阅运行$ {MAKE} $ {EXTRA_OEMAKE}“$ @”的base.bbclass)。 -e选项意味着环境变量会覆盖makefile(来自make --help)。 您还会注意到,bitbake.conf在其他几个导出的变量中设置了导出CFLAGS =“$ {TARGET_CFLAGS}”,因此在环境中设置了CFLAGS。 这样做的原因是有一些编译器标志在交叉编译时 ...
-
我在哪里把CFLAGS放在这个makefile中?(Where do i put CFLAGS in this makefile? Need the -g so i can use gdb debugger)[2023-05-21]
这个makefile使用make的内置规则集来创建对象和链接可执行文件,而不是让你自己输入它们。 Make有一个默认规则,看起来(或多或少)像这样: %.o : %.c $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< 如果您没有自己指定任何规则来构建.o并且需要构建一个并且它有一个.c ,它将使用默认的内置规则。 所以,你的问题的答案是,“把CFLAGS的任命放在你想要的任何地方”。 无论您将它放在何处,它都将由默认规则使用。 This makefile i ... -
根据当前操作系统更新makefile中的CFLAGS或LDFLAGS(Update CFLAGS or LDFLAGS in makefile depending on current OS)[2022-01-09]
我认为ifeq块不应该进入make目标,而应该进入makefile的前面(在所有:)之前。 就是这样: OS:=$(shell uname) DST=hello SRC=$(wildcard *.cpp) OBJ=$(SRC:.cpp=.o) CFLAGS= ifeq ($(OS),Darwin) $(info OS is $(OS)) CC=g++ LDFLAGS=-lm -framework OpenCL CFLAGS+=-O3 endif ifeq ($(OS),L ... -
我在编译C ++文件时使用CFLAGS ,在编译C ++文件时使用CXXFLAGS 。 除了CFLAGS和CXXFLAGS之外,您可能还缺少另一个相关变量: CPPFLAGS 。 我应该在CXXFLAGS或CFLAGS添加-I eigen吗? CPPFLAGS通常用于提供与预处理器相关的选项。 我会使用此变量来指定包含目录: CPPFLAGS = -I eigen 另一个有趣的变量是提供库,它将是LDLIBS 。 您可以利用它来传递-lm : LDLIBS = -lm 我应该更改为$(PROGRAM): ...
-
你的规则是 %.o: %.c $(DEPS) 但你正在编译一个.cpp文件。 将使用.cpp源文件的隐式make规则。 请将您的规则更改为 %.o: %.cpp $(DEPS) 或者设置隐式规则中使用的CXXFLAGS变量。 Your rule is %.o: %.c $(DEPS) but you are compiling a .cpp file. The implicit make rule for .cpp source files will be used. Either change yo ...
-
看起来你正在编译C ++,在这种情况下,要使用的变量是AM_CXXFLAGS 。 设置AM_CXXFLAGS应该在Makefile.am ,它声明你正在编译的东西(即bin_PROGRAMS , lib_LTLIBRARIES ,...)。 如果您在重复自己,请不要忘记automake支持include语句。 递归使被认为是有害的。 现代automake支持subdir-objects 。 如果一个Makefile.am失控,请使用include语句。 打开libtool的现代方法是LT_INIT ,而不是 ...
-
配置脚本中的CFLAGS(CFLAGS in configure script)[2022-03-24]
最简单的方法可能是在实际构建时使用make : make CFLAGS=-O0 这对于那个版本来说只是暂时的,它不会是永久性的。 The simplest way might be to do it when actually building, using make: make CFLAGS=-O0 That's only temporary for that build though, it won't be permanent.