How to start using GDAL and compile it by Dev-C++ - gdal

I am new to GIS and I have a programming background but currently I am interested to develop a GIS software that can display a shapefile in a Windows form app. For the GUI part I use a Windows API and for the GIS part I want to use GDAL/OGR libraries.
I was reading and using the documentation of the GDAL site http://gdal.org/ogr_apitut.html and I try to use their example code, but when I compile it using Dev-C++ I can't complete the compilation properly.
From the above site I get this code:
#include "ogrsf_frmts.h"
#include"gdal_priv.h"
#include"gdal.h"
int main()
{
GDALAllRegister();
}
When I compile the above code using Dev-C++ I get an error like the following:
undefined reference to OGRRegisterAll

Related

NReco.PdfGenerator.HtmlToPdfConverter' is not defined

Hi this may sound like a dumb question, but I am trying to use the NReco PDF library in my VB.NET Win Form application, and I am getting this error when I try to compile my code:
NReco.PdfGenerator.HtmlToPdfConverter' is not defined
I added the reference to the DLL and when I first wrote this code:
Dim converter As New NReco.PdfGenerator.HtmlToPdfConverter
It recognized the NReco namespace and everything seemed fine, but whenever I try to compile it acts like the DLL is missing. I know this library is written in C# but the site just said it was a .NET library, and I have used other libraries written in C# with no problem.
Any ideas on why this isn't working?
I never could figure out why NReco wasn't working, but I did find a pretty awesome alternative that works very well.
Nuget Package: https://www.nuget.org/packages/Pechkin/
Source Code: https://github.com/gmanny/Pechkin
This library uses WebKit Engine to convert HTML to PDF and it does a very nice job of rendering things correctly thanks to WebKit.
It is relatively easy to use and it is free to use under the creative commons license. I highly recommend this library for anybody wanting this functionality for free.

Binding objective-c library to Xamarin Project using Objective Sharpie

I am developing an iOS application using Xamarin Studio. The application is going to work with Infinite Peripherals Linea Pro 5 (a barcode scanner that you attache to an iPod/iPhone).
The Linea SDK provided by Infinite Peripherals is an objective-c library with an associated header file. I've followed Xamarins iOS binding tutorial, skipping the first parts and starting at chapter "3.2. Create a Xamarin.iOS Binding Project" (since I already have the fat binary file).
I have installed Objective Sharpie v0.4.11 and the Xcode Command Line Tools.
When I try to create the binding using Objective Sharpie I get the following error message:
After some research I find that this probably is a bug caused by Objective Sharpie, but is there any way around this bug? I really need to get this library in to my MonoTouch project.
P.S.
I have also checked out the tutorial by David Sandor, but it is really outdated and I do not possess enough knowledge to update it.
If Objective-Sharpie doesn't work for your project, you can:
Do a manual binding, or build upon David Sandor's one. That's not that hard.
Try to find the offending part of the header file, by removing part of it and process it with Obj-Sharpie (the header file is not that long, once you strip the comments away)

Experience with using google closure library in AIR?

I would like to try closure library in an AIR application. Will be using objects like goog.editor, goog.events and goog.dom.
In an older book I'm reading about google closure it says it's using eval in some functions. I haven't tried using uncompiled code in AIR yet but suspect it would not work because eval isn't allowed in privileged code. Plan to compile the code to be used in the AIR application.
The application would be made of a html page with code using some AIR specific things like save as and copy to clipboard. It will not have any ActionScript or swf files.
Has anyone tried using closure library in AIR applications? If so are there things to look out for?
The Closure library uses eval in it's JSON parser, the JsonDataSource, and the ModuleLoader but otherwise does not (AFAIK) use eval in any core libraries for standard components. As long as you avoid those cases I would not expect that to be an issue, but I'm not familiar with how AIR restricts usage of that.

Has anyone attempted to place compiled code in an NSBundle and load it at runtime? [duplicate]

As is known to everyone, static libraries can work well in an Iphone App and your App can be easily approved by IOS App Store
Unfortunately, the two static libraries I'm using now have the some C functions and variables.
so I compiled them into *.dylib (dynamic libraries), and copy them to "Bundle Resources" in XCode.
dylib_handle = dlopen(dylib_path_in_resource_bundle, RTLD_LAZY);
func = dlsym(dylib_handle, "func");
// invoke func();
This works well in simulator and Ipad (of course, different dynamic libraries).
I noticed that somebody said Iphone app does not support any third party dynamic libraries and my app will be rejected. (see here)
but I carefully read the "App Store Review Guidelines", I found no item meet my question.
I'm confused now!
Does iphone app support dynamic libraries? Does IOS AppStore allow this?
Who can give me an official response.
As Bernardo Ramos states in a comment: "Since iOS8 we can use dynamic libraries".
Dynamic libraries are not allowed by the App Store. No code may be loaded at run-time. The answer is to convert them to static libraries and compile them into the application.
From iPhoneOSTechOverview:
"If you want to integrate code from a framework or dynamic library into your application, you should link that code statically into your application’s executable file when building your project."
Read "should" as "must"
See SO Answer: Can create dynamic library for iOS?
No, dynamic libraries are not allowed.
But you can create static libraries, and even "static frameworks" (that is, like a classic framework is, a folder with the ".framework" extension and containing your Headers, resource files if any, and the lib itself, except that your lib must be a static library).

Include ImageMagick in MonoTouch

What's the best way to use ImageMagick in MonoTouch?
Adding the ImageMagickNET lib seems to produce errors during runtime, such as:
Method
'Module:CrtImplementationDetails.DoDllLanguageSupportValidation
()' in assembly
'/ImageMagickNET/bin/ReleaseQ8/ImageMagickNET.dll'
contains native code that cannot be
executed by Mono on this platform. The
assembly was probably created using
C++/CLI.
There are iPhone-specific binaries available, I suppose I have to link the whole library as described here:
http://monotouch.net/Documentation/Binding_New_Objective-C_Types
?
Thank you for your help :)
First, why this does not work.
Second, what you can do about it.
Why it does not work: The library that you are using is compiled with C++/CLI compiler against the Microsoft libraries.
All managed code that you use in MonoTouch must be compiled using MonoTouch's assemblies and tools, so the above wont work for two reasons: (a) Mono lacks a C++/CLI compiler and (b) even if that existed, you would have to reference the Mono asseblies
What can you do about it: You can build ImageMagic with Apple's C compiler, and then link the resulting code into your application:
http://monotouch.net/Documentation/Linking_Native_Libraries
Then for each ImageMagick method that you want to access, you need to wrap it using P/Invoke, a guide is available here:
http://www.mono-project.com/Interop_with_Native_Libraries
that error answers your question for you :
in assembly '/ImageMagickNET/bin/ReleaseQ8/ImageMagickNET.dll' contains native code that
cannot be executed by Mono on this
platform.
A quick google tells me on the imagemagick codeplex page
that you're probably using what is called a 'wrapper'.
this means that the imagemagick code itself is still non-.NET imagemagick, which will never run on your iPhone.