2

Using the tutorial of Compiling GIMP I have compiled GIMP, GEGL, Babl in windows. i had some errors, but those were on GIMP. i am not concerned about GIMP right now. i just want to use the GEGL libraries to create some APIs in visual studio and run them. Now, my question is how to configure the Visual Studio for this. what changes should i make in the "project property"? what should i add in the "include directory", Library Directory? i just want to run a simple code, gegl initialization...

#include <gegl.h>
int main(int argc, char **argv)
{
gegl_init (&argc, &argv);
    // other GEGL code
gegl_exit ();
}
Sayak
  • 339
  • 1
  • 6
  • 19

1 Answers1

0

Put the directory where the header files are located into the Additional Include Directories of the C/C++ section.

Put the directories where the lib files are in the Additional Library Directories of the Linker/General section.

Put the names of the lib files in the Additional Dependency blank of the Linker/Input section.

I don't know this particular library, but if it has dlls, you'll need to copy those into the directory with your .exe.

jonsca
  • 10,218
  • 26
  • 54
  • 62
  • unfortunately i cannot find any lib files for GEGL or BABL. if you have gone through the tutorial that i have mentioned, you can see that the lib files are supposed to be here.. C:\gimp-win-beta\build\msys\1.0\home\User\stable-sources... but no lib files..!!! – Sayak May 20 '11 at 02:14
  • @Sayak Yes, then you're going to have to build them yourself. See if the project has a cmakefiles.txt in the source directory. Then you can use CMake to generate a makefile for use in Visual Studio. – jonsca May 20 '11 at 02:17
  • @Sayak I had assumed you had already built the supporting libraries, so that's how I answered the question. Sorry. – jonsca May 20 '11 at 02:18
  • @jonsca good news... i dont have cmakefiles.txt :) now what to do? – Sayak May 20 '11 at 02:47
  • @Sayak I went to look at the site you linked and it talks about using MSYS. Have you ever used those before? (these tools combined with the MinGW port of the gcc compiler allow you to emulate a UNIX/Linux build environment under Windows). I would say get ahold of the installer for those ([from here](http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/)) and avoid the hassle of doing it with Visual Studio. That way you can follow the directions on that site to the letter and will hopefully end up with a working product. The resulting libraries will... – jonsca May 20 '11 at 05:53
  • ...probably have to be used within that MSYS environment, though I'm not 100% on that. I wish I had better news, but it doesn't look like what you want to do will fly. I'm assuming that somewhere they have the code for the Windows version of GIMP, but it may have taken many modifications from the original Linux one. I'm not an expert in that area, unfortunately. – jonsca May 20 '11 at 05:57
  • @jonsca i want to use visual studio only bcos, after making the code in C, i can call the native codes by JNI and use it in android programming. C-> JNI -> Android. i have never used MSYS and i am not familiar with shell scripting. – Sayak May 20 '11 at 06:16
  • ... i cannot use GIMP bcos of license problem but i can use GEGL libraries. before i was using OpenCV. but the OpenCV library is very limited. so i wanted to change. so, at present what are my options? if i dont use visual studio, then how to compile the C codes using gegl library? – Sayak May 20 '11 at 06:17
  • @Sayak I'm not sure what to tell you. MSYS would just involve invoking gcc from the command line. I'm not sure if the JNI system would be able to interact with those binaries, but I would think so. The thing is, the more of these compatibility layers you put in, the less likely everything is to work, presumably. I would look around for the functionality you need in an (existing) Java or Android library. I know this must be very frustrating... – jonsca May 20 '11 at 06:26
  • @jonsca thanks for your effort. i am stuck in this for last 3 days and nowhere can i find a proper starting point. even if i try MSYS for compiling C codes by invoking gcc, what are they steps. i want to try and see whether JNI can interact or not... – Sayak May 20 '11 at 06:29
  • @Sayak in that document that you linked, there's an "Installing GEGL" heading that takes you through the downloading, untarring (which you've probably done already), and then the install and make steps. They are using MSYS, so it should be exactly what you need. – jonsca May 20 '11 at 06:33
  • @jonsca yes, i have done it already. for using GEGL, i also need Babl and gtk+. now where i write the c codes? how to compile? – Sayak May 20 '11 at 06:40
  • @jonsca also android can call functions in .so files. – Sayak May 20 '11 at 06:42
  • @Sayak Much in the same fashion, I would imagine. That tutorial has a section for Babl, and it looks like [this](http://www.ibiblio.org/apollo/WinGtkHowto.html) has the install instructions for using GTK+ under MSYS. – jonsca May 20 '11 at 06:48
  • @jonsca thanks a lot. let me try this. i will continue to comment in this thread (maybe again on monday). please have a look. meanwhile, if you get any other info, let me know. :) – Sayak May 20 '11 at 06:50
  • @Sayak I think I'm tapped out in terms of knowledge here. I think you can create .so files with MSYS/MinGW (look up 'shared libraries'). You're probably better off putting some of your inquiries out as posts, since you'll get a much wider audience than me! :) – jonsca May 20 '11 at 06:51
  • @Sayak Will do. I think our posts crossed. Good luck with it! – jonsca May 20 '11 at 06:52
  • @jonsca also in the link that i have posted earlier, there are some discrepancies. if you see the gtk+ section, the files are .zip. but in which directory they are to be extracted? the files are stored in gimp-win-beta/downloads. should i store them in /msys/1.0/ ? same is the case with libjpeg. – Sayak May 20 '11 at 07:42
  • @Sayak that I don't know, sorry... You can mount directories from your harddrive into MSYS via the 'mount' command – jonsca May 20 '11 at 08:48
  • @jonsca good morning, if you see the link about compiling GIMP that i have mentioned earlier, there is an answer to my questions. there is a way to create the .lib files using dlltool. but where can i get dlltool.exe? do i need to download it? – Sayak May 23 '11 at 03:02
  • @jonsca when i give dlltool --help command, it says dlltool: Command not found – Sayak May 23 '11 at 03:11