compilation

java.lang.NoClassDefFoundError when using JavaFX for playing sound from jar

可紊 提交于 2019-12-14 03:06:42
问题 I want to be able to play sound from mp3 files for which I saw posts recommending the usage of JavaFX. I implemented the MediaPlayer and initialized the JFXPanel and in eclipse, everything works lovely. Yet when I export to a runnable jar, and try running the program, I get the following error message: java.lang.NoClassDefFoundError: javafx/scene/media/MediaException. I presume this is from the exclusion of JavaFX in the newer JRE versions (which I came across during my search to a solution).

Why does Kotlin byte code reference java.util.function.BiConsumer?

三世轮回 提交于 2019-12-14 01:18:40
问题 From what I understand Kotlin should be able to run using JRE 6. But this code with a foreach on a map fails because of a reference to a Java 8 class ( java/util/function/BiConsumer ) CompilerTest.kt: fun main(args: Array<String>) { val aMap = mapOf("bar" to "bat") aMap.forEach { k, v -> println("$k -> $v")} } Compile the Kotlin code: » kotlinc CompilerTest.kt -jvm-target 1.6 -include-runtime -d compilerTest.jar Testing the compiled code on JRE 6: » docker run --rm -v "$PWD":/usr/src/myapp -w

iOS - conditional compilation (xcode)

▼魔方 西西 提交于 2019-12-14 00:24:41
问题 I have created an additional iPad target for what was originally an iphone app. From the Apple docs: "In nearly all cases, you will want to define a new view controller class to manage the iPad version of your application interface, especially if that interface is at all different from your iPhone interface. You can use conditional compilation to coordinate the creation of the different view controllers." But they don't give any example or detail on what conditional compilation is. Can anyone

Why the compiler-generated state machine restores repeatedly the state to -1?

穿精又带淫゛_ 提交于 2019-12-13 23:47:43
问题 I am trying to understand how the iterators work internally, to mitigate some concerns I have about thread-safety. Lets consider for example the following simple iterator: using System.Collections.Generic; public class MyClass { public static IEnumerable<int> MyMethod() { yield return 10; yield return 20; yield return 30; } } I can see the compiler-generated state machine that is created behind the scenes, after copy-pasting this code to SharpLab.io. It is a class that implements the

how to use cmake that installed in a non-standard path?

自闭症网瘾萝莉.ら 提交于 2019-12-13 23:30:29
问题 I am on Ubuntu 14.04.3 platform. While I was compiling a project it asked cmake version 3.2 which is not present in my system. I compiled the latest version of cmake from source code and installed it into /usr/local/bin directory. When I attempt to compile project again, its cmake detects the cmake in /usr/bin which is lower version. Then cmake .. process aborts with lower version error. Is there any built-in cmake variable or environment variable for setting path of the cmake? EDIT: I just

Compiling ANSI C++ code on Mac OS X [closed]

别来无恙 提交于 2019-12-13 23:11:03
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm struggling to compile and run a program on Mac OS X, which is written using ANSI/ISO C++ (Windows). Source code I've tried to compile using g++, and by importing the files and compiling using Xcode. If i try to compile using g++ (command line), I get a couple of warning, which are easy to fix,: e.g. warning:

C++ templates and object code instantiation

 ̄綄美尐妖づ 提交于 2019-12-13 21:28:30
问题 With this question I'd like to better understand how C++ templates system works with regards to this question. As far as I know, template-based classes and functions are usually placed into header files. This is due to the technical issue of managing generic data types, which characterstics are unknown in principle. As soon as they are known, the compiler can generate the executable code which is suited for the required data type. In the header file something.h , our class shall be defined as

Typescript compilation doesn't add require statement to some files

て烟熏妆下的殇ゞ 提交于 2019-12-13 20:39:52
问题 I'm working on a very simple conversion of a nodejs project to typescript. The first 2/main files of the node project transpiled correctly. The 3rd transpiled except for the requires statement at the top of the file to pull in dependencies. I'm sure the dependency is found because VSCode could autocomplete and color the dependency objects and there were no compiler errors. Each of the 3 files uses ts import statements instead of requires. Since it works in 2 of the 3 files and they are

How to use “make” to use 64 bit libs because of ELFCLASS64 error

烈酒焚心 提交于 2019-12-13 19:07:34
问题 How can I use configure and make tools to specify to use 64 bit libraries? I thought it was automatic, but I get wrong ELF Class. I'm trying to compile Xdebug for Ubuntu 64 for use with LAMPP (XAMPP for Linux). ./lampp start Failed loading /opt/lampp/lib/php/extensions/xdebug.so: /opt/lampp/lib/php/extensions/xdebug.so: wrong ELF class: ELFCLASS64 The ./configure looks OK to me, and the make works without errors, I've copied the configure in case its relevant: /xdebug-2.0.3$ ./configure

Android ProgressDialog can't add Cancel button

风流意气都作罢 提交于 2019-12-13 18:52:25
问题 I want to add a cancel button to my progress dialog but I can't compile the code. The IDE (eclipse) it's saying that there is an error in the code but I don't know what's wrong? ProgressDialog ASYN_DIALOG = new ProgressDialog(getBaseContext()); ASYN_DIALOG.setMessage("Awaiting..."); ASYN_DIALOG.setButton("Cancel", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Log.e("ANDR: ", "Cancel clicked !"); } }); I'm using API lvl 10 (Android 2.3.3) 回答1: The