compilation

Can ruby scripts be precompiled into a binary?

与世无争的帅哥 提交于 2019-12-05 07:46:21
I'm working on a Ruby script that will need to be deployed onto systems without a ruby interpreter. It will need to run on FreeBSD systems which uses the ELF format. I know there is a ruby2exe project to compile ruby scripts to run on Windows, but is it easy or even possible to do that on other operating systems? Have you checked whether Rubinius or JRuby would allow you to precompile your code? Aside from bytecode that requires a VM to run, Ruby cannot be compiled. It is an interpreted langauge and as such requires an interpreter. ruby2exe packages a ruby interpreter and runtime library with

On RCF Middleware Binary Size

拈花ヽ惹草 提交于 2019-12-05 07:28:01
问题 RCF is a library/framework for RPC and distributed messaging. I like the RCF framework for the following reasons in line service - interface - rpc call specification (i.e., no separate compilation of an IDL). C10K design style (layers ontop of windows IOCP or boost ASIO). supports windows named pipes and unix domain sockets (I absolutely cannot compromise on this). SSL. Messaging paradigms, 2-way, 1-way, client-callback, 1-way batched. protocol buffers support (tho I think I can stick with

Package install error: compilation failed

。_饼干妹妹 提交于 2019-12-05 07:22:22
I recently updated R to 3.1.0. I tried to move my packages over to 3.1 inside the R.Framework (I'm running OSX Mavericks) and somehow made a mess of it, so did a complete uninstall of everything before a clean install. When reinstalling packages I had no issues until I hit the forecast package which yields the following error: package ‘forecast’ is available as a source package but not as a binary Warning in install.packages : package ‘forecast’ is not available (for R version 3.1.0) I actually had R 3.1.0 and both forecast and hts working together prior to the reinstall so I suspect the

How to make IntelliJ IDEA recognise code created by macros?

半城伤御伤魂 提交于 2019-12-05 06:42:55
Background I have an sbt-managed Scala project that uses the usual sbt project layout for Scala projects with macros, i.e., a subproject that contains the macros a main project that is the actual application and that depends on the macro subproject. The macros are macro annotations which, in essence, generate companion objects for regular classes. The generated companion objects declare, amongst other members, apply/unapply methods. I used the sbt-idea plugin to generate a corresponding IntelliJ IDEA project, and I use the sbt console from IDEA's sbt-plugin to compile and run my Scala

twisted logic: a global variable in one file refers to an extern variable but is also referred by that extern variable

為{幸葍}努か 提交于 2019-12-05 06:31:28
fileA.cpp: #include <iostream> extern int iA; extern int iB= iA; int main() { std::cout<<iA<<','<<iB; } fileB.cpp extern int iB; extern int iA = 2*iB; Compiled and linked and ran, out come in the debug and release mode is 0,0 My question is how it works, why there is no issue in linking stage? I'm using VC++2003. The initialiser overrides the extern keyword, so there's nothing "magical" about this: you're just declaring and defining two completely unrelated variables in different functions. [C++14: 3.1/2]: A declaration is a definition unless it declares a function without specifying the

Link libraries compiled by various compilers

纵然是瞬间 提交于 2019-12-05 06:23:07
问题 I would like to ask in more detail about a answer I recently got here (3rd one): Compiled languages basics If I write in C and MinGW and I link to C++ library compiled by VC - will it work? How do I know in advance? In other words, if I'm able to create without warnings an .exe which links to that C++ .dll, and I'm able to run (just run, no further testing) that .exe, does it mean it worked? Wont it core-dump at some point? To be totally sure, do I need to re-compile the library sources by

g++: fatal error: cannot specify -o with -c, -S or -E with multiple files

偶尔善良 提交于 2019-12-05 06:20:53
I am trying to compile a library file using other library files. I am using the following line in my makefile to create gameobject.o: lib/gameobject.o: src/gameobject.cpp src/vector.hpp lib/objectevent.o lib/sprite.o g++ $^ -c -o $@ $(SFML_FLAGS) All the dependencies comile correctly, but I get the following error when it tries to compile gameobject.o: g++: fatal error: cannot specify -o with -c, -S or -E with multiple files I'm still a bit new to using make/separating compilation, so I'm not quite sure what I should do. Do I just have to compile it without setting an output? Do I have to

What do you do to make compiler lines shorter?

浪尽此生 提交于 2019-12-05 06:11:34
Often when I'm working on a project with others, the amount of library paths and include paths that get sourced by the compiler in the Makefile get more numerous as time goes by. Also the paths can get very long as well. Here's an example: g++ -c -pipe -O2 -Wall -W -DQT_BOOTSTRAPPED -DQT_MOC -DQT_NO_CODECS -DQT_LITE_UNICODE -DQT_NO_LIBRARY -DQT_NO_STL -DQT_NO_COMPRESS -DQT_NO_DATASTREAM -DQT_NO_TEXTSTREAM -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_THREAD -DQT_NO_REGEXP -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_GEOM_VARIANT -DQT_NO_USING_NAMESPACE -D_LARGEFILE64_SOURCE -D_LARGEFILE

C++ Order of Declaration (in Multi-variable Declaration Line)

断了今生、忘了曾经 提交于 2019-12-05 06:03:38
I use the following in my C++ code: int a = 0, b = a; I would like to know if this behaviour is reliable and well defined (left to right order of name declaration) and that my code will not break with other compilers with an undeclared name error. If not reliable, I would break the statement: int a = 0; int b = a; Thank you. I believe the answer is no. It is subject to core active issue 1342 which says: It is not clear what, if anything, in the existing specification requires that the initialization of multiple init-declarators within a single declaration be performed in declaration order. We

Result type in structural refinement may not refer to a user-defined value class

半城伤御伤魂 提交于 2019-12-05 05:59:50
When I define Wrapper as value class(extending AnyVal): class Wrapper(val string: String) extends AnyVal def wrapperHolder(w: Wrapper): {def wrapper: Wrapper} = new { def wrapper: Wrapper = w } I have following compile error for wrapperHolder: Error:(5, 22) Result type in structural refinement may not refer to a user-defined value class def wrapper: Wrapper = w Why it doesn't work for value class? 来源: https://stackoverflow.com/questions/52678323/result-type-in-structural-refinement-may-not-refer-to-a-user-defined-value-class