In this thread
Matthew Leverton said that liballegro-5.0.0-RC2-md.a (liballegro-5.0.0-RC4-md.a in my case) needs to be linked.
Isn't that already done by adding the allegro\lib path to the Linker Directories?
If not how do i link it?
Getting Allegro to play nice or any library for that matter always seems to make me stumble too. I searched and read all kind of material over the internet to try and get RC4 to work but just can't seem to figure out what I'm doing wrong. I have read through the various threads here and none of them seem to help. Just a note I've pretty much done the same as Xero and am still having some of the same issues.
Okay so part of the problem is figured out if I use the library file "liballegro-5.0.0-RC4-md.a" I can get the first allegro 5 tutorial(The display one) to compile just fine. But what I'm really going after is trying to use "liballegro-5.0.0-RC4-monolith-static-mt.a" and "liballegro-5.0.0-RC4-monolith-static-mt-debug.a" and when attempt to compile using one of the two file Codeblocks seems to treat the file differently. I even make sure to define ALLEGRO_STATICLINK before all my headers and get various errors.
When linking statically, I think there are several other libraries that you have to link to as well. For instance, it looks like you're not linking to the OpenGL library according to your undefined reference to glGetString@4. It looks like there are other libraries you have to link to as well according to your log on pastebin.
Can someone post a list of the extra libraries that you need to link to when you're linking with Allegro5 statically please? I googled for them, but came up with nothing in the manual or documentation or forums.
Another note to put in here is I was using TDM-mingw and while everything has compile just fine, it seems that Allegro 5 and TDM-mingw is incompatible in some way at the moment. I'm getting the official Mingw right now but if this isn't some kind of mistake on my end maybe this needs to be documented?
Okay nevermind, I'm getting the same error with mingw as with TDG-mingw. The program compiles just fine but when I go to run it I get a window with this message "The procedure entry point __gxx_personality_v0 could not be located on the dynamic link library libstdc++-6.dll" I really have no clue what this message is trying to explain at all. This is the first of this kind of error I've ever seen. Any advice?
This document is the central repository for all information pertaining toexception handling in LLVM. It describes the format that LLVM exceptionhandling information takes, which is useful for those interested in creatingfront-ends or dealing directly with the information. Further, this documentprovides specific examples of what exception handling information is used for inC and C++.
A more complete description of the Itanium ABI exception handling runtimesupport of can be found at Itanium C++ ABI: Exception Handling. A description of theexception frame format can be found at Exception Frames,with details of the DWARF 4 specification at DWARF 4 Standard. A description for the C++ exceptiontable formats can be found at Exception Handling Tables.
Landing pad selection is encoded in the call site entry of the functioncontext. The runtime returns to the function via llvm.eh.sjlj.longjmp, wherea switch table transfers control to the appropriate landing pad based on theindex stored in the function context.
In contrast to DWARF exception handling, which encodes exception regions andframe information in out-of-line tables, SJLJ exception handling builds andremoves the unwind frame context at runtime. This results in faster exceptionhandling at the expense of slower execution when no exceptions are thrown. Asexceptions are, by their nature, intended for uncommon code paths, DWARFexception handling is generally preferred to SJLJ.
The runtime first attempts to find an exception frame corresponding to thefunction where the exception was thrown. If the programming language supportsexception handling (e.g. C++), the exception frame contains a reference to anexception table describing how to process the exception. If the language doesnot support exception handling (e.g. C), or if the exception needs to beforwarded to a prior activation, the exception frame contains information abouthow to unwind the current activation and restore the state of the prioractivation. This process is repeated until the exception is handled. If theexception is not handled and no activations remain, then the application isterminated with an appropriate error message.
Because different programming languages have different behaviors when handlingexceptions, the exception handling ABI provides a mechanism forsupplying personalities. An exception handling personality is defined byway of a personality function (e.g. __gxx_personality_v0 in C++),which receives the context of the exception, an exception structurecontaining the exception object type and value, and a reference to the exceptiontable for the current function. The personality function for the currentcompile unit is specified in a common exception frame.
The organization of an exception table is language dependent. For C++, anexception table is organized as a series of code ranges defining what to do ifan exception occurs in that range. Typically, the information associated with arange defines which types of exception objects (using C++ type info) that arehandled in that range, and an associated action that should take place. Actionstypically pass control to a landing pad.
A landing pad corresponds roughly to the code found in the catch portion ofa try/catch sequence. When execution resumes at a landing pad, itreceives an exception structure and a selector value corresponding to thetype of exception thrown. The selector is then used to determine which catchshould actually process the exception.
A request is made to allocate exception space for an exception structure.This structure needs to survive beyond the current activation. This structurewill contain the type and value of the object being thrown.
A call within the scope of a try statement can potentially raise anexception. In those circumstances, the LLVM C++ front-end replaces the call withan invoke instruction. Unlike a call, the invoke has two potentialcontinuation points:
The term used to define the place where an invoke continues after anexception is called a landing pad. LLVM landing pads are conceptuallyalternative function entry points where an exception structure reference and atype info index are passed in as arguments. The landing pad saves the exceptionstructure reference and then proceeds to select the catch block that correspondsto the type info of the exception object.
In C++, if an unhandled exception occurs, the language runtime will callstd::terminate(), but it is implementation-defined whether the runtimeunwinds the stack and calls object destructors first. For example, the GNUC++ unwinder does not call object destructors when an unhandled exceptionoccurs. The reason for this is to improve debuggability: it ensures thatstd::terminate() is called from the context of the throw, so thatthis context is not lost by unwinding the stack. A runtime will typicallyimplement this by searching for a matching non-cleanup clause, andaborting if it does not find one, before entering any landingpad blocks.
Once the landing pad has the type info selector, the code branches to the codefor the first catch. The catch then checks the value of the type info selectoragainst the index of type info for that catch. Since the type info index is notknown until all the type infos have been gathered in the backend, the catch codemust call the llvm.eh.typeid.for intrinsic to determine the index for a giventype info. If the catch fails to match the selector then control is passed on tothe next catch.
Do not allow a new exception to propagate out of the execution of acleanup. This can corrupt the internal state of the unwinder. Differentlanguages describe different high-level semantics for these situations: forexample, C++ requires that the process be terminated, whereas Ada cancels bothexceptions and throws a third.
When all cleanups are finished, if the exception is not handled by the currentfunction, resume unwinding by calling the resume instruction,passing in the result of the landingpad instruction for the originallanding pad.
This intrinsic returns the type info index in the exception table of the currentfunction. This value can be used to compare against the result oflandingpad instruction. The single argument is a reference to a type info.
For SJLJ based exception handling, this intrinsic forces register saving for thecurrent function and stores the address of the following instruction for use asa destination address by llvm.eh.sjlj.longjmp. The buffer format and theoverall functioning of this intrinsic is compatible with the GCC__builtin_setjmp implementation allowing code built with the clang and GCCto interoperate.
The single parameter is a pointer to a five word buffer in which the callingcontext is saved. The front end places the frame pointer in the first word, andthe target implementation of this intrinsic should place the destination addressfor a llvm.eh.sjlj.longjmp in the second word. The following three words areavailable for use in a target-specific manner.
For SJLJ based exception handling, the llvm.eh.sjlj.longjmp intrinsic isused to implement __builtin_longjmp(). The single parameter is a pointer toa buffer populated by llvm.eh.sjlj.setjmp. The frame pointer and stackpointer are restored from the buffer, then control is transferred to thedestination address.
For SJLJ based exception handling, the llvm.eh.sjlj.lsda intrinsic returnsthe address of the Language Specific Data Area (LSDA) for the currentfunction. The SJLJ front-end code stores this address in the exception handlingfunction context for use by the runtime.
For SJLJ based exception handling, the llvm.eh.sjlj.callsite intrinsicidentifies the callsite value associated with the following invokeinstruction. This is used to ensure that landing pad entries in the LSDA aregenerated in matching order.
c80f0f1006