compilation

Makefile C subdirectory rule to make obj

给你一囗甜甜゛ 提交于 2019-12-22 05:37:23
问题 I am running a simple Makefile with no problems: CC=gcc CFLAGS= -std=c99 -ggdb -Wall -I. DEPS = hellomake.h OBJ = hellomake.o hellofunc.o %.o: %.c $(DEPS) $(CC) -c -o $@ $< $(CFLAGS) hellomake: $(OBJ) gcc -o $@ $^ $(CFLAGS) The files are in the main project's directory: ./project/Makefile ./project/hellomake.c ./project/hellomake.h Then I tried to organized the files, and put things like: ./project/Makefile ./project/src/hellomake.c ./project/include/hellomake.h and extra subdirectories

How to make IntelliJ IDEA recognise code created by macros?

孤者浪人 提交于 2019-12-22 05:35:24
问题 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

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

浪尽此生 提交于 2019-12-22 05:27:13
问题 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. 回答1: 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

Compile Haskell programs to C

☆樱花仙子☆ 提交于 2019-12-22 05:14:38
问题 I have to following Haskell program I'm trying to compile to C. I've looked at this SO post, but could not get an answer there. quicksort [] = [] quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) where lesser = filter (< p) xs greater = filter (>= p) xs main = print(quicksort([5,2,1,0,8,3])) Here's what I tried: $ ghc -C main.hs And what I get is: ghc: the option -C is only available with an unregisterised GHC Usage: For basic information, try the `--help' option. This is a

Compile Haskell programs to C

扶醉桌前 提交于 2019-12-22 05:14:01
问题 I have to following Haskell program I'm trying to compile to C. I've looked at this SO post, but could not get an answer there. quicksort [] = [] quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) where lesser = filter (< p) xs greater = filter (>= p) xs main = print(quicksort([5,2,1,0,8,3])) Here's what I tried: $ ghc -C main.hs And what I get is: ghc: the option -C is only available with an unregisterised GHC Usage: For basic information, try the `--help' option. This is a

How often will a programmer be asked to write a makefile file? [closed]

送分小仙女□ 提交于 2019-12-22 04:42:58
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . Is makefile an advanced problem or a general problem for a programmer? For a C++ programmer, how often will he be asked to write a

What does Java compile an enumeration down to?

僤鯓⒐⒋嵵緔 提交于 2019-12-22 04:24:07
问题 A coworker and I had a discussion about how Java represents enumerations. I was under the impression they were strictly ints like C/C++. Or, if you add behavior (Type-Safe enum), it gets wrapped in a class. He believed that if it's small enough Java would compact it to a byte. However, I found this on the Oracle site: Java programming language enums are far more powerful than their counterparts in other languages, which are little more than glorified integers. The new enum declaration defines

Is C# code compiled to native binaries?

拥有回忆 提交于 2019-12-22 03:48:08
问题 I know that Java code is compiled into byte-code, that is executed by the JVM. What is the case with C# ? I have noticed that applications written in C# have the .exe extension what would suggest they are native machine instructions. but is it really so ? 回答1: No. Like Java, C# is compiled to an intermediary language (called MSIL or CIL). Unlike Java, the IL is stored in EXE files which have enough actual EXE code to show a dialog box asking users to install .Net. 回答2: C# compilation is done

how do i modify this ffmpeg build script for minimal binary size output

元气小坏坏 提交于 2019-12-22 00:31:19
问题 I'm trying to build the ffmpeg binaries for android on 3 chipsets. The output file size is too large to include in the project around 15mb. https://github.com/falnatsheh/ffmpeg-android is the github project repo the .sh build script for ffmpeg is like this #!/bin/bash . abi_settings.sh $1 $2 $3 pushd ffmpeg case $1 in armeabi-v7a | armeabi-v7a-neon) CPU='cortex-a8' ;; x86) CPU='i686' ;; esac make clean ./configure \ --target-os="$TARGET_OS" \ --cross-prefix="$CROSS_PREFIX" \ --arch="$NDK_ABI"

Are there any XSLT to C++ compilers available?

萝らか妹 提交于 2019-12-21 20:27:47
问题 I found only one attempt to create such compiler - http://sourceforge.net/projects/xsltc/. But this project is dead for decade already. Are there any other examples? Opensource or commercial? Are there any fundamental technical difficulties with building such software? With the whole approach of compiling XSLT natively? I suppose there are good use cases for using it - places where we don't need to change XSLT but still would like to get higher performance (and probably, lower memory