Search Results

Search found 6159 results on 247 pages for 'compile'.

Page 2/247 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Printing factorial at compile time in C++

    - by user519882
    template<unsigned int n> struct Factorial { enum { value = n * Factorial<n-1>::value}; }; template<> struct Factorial<0> { enum {value = 1}; }; int main() { std::cout << Factorial<5>::value; std::cout << Factorial<10>::value; } above program computes factorial value during compile time. I want to print factorial value at compile time rather than at runtime using cout. How can we achive printing the factorial value at compile time? I am using VS2009. Thanks!

    Read the article

  • VS2010 - How to automatically stop compile on first compile error

    - by Ben Robbins
    {rant}First I'd like to say that this IS NOT A DUPLICATE. I've asked this question previously but it got closed as a duplicate when it isn't. This question is SPECIFIC to VS 2010 and the answers to the so-called duplicate work in VS 2008 but not in VS 2010 (at least not for me or anyone I know). So before you go closing something as a duplicate how about you read the question carefully and try the answer for yourself and see if it actually works. Apologies for the rant but there is no obvious way to contact the SO police that closed the issue or get it reopened. {/rant} At work we have a C# solution with over 80 projects. In VS 2008 we use a macro to stop the compile as soon as a project in the solution fails to build (see this question for several options for VS 2005 & VS 2008: http://stackoverflow.com/questions/134796/how-to-automatically-stop-visual-c-build-at-first-compile-error). Is it possible to do the same in VS 2010? What we have found is that in VS 2010 the macros don't work (at least I couldn't get them to work) as it appears that the environment events don't fire in VS 2010. The default behaviour is to continue as far as possible and display a list of errors in the error window. I'm happy for it to stop either as soon as an error is encountered (file-level) or as soon as a project fails to build (project-level). Answers for VS 2010 only please. If the macros do work then a detailed explanation of how to configure them for VS 2010 would be appreciated. Thanks.

    Read the article

  • Compile multiple C files with make

    - by Mohit Deshpande
    (I am running Linux Ubuntu 9.10, so the extension for an executable is executablefile.out) I am just getting into modular programming (programming with multiple files) in C and I want to know how to compile multiple files in a single makefile. For example, what would be the makefile to compile these files: main.c, dbAdapter.c, dbAdapter.h? (By the way, If you haven't figured it out yet, the main function is in main.c) Also could someone post a link to the documentation of a makefile?

    Read the article

  • Ant target for compile-time code instrumentation with Spring aspects

    - by alecswan
    I have developed a web application using Netbeans 6.7 and Ant. The webapp works, but I would like to refactor the code to use @Configurable Spring annotation for cleaner dependency injection. I was able to get load-time weaving (LTW) of Spring aspects to work intermittently (see http://forum.springsource.org/showthread.php?t=86904). At this point I would like to use compile-time weaving with my tool set. Could anybody provide an Ant target that I can use to weave Spring aspects at compile time? An extra credit will be given to anybody who explains how to configure Netbeans to execute the new Ant target right after code compilation. Thanks.

    Read the article

  • Compile rt73 driver (serialmonkey) on Ubuntu

    - by Curro
    Hello. I'm trying to compile some WiFi drivers I downloaded from SerialMonkey: http://rt2x00.serialmonkey.com/wiki/index.php/Downloads It's about a driver for a Ralink rt73 chipset. I already got the build-essentials and the kernel-headers on my computer. When I try to compile the driver using the "make" command I get this error: root@curro-ubuntu:/usr/src/rt73-cvs-2009041204/Module# sudo make make[1]: Entering directory `/usr/src/linux-headers-2.6.31-20-generic' Building modules, stage 2. MODPOST 0 modules make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-20-generic' rt73.ko failed to build! make: *** [module] Error 1 I've looked over the Internet and haven't found anything yet, I don't know why am I getting this error. I have Ubuntu 9.10 installed on this computer. I've seen some other persons having the same issue Any help would be greatly appreciated. Thanks in advance

    Read the article

  • Haskell compile time function calculation

    - by egon
    I would like to precalculate values for a function at compile-time. Example (real function is more complex, didn't try compiling): base = 10 mymodulus n = n `mod` base -- or substitute with a function that takes -- too much to compute at runtime printmodules 0 = [mymodulus 0] printmodules z = (mymodulus z):(printmodules (z-1)) main = printmodules 64 I know that mymodulus n will be called only with n < 64 and I would like to precalculate mymodulus for n values of 0..64 at compile time. The reason is that mymodulus would be really expensive and will be reused multiple times.

    Read the article

  • How to see full compile path in Eclipse?

    - by alleywayjack
    I have looked for an answer for this nearly every where that I can think of, but there doesn't seem to be any way to actually SEE what Eclipse "runs" to compile the projects (as it does need the JDK installed and visible to actually build). I ask because I imported a few jars into my project, and even though I've looked through all the javac documentation, I can't seem to figure out how to mimic it quite like Eclipse does. I really, really need to be able to compile on the command line in this case - Eclipse or any other IDE just isn't what is needed. I started to look through the Eclipse source, and although this sounds lazy, I just became overwhelmed and figured I would ask here first, hoping someone else had the same question at one point.

    Read the article

  • vs2008, opencv2.1,compile error in cxcore.hpp

    - by Long Gu
    Hi, gurus: I installed opencv2.1, made a new project (proj_A) using vs2008, used it for my computer vision tasks, it works fine. I copied an old project (proj_B, also made using vs2008) from other PC, compile it with ".h" and ".lib" files copied from opencv1.0 (which I did not install onto my PC), it compiles fine. I re-directed ".h" and ".lib" files in proj_B to opencv2.1 folders instead, compiled the proj_B, and then I got these errors from cxcore.hpp: class CV_EXPORTS RNG { public: enum { A=4164903690U, UNIFORM=0, NORMAL=1 }; // errors here, line 936 errors are: 5c:\opencv2.1\include\opencv\cxcore.hpp(936) : error C2143: syntax error : missing '}' before 'constant' 5c:\opencv2.1\include\opencv\cxcore.hpp(936) : error C2059: syntax error : 'constant' 5c:\opencv2.1\include\opencv\cxcore.hpp(936) : error C2143: syntax error : missing ';' before '}' 5c:\opencv2.1\include\opencv\cxcore.hpp(936) : error C2238: unexpected token(s) preceding ';' (400+ similar errors, but I believe the answer should be the same, so only list 1 set here) I compared setting for proj_A and proj_B, made them identical, and find no improvement. proj_A works well, proj_B refuse to compile. May I know what's wrong? Urgent, need to get it solved ASAP! Thanks a lot!

    Read the article

  • Shader compile log depending on hardware

    - by dreta
    I'm done with the core of my graphics engine and I'm testing it on every platform I can get my hands on. Now, what I noticed is that different drivers return different shader and program compile log content. For example, on my friend's laptop if you successfuly compile a shader then the log is simply empty. However on my PC I get some useful information along with it. So if I compile a vertex shader, I'll get: Vertex shader was successfully compiled to run on hardware. Which isn't that impressive, but is what happens when I compile a program. On my friend's computer the log is empty, since the program compiles. However on my own computer I get: Vertex shader(s) linked, fragment shader(s) linked. Which is awesome, because I'm attaching a geometry shader with 0 (I have a geometry shader file with trash, so it doesn't compile and the pointer is set to 0), and the compiler just tells me which shaders linked. Now it got me thinking, if I was going to buy a graphics card, is there a way for me to get the information about whether or not I'll get this "extended" compile information? Maybe it's vendor specific? Now I don't expect an answer TBH, this seems a bit obscure, but maybe somebody has any experience with this and could post it.

    Read the article

  • Compile Eclipse Project With Ant

    - by Confused
    I don't have eclipse on my system at all, but I have on my hands an eclipse project (flex) that I would like to compile and I was wondering if there was any way to do it with minimal to no changes having to be made. Is this possible?

    Read the article

  • compile wxWidget on Snow Leopard

    - by Quincy
    I just downloaded wxWidget source code on my snow leopard machine. The source code is the multiplatform one, so it contains windows and GTK components of wxWidget as well. I'd like to compile the wxWidget source code, but haven't found a good guide yet. This is my first step to create a multiplatform project, hopefully I would be able to use CMake to generate makefile later on. Any help would be appreciated.

    Read the article

  • Learning to compile in xcode

    - by 00PS
    I have started using c++ extensively in school and now my programs are getting to the point where have more than 1 file (i.e. header, driver, implementation file). I don't know enough about software development to understand or get a grasp of how to setup the build process by looking at apple's guides. Could someone walk me through how to compile a simple c++ project with a header and two c++ files in xcode? Do I first need to make a makefile??

    Read the article

  • iPhone 4.0 Beta compile for 3.1.3

    - by Mark
    I downloaded the iPhone 4.0 Beta. But for my projects I need to compile for 3.1.3 to be able to still submit my projects to the App Store. If I run an old project that isn't a problem I can see all the versions, but when I start a new project I can only pick the 4.0 beta, how can I fix this?

    Read the article

  • How do you compile without linking in Automake?

    - by MDH
    I am new to Automake and I am attempting to compile without linking. My goal is to generate a simple Makefile as shown below using Automake. CFLAG = -Wall build: Thread.o Thread.o: Thread.cc Thread.h g++ $(CFLAG) -c Thread.cc clean: rm -f *.o My attempt so far has brought me to the following Makefile.ac. noinst_PROGRAMS = thread thread_SOURCES = Thread.cc EXTRA_DIST= Thread.h Does anyone have any advice on how to simulate my original Makefile? Thanks in advance.

    Read the article

  • compile c for fastcgi

    - by joels
    I have a c script that I want to compile to a fastcgi script. Does anyone have a good ref or easy explanation on how to do this? I dont understand the docs...

    Read the article

  • c# Lambda Expression built with LinqKit does not compile

    - by Frank Michael Kraft
    This lambda does not compile, but I do not understand why. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Linq.Expressions; using LinqKit; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { var barModel = new BarModel(); string id = "some"; Console.WriteLine(barModel.subFor(id).ToString()); // output: m => (True AndAlso (m.key == value(ConsoleApplication2.Bar`1+<>c__DisplayClass0[ConsoleApplication2.Model]).id)) Console.ReadKey(); var subworkitems = barModel.list.Where(barModel.subFor(id).Compile()); // Exception {"variable 'm' of type 'ConsoleApplication2.Model' referenced from scope '', but it is not defined"} Console.WriteLine(subworkitems.ToString()); Console.ReadKey(); } } class Bar<TModel> { public Bar(Expression<Func<TModel, string>> foreignKeyExpression) { _foreignKeyExpression = foreignKeyExpression; } private Expression<Func<TModel, string>> _foreignKeyExpression { get; set; } public Expression<Func<TModel, bool>> subFor(string id) { var ex = forTargetId(id); return ex; } public Expression<Func<TModel, bool>> forTargetId(String id) { var fc = _foreignKeyExpression; Expression<Func<TModel, bool>> predicate = m => true; var result = predicate.And(m => fc.Invoke(m) == id).Expand(); return result; } } class Model { public string key; public string value; } class BarModel : Bar<Model> { public List<Model> list; public BarModel() : base(m => m.key) { list = new List<Model>(); } } }

    Read the article

  • Easy command line Java compile

    - by Nash0
    So I have to send a java project to someone outside our company who has no experience with java and they need to compile it. Is there an easy way to do it on the windows command line that does not require writing out lists of the files? Personally I think javac should be smart enough to handle javac * when in the folder just under the root of the package hierarchy. Is there anything in this ballpark?

    Read the article

  • Java compile error: reached end of file while parsing } [closed]

    - by adeo8
    I have the following source code public class mod_MyMod extends BaseMod public String Version() { return "1.2_02"; } public void AddRecipes(CraftingManager recipes) { recipes.addRecipe(new ItemStack(Item.diamond), new Object[] { "#", Character.valueOf('#'), Block.dirt }); } When I try to compile it I get the following error: java:11: reached end of file while parsing } What am I doing wrong? Any help appreciated.

    Read the article

  • How I can compile this C++ code that fails with "'::main' must return 'int'"? [migrated]

    - by krisu
    I have tried to find a solution that make batch file start flashing on taskbar and only good solution was this post on Stack Overflow. But I can't compile the code with WinGW or anything else to EXE, only getting this error: hello.cpp:6:32: error: '::main' must return 'int' Right now, I'm using TDM-GCC to compile code, because it's bit better... Can somebody give me code that actually works or even better compile it to EXE already? P.S. Even more better if somebody could compile this Delphi code, because I can't find any software that's free.

    Read the article

  • Compile-time lookup array creation for ANSI-C?

    - by multiproximus
    A previous programmer preferred to generate large lookup tables (arrays of constants) to save runtime CPU cycles rather than calculating values on the fly. He did this by creating custom Visual C++ projects that were unique for each individual lookup table... which generate array files that are then #included into a completely separate ANSI-C micro-controller (Renesas) project. This approach is fine for his original calculation assumptions, but has become tedious when the input parameters need to be modified, requiring me to recompile all of the Visual C++ projects and re-import those files into the ANSI-C project. What I would like to do is port the Visual C++ source directly into the ANSI-C microcontroller project and let the compiler create the array tables. So, my question is: Can ANSI-C compilers compute and generate lookup arrays during compile time? And if so, how should I go about it? Thanks in advance for your help!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >