compiler

How do I compile my Java source files?

My source files are in this folder: c:\data\mycompany. All of my source files contain the following as the first line: package mycompany; Now from the c:\data folder, I compiled everything using this command: javac mycompany/*.java -extdirs c:\some\other\folder\with\libs. This compiles fine. Now when I try to execute it (again from c:\d...

Using javax.tools.ToolProvider from a custom classloader?

It seems to be impossible to use javax.tools.ToolProvider from a custom classloader as required by Ant or Webstart: http://bugs.sun.com/view_bug.do?bug_id=6548428 javax.tools.ToolProvider.getSystemJavaCompiler() loads javax.tools.JavaCompiler into a URLClassLoader whose parent is the system classloader. The API does not seem to allow us...

Unresolved external symbol when lib is linked, compiler adds the letter 'A' to the function name

I get this error when trying to link a win32 exe project. I have linked in the lib that contains the code for this method. But still gets an unresolved symbol error. error LNK2001: unresolved external symbol "public: bool __thiscall SharedJobQueue::AddJobA(class boost::shared_ptr<class domain::Job>)" (?AddJobA@SharedJobQueue@@QAE_NV?$sh...

"Type and Size Specifier" - Terminology

Take the following snippet: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int foo(char [6]); 4 5 int main(void) { 6 char* bar="hello"; 7 return foo(bar); 8 } 9 10 int foo(char f[6]) { 11 return EXIT_SUCCESS; 12 } 13 What is the right technical term for "char [6]" on line 3? I call it "type and...

Engine Matlab issues

Hello, I am triyng to implement Matlab in a c++ program. http://www.cl.cam.ac.uk/~sjeh3/wii/ The application is using gtk a wii mote lib and the Matlab Camera Calibration Toolbox (http://www.vision.caltech.edu/bouguetj/calib_doc/ ). it works perfectly. I want to use matlab ploting tools to build a graphic provided by the application. B...

how to define a grammar for a programming language

how to define a grammar (context-free) for a new programming language (imperative programming language) that you want to design from scratch. In other words : how do you proceed when you want to create a new programming language from scratch. ...

Haskell: syntax error when adding new line in pattern matching

Basically I'm modifying a parser to handle additional operators. Before my changes, one part of the parser looked like this: parseExpRec e1 (op : ts) = let (e2, ts') = parsePrimExp ts in case op of T_Plus -> parseExpRec (BinOpApp Plus e1 e2) ts' T_Minus -> parseExpRec (BinOpApp Minus e1 e2) ts' T_Times -...

Problems after editing ~/.gdbinit

I put this in my .gdbinit after seeing it on CocoaDev: fb -[NSException raise] fb -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] fb -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] #define NSZombies # this will give you help messages. Set to NO to turn them off. set env Malloc...

Can I ask VC++ linker to ignore unresolved externals?

I'm trying to build a very complex open-source project with VC++. The project consists of dozens of libraries and one executable depending on those libraries. For some reasons VC++ linker doesn't want to see about 40 functions implemented in one of those libraries and reports "unresolved external reference" on each, so I can't link. I d...

C++ string literal data type storage

void f() { char *c = "Hello World!" } Where is the string stored? What's the property of it? I just know it is a constant, what else? Can I return it from inside of the function body? ...

Compiling for x64 on x86 System in VS08, no binaries are created

I've got a C++ (Native) DLL that I'm trying to compile for x64 on my x86 system, which should work fine, but the actual binaries are not being created. The build process runs and VS says that everything was successful, but when I go into .\x64\Release\ the only file that is there is test.dll.intermediate.manifest, which is just a bunch ...

What's wrong with my Scheme compiler?

I'm wondering why nested function calls don't work. I'm implementing Dybvig's Heap-based model from his paper http://www.cs.indiana.edu/~dyb/pubs/3imp.pdf Chapter 3. I'm doing it in JavaScript. Source is here: http://github.com/z5h/zb-lisp Pretty much everything is in parser.js right now. To run, load test.html in Firefox with Fireb...

Why does Perl treat a hash element as list context at declaration?

Given this code: #!/usr/bin/perl -w use strict; use warnings; sub foo { return wantarray ? () : "value1"; } my $hash = { key1 => foo(), key2 => 'value2' }; use Data::Dumper; print Dumper($hash); I get the following output: $VAR1 = { 'key1' => 'key2', 'value2' => undef }; When I would expect: $VAR1 = { 'key1' ...

compiling linux kernel with non-gcc

Hello. Linux kernel is written for compiling with gcc and uses a lot of small and ugly gcc-hacks. Which compilers can compile linux kernel except gcc? The one, which can, is the Intel Compiler. What minimal version of it is needed for kernel compiling? There also was a Tiny C compiler, but it was able to compile only reduced and speci...

Why doesn't the C# compiler stop properties from referring to themselves?

If I do this I get a System.StackOverflowException: private string abc = ""; public string Abc { get { return Abc; // Note the mistaken capitalization } } I understand why -- the property is referencing itself, leading to an infinite loop. (See previous questions here and here). What I'm wondering (and what I di...

Best way to self study Compilers: Principles, Techniques & Tools

I'm trying to study the book referenced in the title but am having a hard time. Can anyone suggestion some tips? ...

Compile time error plugins for Php

I know that php is a scripting language like perl.python. But, is there a eclipse plugin which gives a error when a function taht is called doesn't exists. Or when a variable which is defined in the doesn't exists. There are too many careless mistakes that are happening with me in a huge project. I miss java for this. Any compile tim...

Eclipse > CDT + Cygwin > How to configure a C++ compiler?

So, I've been looking all over. I can't find anywhere that talks about specifically how to configure Eclipse + CDT to run the gcc / gcc++ compiler. I am running Eclipse on a windows box, but I've installed Cygwin. [edit] I've installed Cygwin, and I've added C:\Cygwin\bin to my path environment variable. I'm now getting this error...

Performance gains when compiling .NET 1.1 COM+ components code with .NET 3.5 compiler

Hi. I need to build a service in form of a COM+ component using Enterprise Services. The service is working right now. It gets a string does some spell-checking and returns a string. My question is: This component was compiled in .NET 1.1 but my environment is going to change to .NET 3.5 soon. So if I compile the code in .NET 3.5 (w...

How to get a modified generated Android IInterface file in an apk?

I'd like to add a step to the Android build process in Eclipse, which will modify the generated IInterface files that are based on aidl files. I've written a custom rewriter, which does the rewriting. I inserted this rewriter as a custom builder in Eclipse between the Android Pre Compiler and the Java Builder. The problem is that the ...