Search Results

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

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

  • FMOD Compiling trouble

    - by CptAJ
    I'm trying to get started with FMOD but I'm having some issues compiling the example code in this tutorial: http://www.gamedev.net/reference/articles/article2098.asp I'm using MinGW, I placed the libfmodex.a file in MinGW's include folder (I also tried linking directly to the filename) but it doesn't work. Here's the output. C:\>g++ -o test1.exe test1.cpp -lfmodex test1.cpp:4:1: error: 'FSOUND_SAMPLE' does not name a type test1.cpp: In function 'int main()': test1.cpp:9:29: error: 'FSOUND_Init' was not declared in this scope test1.cpp:12:4: error: 'handle' was not declared in this scope test1.cpp:12:53: error: 'FSOUND_Sample_Load' was not declared in this scope test1.cpp:13:30: error: 'FSOUND_PlaySound' was not declared in this scope test1.cpp:21:30: error: 'FSOUND_Sample_Free' was not declared in this scope test1.cpp:22:17: error: 'FSOUND_Close' was not declared in this scope This is the particular example I'm using: #include <conio.h> #include "inc/fmod.h" FSOUND_SAMPLE* handle; int main () { // init FMOD sound system FSOUND_Init (44100, 32, 0); // load and play sample handle=FSOUND_Sample_Load (0,"sample.mp3",0, 0, 0); FSOUND_PlaySound (0,handle); // wait until the users hits a key to end the app while (!_kbhit()) { } // clean up FSOUND_Sample_Free (handle); FSOUND_Close(); } I have the header files in the "inc" path where my code is. Any ideas as to what I'm doing wrong?

    Read the article

  • Encrypting password in compiled C or C++ code

    - by Daniel
    Hello!, I know how to compile C and C++ Source files using GCC and CC in the terminal, however i would like to know if its safe to include passwords in these files, once compiled. For example.. i check user input for a certain password e.g 123, but it appears compiled C/C++ programs is possible to be decompiled. Is there anyway to compile a C/C++ source file, while keeping the source completely hidden.. If not, could anyone provide a small example of encrypting the input, then checking against the password e.g: (SHA1, MD5)

    Read the article

  • implementing a read/write field for an interface that only defines read

    - by PaulH
    I have a C# 2.0 application where a base interface allows read-only access to a value in a concrete class. But, within the concrete class, I'd like to have read/write access to that value. So, I have an implementation like this: public abstract class Base { public abstract DateTime StartTime { get; } } public class Foo : Base { DateTime start_time_; public override DateTime StartTime { get { return start_time_; } internal set { start_time_ = value; } } } But, this gives me the error: Foo.cs(200,22): error CS0546: 'Foo.StartTime.set': cannot override because 'Base.StartTime' does not have an overridable set accessor I don't want the base class to have write access. But, I do want the concrete class to provide read/write access. Is there a way to make this work? Thanks, PaulH Unfortunately, Base can't be changed to an interface as it contains non-abstract functionality also. Something I should have thought to put in the original problem description. public abstract class Base { public abstract DateTime StartTime { get; } public void Buzz() { // do something interesting... } } My solution is to do this: public class Foo : Base { DateTime start_time_; public override DateTime StartTime { get { return start_time_; } } internal void SetStartTime { start_time_ = value; } } It's not as nice as I'd like, but it works.

    Read the article

  • Dynamically generating high performance functions in clojure

    - by mikera
    I'm trying to use Clojure to dynamically generate functions that can be applied to large volumes of data - i.e. a requirement is that the functions be compiled to bytecode in order to execute fast, but their specification is not known until run time. e.g. suppose I specify functions with a simple DSL like: (def my-spec [:add [:multiply 2 :param0] 3]) I would like to create a function compile-spec such that: (compile-spec my-spec) Would return a compiled function of one parameter x that returns 2x+3. What is the best way to do this in Clojure?

    Read the article

  • What is the .NET attribuet to not compile a method is release mode

    - by Russ
    I know that if I have a block of code I don't want compiled when in release mode I can wrap that code block in: #if DEBUG while(true) { Console.WriteLine("StackOverflow rules"); } #endif This will keep this code block from compiling in any mode other than DEBUG. I know there is an attribute that can be placed on an entire method that will do that same, but for the life of me I can't remember what that attribute is. I believe that it’s down the System.Diagnostics namespace, but I'm not really sure. BTW: I'm using .NET 4, but I know this attribute existed in .NET 2 because I have used in in old projects. Thanks

    Read the article

  • How to avoid Eclipse warnings when using legacy code without generics?

    - by Paul Crowley
    I'm using JSON.simple to generate JSON output from Java. But every time I call jsonobj.put("this", "that"), I see a warning in Eclipse: Type safety: The method put(Object, Object) belongs to the raw type HashMap. References to generic type HashMap should be parameterized The clean fix would be if JSONObject were genericized, but since it isn't, I can't add any generic type parameters to fix this. I'd like to switch off as few warnings as possible, so adding "@SuppressWarnings("unchecked")" to lots of methods is unappealing, but do I have any other option besides putting up with the warnings?

    Read the article

  • Is there a work around for invalid octal digit in an array?

    - by sircrisp
    I'm trying to create an array which will hold the hours in a day so I can loop through it for a clock. I have: int hourArray[24] = {12, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11, 12, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10, 11}; I am getting the error on the following numbers in order 08, 09, 08, 09. It tells me: Error: invalid octal digit I've never run into this before and I'm wondering if there is any way around it?

    Read the article

  • Using charAt in java

    - by ThuL?nå F?rñ?nDö
    This is my assignment: Write a program where the user enters a string, and the program echoes it to the monitor with one character per line: C:\>java LinePerChar Enter a string: Octopus O c t o p u s I have tried, but I'm getting some compilation errors. Here's my code: import java.util.*; class CharactorEcho{ public static void main(String args []){ Scanner sc = new Scanner(System.in); System.out.println("Enter a string :"); try { String inputString = sc.nextLine(); for(int i=0; i < sc.length(); i++) { char c = inputString.charAt(i); System.out.println("" + c); } } catch(IOException e) { } } }

    Read the article

  • Tips on using GCC as a new programmer

    - by ultrajohn
    I am really new to GCC and I don't how to use it. I already have a copy of a pre-compiled gcc binaries i've downloaded from one of the mirror sites in the gcc website.. Now, I don't where to go from here... Please give me some tips on the different path to proceed..

    Read the article

  • (this == null) in C#!

    - by SLaks
    Due to a bug that was fixed in C# 4, the following program prints true. (Try it in LINQPad) void Main() { new Derived(); } class Base { public Base(Func<string> valueMaker) { Console.WriteLine(valueMaker()); } } class Derived : Base { string CheckNull() { return "Am I null? " + (this == null); } public Derived() : base(() => CheckNull()) { } } In VS2008 in Release mode, in throws an InvalidProgramException. (In Debug mode, it works fine) In VS2010 Beta 2, it doesn't compile (I didn't try Beta 1); I learned that the hard way Is there any other way to make this == null in pure C#?

    Read the article

  • Looking for early paper about compiling object-oriented code

    - by Robert Kosara
    I remember reading a paper a long time ago that talked about object-oriented programming. I believe that this was from the early 1980s or perhaps even before then. This was at the time when object-oriented programming was still done through pre-processors, and one thing that stuck with me is this: it argued that you could write code in either procedural or object-oriented fashion, and after preprocessing/compiling, you would end up with the exact same machine code. Does anybody know which paper I'm talking about?

    Read the article

  • C++ (g++) Compile Error, Expected "="/etc. Before 'MyWindow" (my class name)

    - by Ell
    Hi all, I have a very strange problem and the following code wont compile: #ifndef MYWINDOW_HPP_INCLUDED #define MYWINDOW_HPP_INCLUDED class MyWindow{ private: WNDCLASSEX window_class; HWND window_handle; HDC device_context_handle; HGLRC open_gl_render_context; MSG message; BOOL quit; public: Window(int height=416, int width=544, WindowStyle window_style=WINDOWED); void Show(); void Close(); ~Window(); }; #endif // MYWINDOW_HPP_INCLUDED I get the following error: error: expected '=', ',', ';', 'asm' or 'attribute' before 'MyWindow' I can't see any syntax errors here, although I coukd be wrong as I am very (very) new in c++. Thanks in advance, ell.

    Read the article

  • Java compilation with two versions of Eclipse

    - by lepnio
    I've got an old project in Eclipse 2.1 and compiled with a JDK 1.4.2_12. I want to upgrade the version of Eclipse to Eclipse Galileo. I've imported my project and set the compilation level to 1.4 and I've also updated my build path to use the correct JDK. The problem is that when I compare the compiled files in the classes folder in the two versions of Eclipse, the MD5 checksum are different. Should I be worried about that fact or this is normal?

    Read the article

  • MSVC++ 6.0: Fatal error C1509 "Too many exception handler states in function"

    - by sep332
    I'm working on a project that uses a lot of generated files for a GUI. After some recent updates, I get this error. If I remove some controls (the new ones or some old ones, doesn't seem to matter which), the error goes away. I've temporarily worked around the problem, but I'd like a more permanent solution. I've seen mentioned on the web that there's a fix for this in VS.Net 2003, but I can't find anything for 6.0. Does anyone know of a hotfix or service pack that fixes this?

    Read the article

  • How to execute machine language from memory?

    - by Mike Curry
    I wrote a program to compile a simple text program to a compiled executable... Is it possible that I can load an executable to memory an some how point a pc counter to the memory space at will? Here is what I made that I would like to store the programs to memory for execution on demand... Kind of wanting to make a little web language like php but compile it... Just for learning. http://spiceycurry.blogspot.com/2010/05/simple-compilable-programming-language.html

    Read the article

  • Getting tree construction with ANTLR

    - by prosseek
    As asked and answered in http://stackoverflow.com/questions/2999755/removing-left-recursion-in-antlr , I could remove the left recursion E - E + T|T T - T * F|F F - INT | ( E ) After left recursion removal, I get the following one E - TE' E' - null | + TE' T - FT' T' - null | * FT' Then, how to make the tree construction with the modified grammar? With the input 1+2, I want to have a tree ^('+' ^(INT 1) ^(INT 2)). Or similar. grammar T; options { output=AST; language=Python; ASTLabelType=CommonTree; } start : e - e ; e : t ep - ??? ; ep : | '+' t ep - ??? ; t : f tp - ??? ; tp : | '*' f tp - ??? ; f : INT | '(' e ')' - e ; INT : '0'..'9'+ ; WS: (' '|'\n'|'\r')+ {$channel=HIDDEN;} ;

    Read the article

  • C++ compilation error when passing a function into remove_if

    - by garsh0p
    So here's a snippet of my code. void RoutingProtocolImpl::removeAllInfinity() { dv.erase(std::remove_if(dv.begin(), dv.end(), hasInfCost), dv.end()); } bool RoutingProtocolImpl::hasInfCost(RoutingProtocolImpl::dv_entry *entry) { if (entry-link_cost == INFINITY_COST) { free(entry); return true; } else { return false; } } I'm getting the following error when compiling: RoutingProtocolImpl.cc:368: error: argument of type bool (RoutingProtocolImpl::)(RoutingProtocolImpl::dv_entry*)' does not matchbool (RoutingProtocolImpl::*)(RoutingProtocolImpl::dv_entry*)' Sorry, I'm kind of a C++ newb.

    Read the article

  • looser throw specifier for in C++

    - by ML
    I am getting an error that says: error: looser throw specifier for 'virtual CPLAT::CP_Window::~CP_Window()' On the destructor, I have never heard of this before and some Google Searches say this might be a GCC 4 problem, which I would not be sure how to work around since I need GCC 4 to build a Universal Binary. My Environment: OS X 10.6, XCode 3.2.2, GCC 4 to build a universal binary. What is the issue?

    Read the article

  • C header file won't compile with C, but will with C++.

    - by Leif Andersen
    I have the following chunk of a header file BKE_mesh.h: /* Connectivity data */ typedef struct IndexNode { struct IndexNode *next, *prev; int index; } IndexNode; void create_vert_face_map(ListBase **map, IndexNode **mem, const struct MFace *mface, const int totvert, const int totface); void create_vert_edge_map(ListBase **map, IndexNode **mem, const struct MEdge *medge, const int totvert, const int totedge); Note that the header file was prepared for the possibility of being used in a C++ file, as it had: #ifdef __cplusplus extern "C" { #endif at the top of the file, and the needed finish at the bottom. But the class implementing it was written in C. Next, whenever I try to #include the header file, I get an odd error. If the file has a .cpp extension, it compiles just fine, no complaints whatsoever. However, if I do: #include "BKE_mesh.h" inside of a file with a .c extension, I get the following errors: expected ')' before '*' token for the two last functions, in specific, the variable: ListBase **map in both classes. (Note that earlier in the header file, it declared, but not defined ListBase). So, my question is: why is this valid C++ code, but not C code? Thank you.

    Read the article

  • Strategy for desugaring Haskell

    - by luqui
    I'm developing a virtual machine for purely functional programs, and I would like to be able to test and use the the wide variety of Haskell modules already available. The VM takes as input essentially terms in the untyped lambda calculus. I'm wondering what would be a good way to extract such a representation from modern Haskell modules (eg. with MPTC's, pattern guards, etc.). I did a little research and there doesn't seem to be a tool that does this already (I would be delighted to be mistaken), and that's okay. I'm looking for an approach. GHC Core seems too operationally focused, especially since one of the things the VM does is to change the evaluation order significantly. Are there any accessible intermediate representations that correspond more closely to the lambda calculus?

    Read the article

  • Determining where in the code an error came from - iPhone

    - by Robert Eisinger
    I'm used to Java programming where an error is thrown and it tells you at what line the error was thrown from which file. But with Objective-C in XCode, I can't ever tell where the error comes from. How can I figure out where the error came from? Here is an example of a crash error: 2011-01-04 10:36:31.645 TestGA[69958:207] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 0 beyond bounds for empty array' *** Call stack at first throw: ( 0 CoreFoundation 0x01121be9 __exceptionPreprocess + 185 1 libobjc.A.dylib 0x012765c2 objc_exception_throw + 47 2 CoreFoundation 0x011176e5 -[__NSArrayM objectAtIndex:] + 261 3 TestGA 0x000548d8 -[S7GraphView drawRect:] + 5763 4 UIKit 0x003e16eb -[UIView(CALayerDelegate) drawLayer:inContext:] + 426 5 QuartzCore 0x00ec89e9 -[CALayer drawInContext:] + 143 6 QuartzCore 0x00ec85ef _ZL16backing_callbackP9CGContextPv + 85 7 QuartzCore 0x00ec7dea CABackingStoreUpdate + 2246 8 QuartzCore 0x00ec7134 -[CALayer _display] + 1085 9 QuartzCore 0x00ec6be4 CALayerDisplayIfNeeded + 231 10 QuartzCore 0x00eb938b _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 325 11 QuartzCore 0x00eb90d0 _ZN2CA11Transaction6commitEv + 292 12 QuartzCore 0x00ee97d5 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 99 13 CoreFoundation 0x01102fbb __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27 14 CoreFoundation 0x010980e7 __CFRunLoopDoObservers + 295 15 CoreFoundation 0x01060bd7 __CFRunLoopRun + 1575 16 CoreFoundation 0x01060240 CFRunLoopRunSpecific + 208 17 CoreFoundation 0x01060161 CFRunLoopRunInMode + 97 18 GraphicsServices 0x01932268 GSEventRunModal + 217 19 GraphicsServices 0x0193232d GSEventRun + 115 20 UIKit 0x003b842e UIApplicationMain + 1160 21 TestGA 0x00001cd8 main + 102 22 TestGA 0x00001c69 start + 53 23 ??? 0x00000001 0x0 + 1 So from looking at this, where is the error coming from and from which class is it coming from?

    Read the article

  • C++ Templates: Convincing self against code bloat

    - by ArunSaha
    I have heard about code bloats in context of C++ templates. I know that is not the case with modern C++ compilers. But, I want to construct an example and convince myself. Lets say we have a class template< typename T, size_t N > class Array { public: T * data(); private: T elems_[ N }; }; template< typename T, size_t N > T * Array<T>::data() { return elems_; } Further, let's say types.h contains typedef Array< int, 100 > MyArray; x.cpp contains MyArray ArrayX; and y.cpp contains MyArray ArrayY; Now, how can I verify that the code space for MyArray::data() is same for both ArrayX and ArrayY? What else I should know and verify from this (or other similar simple) examples? If there is any g++ specific tips, I am interested for that too. PS: Regarding bloat, I am concerned even for the slightest of bloats, since I come from embedded context.

    Read the article

  • How can a language be interpreted by itself (like Rubinius)?

    - by japancheese
    I've been programming in Ruby for a while now with just the standard MRI implementation of Ruby, but I've always been curious about the other implementations I hear so much about. I was reading about Rubinius the other day, a Ruby interpreter written in Ruby. I tried looking it up in various places, but I was having a hard time figuring out exactly how something like this works. I've never had much experience in compilers or language writing but I'm really interested to figure it out. How exactly can a language be interpreted by itself? Is there a basic step in compiling that I don't understand where this makes sense? Can someone explain this to me like I'm an idiot (because that wouldn't be too far off base anyways)

    Read the article

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