compilation

Scala compilation: anonymized function

痴心易碎 提交于 2019-12-12 04:32:02
问题 Is there any specification of scala compilator that can explain that behaviour? scala version: 2_10_6 code example trait Service { def process(s: String) } object ServiceImpl extends Service{ override def process(s: String): Unit = { println(s) } } object Register { var serviceInst : Service = ServiceImpl } object Client1 { def process1(l: List[String]): Unit ={ l.foreach(x => Register.serviceInst.process(x)) } } object Client2 { def process1(l: List[String]): Unit ={ l.foreach(Register

Building project under VS2013 works only when each *.cpp's are compiled manually

点点圈 提交于 2019-12-12 03:59:09
问题 I'm trying to compile Ogre Wiki Tutorial Framework 1.9 - (Windows line endings) in VisualStudio 2013. Right click on OgreFramework project and choosing Rebuild returns following errors: Error 487 error LNK2001: unresolved external symbol "protected: virtual void __thiscall BaseApplication::windowClosed(class Ogre::RenderWindow *)" (?windowClosed@BaseApplication@@MAEXPAVRenderWindow@Ogre@@@Z) c:\Users\wakatana\Documents\Visual Studio 2013\Projects\OgreFramework\OgreFramework

Undefined reference in make

爱⌒轻易说出口 提交于 2019-12-12 03:55:26
问题 I'm compiling a code with many files and some are located in the local MATLAB installation folder. For this I've added an include to g++ which apparently doesn't resolve well because I get an undefined reference to for all MATLAB-C++ functions (I'm trying to use the MATLAB C++ Engine) as shown in the following screenshot: The Makefile is very short and as such: I've checked the referenced directory and it does include the "Engine.h" referenced by constraints.cpp which is generally enough to

Using super() for equals() in a subclass in a different package

。_饼干妹妹 提交于 2019-12-12 03:50:10
问题 I have a class Vehicle which is in package A and a class Car which is in package B and I want to use equals method and take advantage of inheritance by using super(), but I don't know how to do this. When I try to run the file in main I get this: Exception in thread "main" java.lang.NullPointerException at vehicle.Vehicle.equals(Vehicle.java:97) at car.Car.equals(Car.java:104) at Main.main(Main.java:48) Here is the code: public boolean equals(Vehicle other) { if (this.type.equals(other.type))

Set environment variables for gcc compiler

旧时模样 提交于 2019-12-12 03:49:38
问题 I want to set environment variables for my gcc compiler. Specifically, i want to set one of these two flags: -fPIC Generate position-independent code if possible (large mode) -fPIE Generate position-independent code for executables if possible (large mode) what environment variables do i have to set before code compilation to have these flags enabled? Basically, what i want is my setup.py file that i run build on, to use one of these flags when it is compiled. 来源: https://stackoverflow.com

angularjs, $compiled templates and ng-repeat

北战南征 提交于 2019-12-12 03:37:20
问题 Essentially, I take two templates inside a compile function of a directive. I compile them once and for all (via $compile) in the compile phase of the directive. In the link phase of the directive, I watch a scope variable and applies one or the other compiled template to the scope. testApp.directive('testField', ['$compile', function ($compile) { return { restrict: 'E', scope: true, compile: function(tElement, tAttrs) { var viewFn = $compile("<div>View: <span ng-repeat='x in [1,2,3]'>{{x}}<

Setting the fortran compiler in f2py

我只是一个虾纸丫 提交于 2019-12-12 03:35:44
问题 I am trying to run the f2py example to create the compiled extension module¶: # import os # os.environ["CC"] = "gcc" # os.environ["CXX"] = "g++" # Using post-0.2.2 scipy_distutils to display fortran compilers from scipy_distutils.fcompiler import new_fcompiler compiler = new_fcompiler() # or new_fcompiler(compiler='intel') compiler.dump_properties() #Generate add.f wrapper from numpy import f2py with open("add.f") as sourcefile: sourcecode = sourcefile.read() print 'Fortran code' print

C++ compiling and linking

谁都会走 提交于 2019-12-12 03:35:30
问题 I found one question about compiling and linking in C++ and I don't know which answer is correct. It was discussed with my friends and opinions are divided. Here is a question: In order to run program written in C++ language its source code is: (A) compiled to machine code, (B) compiled and linked to machine code In my opinion the correct answer is A but I don't have any source to prove it. 回答1: Google, first hit. Linkage is needed as well to create a standalone executable. 回答2: You need to

Solaris Studio adding current directory info in object file

旧时模样 提交于 2019-12-12 03:26:25
问题 I am trying to build a simple hello world program using Solaris Studio 12.x on Solaris 11. If I compile the same file from two different folder, I am getting a difference in the object file as shown by diff command or cmp command. Took a hex dump of both object files (od -x) and compared them and using an online tool that can convert hex to ASCII, found that the difference is occurring as the object files contain the current directory from where the compilation was initiated. Question is how

Unity3D - Failed to re-package resources | Android APK

守給你的承諾、 提交于 2019-12-12 03:25:54
问题 I'm trying to compile a simple game without any additional plugin, but I am facing the errors below: CommandInvokationFailure: Failed to re-package resources. See the Console for details. C:\Program Files (x86)\Android\android-sdk\build-tools\24.0.0-preview\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Program Files (x86)/Android/android-sdk\platforms\android-23\android.jar" -F bin/resources.ap_ stderr[ ] stdout[ -----------------------------------