Search Results

Search found 5842 results on 234 pages for 'compiler warnings'.

Page 41/234 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Compile IL code at runtime using .NET 3.5 and C# from file

    - by nitefrog
    I would like to take a file that is an IL file, and at run time compile it back to an exe. Right now I can use process.start to fire off the command line with parameters (ilasm.exe) but I would like to automate this process from a C# service I will create. Is there a way to do this with reflection and reflection.emit? While this works: string rawText = File.ReadAllText(string.Format("c:\\temp\\{0}.il", Utility.GetAppSetting("baseName")), Encoding.ASCII); rawText = rawText.Replace("[--STRIP--]", guid); File.Delete(string.Format("c:\\temp\\{0}.il", Utility.GetAppSetting("baseName"))); File.WriteAllText(string.Format("c:\\temp\\{0}.il", Utility.GetAppSetting("baseName")),rawText, Encoding.ASCII); pi = new ProcessStartInfo(); pi.WindowStyle = ProcessWindowStyle.Hidden; pi.FileName = "\"" + ilasm + "\""; pi.Arguments = string.Format("c:\\temp\\{0}.il", Utility.GetAppSetting("baseName")); using(Process p = Process.Start(pi)) { p.WaitForExit(); } It is not ideal as I really would like this to be a streamlined process. I have seen examples of creating the IL at runtime, then saving, but I need to use the IL I already have in file form and compile it back to an exe. Thanks.

    Read the article

  • How do you set up your JScript (NOT JScript.NET) development environment?

    - by jJack
    In my environment, if I create a class in JScript syntax: class test{ } and then save it to a file named "test.js" and run it with wscript, I get a Microsoft JScript "Syntax error" at line 1. However, if I simply, say, write a function: function getInput() { var wshell = WScript.CreateObject("WScript.Shell"); wshell.Popup ("Do you want to continue?"); return userInput } getInput() and run it the same way, it works. Hopefully, there is something fundamentally wrong with my class definition. If that is the case, I am excited to find out.

    Read the article

  • Visual C++ doesn't operator<< overload

    - by PierreBdR
    I have a vector class that I want to be able to input/output from a QTextStream object. The forward declaration of my vector class is: namespace util { template <size_t dim, typename T> class Vector; } I define the operator<< as: namespace util { template <size_t dim, typename T> QTextStream& operator<<(QTextStream& out, const util::Vector<dim,T>& vec) { ... } template <size_t dim, typename T> QTextStream& operator>>(QTextStream& in,util::Vector<dim,T>& vec) { .. } } However, if I ty to use these operators, Visual C++ returns this error: error C2678: binary '<<' : no operator found which takes a left-hand operand of type 'QTextStream' (or there is no acceptable conversion) A few things I tried: Originaly, the methods were defined as friends of the template, and it is working fine this way with g++. The methods have been moved outside the namespace util I changed the definition of the templates to fit what I found on various Visual C++ websites. The original friend declaration is: friend QTextStream& operator>>(QTextStream& ss, Vector& in) { ... } The "Visual C++ adapted" version is: friend QTextStream& operator>> <dim,T>(QTextStream& ss, Vector<dim,T>& in); with the function pre-declared before the class and implemented after. I checked the file is correctly included using: #pragma message ("Including vector header") And everything seems fine. Doesn anyone has any idea what might be wrong?

    Read the article

  • Using member variables inherited from a templated base class (C++)

    - by Aaron Becker
    I'm trying to use member variables of a templated base class in a derived class, as in this example: template <class dtype> struct A { int x; }; template <class dtype> struct B : public A<dtype> { void test() { int id1 = this->x; // always works int id2 = A<dtype>::x; // always works int id3 = B::x; // always works int id4 = x; // fails in gcc & clang, works in icc and xlc } }; gcc and clang are both very picky about using this variable, and require either an explicit scope or the explicit use of "this". With some other compilers (xlc and icc), things work as I would expect. Is this a case of xlc and icc allowing code that's not standard, or a bug in gcc and clang?

    Read the article

  • What information about me and my system do compilers add to executeables?

    - by I can't tell you my name.
    I'm currently using Microsoft Visual Studio 2010. If we say that we give 10 different people a copy of MSVC 10 and a short C++ Hello, World listing. They all create a new project using exactly the same settings, add a new cpp file with the Hello, World program and compile it. Do they all get the exactly same binary? If not, what are the exact differences? What information about my system does MSVC add to my executeable? Paranoia!

    Read the article

  • How do polymorphic inline caches work with mutable types?

    - by kingkilr
    A polymorphic inline cache works by caching the actual method by the type of the object, in order to avoid the expensive lookup procedures (usually a hashtable lookup). How does one handle the type comparison if the type objects are mutable (i.e. the method might be monkey patched into something different at run time). The one idea I've come up with would be a "class counter" that gets incremented each time a method is adjusted, however this seems like it would be exceptionally expensive in a heavily monkey patched environ since it would kill all the PICs for that class, even if the methods for them weren't altered. I'm sure there must be a good solution to this, as this issue is directly applicable to Javascript and AFAIK all 3 of the big JS VMs have PICs (wow acronym ahoy).

    Read the article

  • Type classe, generic memoization

    - by nicolas
    Something quite odd is happening with y types and I quite dont understand if this is justified or not. I would tend to think not. This code works fine : type DictionarySingleton private () = static let mutable instance = Dictionary<string*obj, obj>() static member Instance = instance let memoize (f:'a -> 'b) = fun (x:'a) -> let key = f.ToString(), (x :> obj) if (DictionarySingleton.Instance).ContainsKey(key) then let r = (DictionarySingleton.Instance).[key] r :?> 'b else let res = f x (DictionarySingleton.Instance).[key] <- (res :> obj) res And this ones complains type DictionarySingleton private () = static let mutable instance = Dictionary<string*obj, _>() static member Instance = instance let memoize (f:'a -> 'b) = fun (x:'a) -> let key = f.ToString(), (x :> obj) if (DictionarySingleton.Instance).ContainsKey(key) then let r = (DictionarySingleton.Instance).[key] r :?> 'b else let res = f x (DictionarySingleton.Instance).[key] <- (res :> obj) res The difference is only the underscore in the dictionary definition. The infered types are the same, but the dynamic cast from r to type 'b exhibits an error. 'this runtime coercition ... runtime type tests are not allowed on some types, etc..' Am I missing something or is it a rough edge ?

    Read the article

  • Invalid instruction suffix for push when assembling with gas

    - by vitaut
    When assembling a file with GNU assembler I get the following error: hello.s:6: Error: invalid instruction suffix for `push' Here's the file that I'm trying to assemble: .text LC0: .ascii "Hello, world!\12\0" .globl _main _main: pushl %ebp movl %esp, %ebp subl $8, %esp andl $-16, %esp movl $0, %eax movl %eax, -4(%ebp) movl -4(%ebp), %eax call __alloca call ___main movl $LC0, (%esp) call _printf movl $0, %eax leave ret What is wrong here and how do I fix it?

    Read the article

  • Compiling a class using Java code using process

    - by Noona
    I have this piece of code that compiles a class called tspClassName, when I compile using this code: Process compileProc = null; try { compileProc = Runtime.getRuntime().exec("javac -classpath ." + File.separator + "src" + File.separator + File.separator + "generated." + tspClassName + ".java -d ." + File.separator + "bin"); // catch exception if (compileProc.exitValue() != 0) { System.out.println("Compile exit status: " + compileProc.exitValue()); System.err.println("Compile error:" + compileProc.getErrorStream()); it outputs this: "Compile exit status: 2 Compile error:java.io.FileInputStream@17182c1" The class tspClassName.java compiles without errors otherwise, so I am guessing it has to do with the path,and in my eclipse project, the tspClassName.java resides in package homework4.generated inside src, is there something wrong with the path that I use in the code? thanks

    Read the article

  • Clarification of atomic memory access for different OSs

    - by murrekatt
    I'm currently porting a Windows C++ library to MacOS as a hobby project as a learning experience. I stumbled across some code using the Win Interlocked* functions and thus I've been trying to read up on the subject in general. Reading related questions here in SO, I understand there are different ways to do these operations depending on the OS. Interlocked* in Windows, OSAtomic* in MacOS and I also found that compilers have builtin (intrinsic) operations for this. After reading gcc builtin atomic memory access, I'm left wondering what is the difference between intrinsic and the OSAtomic* or Interlocked* ones? I mean, can I not choose between OSAtomic* or gcc builtin if I'm on MacOS when I use gcc? The same if I'd be on Windows using gcc. I also read that on Windows Interlocked* come as both inline and intrinsic versions. What to consider when choosing between intrinsic or inline? In general, are there multiple options on OSs what to use? Or is this again "it depends"? If so, what does it depend on? Thanks!

    Read the article

  • Compilation problem in the standard x86_64 libraries

    - by user350282
    Hi everyone, I am having trouble compiling a program I have written. I have two different files with the same includes but only one generates the following error when compiled with g++ /usr/lib/gcc/x86_64-linux-gnu/4.4.1/../../../../lib/crt1.o: In function `_start': /build/buildd/eglibc-2.10.1/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to `main' collect2: ld returned 1 exit status The files I am including in my header are as follows: #include <google/sparse_hash_map> using google::sparse_hash_map; #include <ext/hash_map> #include <math.h> #include <iostream> #include <queue> #include <vector> #include <stack> using std::priority_queue; using std::stack; using std::vector; using __gnu_cxx::hash_map; using __gnu_cxx::hash; using namespace std; Searching the internet for those two lines hasn't resulted in anything to help me. I would be very grateful for any advice. Thank you

    Read the article

  • <function> referenced from; symbol(s) not found.

    - by jfm429
    I have a piece of C code that is used from a C++ function. At the top of my C++ file I have the line: #include "prediction.h" In prediction.h I have this: #ifndef prediction #define prediction #include "structs.h" typedef struct { double estimation; double variance; } response; response runPrediction(int obs, location* positions, double* observations, int targets, location* targetPositions); #endif I also have prediction.c, which has: #include "prediction.h" response runPrediction(int obs, location* positions, double* observations, int targets, location* targetPositions) { // code here } Now, in my C++ file (which as I said includes prediction.h) I call that function, then compile (through Xcode) I get this error: "runPrediction(int, location*, double*, int, location*)", referenced from: mainFrame::respondTo(char*, int)in mainFrame.o ld: symbol(s) not found collect2: ld returned 1 exit status prediction.c is marked for compilation for the current target. I don't have any problems with other .cpp files not being compiled. Any thoughts here?

    Read the article

  • va_list has not been declared

    - by David Doria
    When compiling some working code on Fedora 11, I am getting this error: /usr/include/c++/4.4.1/cstdarg:56: error: ‘::va_list’ has not been declared I am using: [doriad@davedesktop VTK]$ g++ --version g++ (GCC) 4.4.1 20090725 (Red Hat 4.4.1-2) Does anyone know what the problem could be? Thanks, Dave

    Read the article

  • Getting the errors for code in unopened .aspx pages

    - by Glennular
    Is there a way to check for errors in unopened *.ASPX pages. For example, if you change the name of a function Visual Studio will catch the error on the page and list it in the "Error List" only if the page is opened and being validated? I guess the question could be is there a validation option opposed to the compile option to check for errors? (Yes, i know code should go into the pre-compiled code-behind pages.) How do i find out about the following without running the page through the webserver or opening the page to be validated in VS? <script runat="server"> Public Sub MyFunciton() Undefined_FUNCTION() End Sub </script>

    Read the article

  • implementing type inference

    - by deepblue
    well I see some interesting discussions here about static vs. dynamic typing I generally prefer static typing, due to compile type checking, better documented code,etc. However I do agree that they do clutter up the code if done the way Java does it, for example. so Im about to start building a language of my own and type inference is one of the things that I want to implement, in a functional style language... I do understand that it is a big subject, and Im not trying to create something that has not been done before, just basic inferencing... any pointers on what to read up that will help me with this? preferably something more pragmatic/practical as oppose to more theoretical category theory/type theory texts. If there's a implementation discussion text out here, with data structures/algorithms, that would just be lovely much appreciated

    Read the article

  • Is it possible in Perl to require a subroutine call is made?

    - by MitchelWB
    I don't know enough about Perl to even know what I'm asking for exactly, but I'm writing a series of subroutines to be available for many individual scripts that all process different incoming flat files. The process is far from perfect, but it's what I've got to deal with and I'm trying to build myself a small library of subs that make it easier for me to manage it all. Each script handles a different incoming flat file with it's own formatting, sorting, grouping and outputting requirements. One common aspect is that we have small text files that house counters that are used to name the output files so that we have no duplicate file names. Because the processing of the data is different for each file, I need to open the file to get my counter value, because this is a common operation, I'd like to put it in a sub to retrieve the counter. But then need to write specific code to process the data. And would like a second sub that allows me to update the counter with the counter once I've processed the data. Is there a way to make the second sub call a requirement if the first one is called? Ideally if it could even be an error that would prevent the script from running at all much like a syntax error. EDIT: Here is a little [ugly and simplified] psuedo-code to give a better feel for what the current process is: require "importLibrary.plx"; #open data source file open DataIn, $filename; #call getCounterInfo from importLibrary.plx to get the counter value from counter file $counter = &getCounterInfo($counterFileName); while (<DataIn>) { #Process data based on unique formatting and requirements #output to task files based on requirements and name files using the $counter #increment $counter } #update counter file with new value of $counter &updateCounterInfo($counter);

    Read the article

  • Trouble compiling some decompiled C# code

    - by Colin O'Dell
    I was decompiling an open-source project (because the source for the latest version hasn't been released yet). Using RedGate's Reflector tool, it gave me this block of code: if(somecondition == true) { ref Vector3i vectoriRef; float num17 = length - num; Vector3i end = vectori3; (vectoriRef = (Vector3i) &end)[1] = vectoriRef[1] - ((int) num17); } somecondition is a boolean. length and num are floats defined outside the code. vectori3 is also defined outside the code and is of type Vector3i. The type Vector3i is essentially this code, but with x, y, and z stored as integers. When I try to compile this decompiled code, I get the following errors: Line 2: Only assignment, call, increment, decrement, and new object expressions can be used as a statement Line 3: ; expected Line 3: Invalid expression term 'ref' Line 6: 'Vector3i' is a 'type' but is used like a 'variable' Any thoughts on how I can fix this code so it compiles correctly and does whatever it was intended to do?

    Read the article

  • Boost Filesystem Library Visual C++ Compile Error

    - by John Miller
    I'm having the following issue just trying to compile/run some of the example programs with the Boost Filesystem Library. I'm using MS-Visual C++ with Visual Studio .NET (2003). I've installed the Boost libraries, version 1.38 and 1.39 (just in case there was a version problem) using the BoostPro installers. If I just try to include /boost/filesystem/operations.hpp I receive the following error: \boost_1_38\boost\system\error_code.hpp(230) : error C2039: 'type' : is not a member of 'boost::enable_if<boost::system::is_error_condition_enum<Cond,boost::detail::enable_if_default_T>' Any help is greatly appreciated. Thank you!

    Read the article

  • C++ enumeration

    - by asli
    Hi,my question is about enumeration,my codes are : #include<iostream> using namespace std; int main() { enum bolumler {programcilik,donanim,muhasebe,motor,buro} bolum; bolum = donanim; cout << bolum << endl; bolum += 2; // bolum=motor cout << bolum; return 0; } The output should be 1 3 but according to these codes the error is: error C2676: binary '+=' : 'enum main::bolumler' does not define this operator or a conversion to a type acceptable to the predefined operator Error executing cl.exe. 111.obj - 1 error(s), 0 warning(s) Can you help me ?The other question is what can I do if I want to see the output like that "muhasebe"?

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >