[Lemon-user] Using lemon library in Dev C++
D Haley
mycae at yahoo.com
Sat Oct 16 21:49:07 CEST 2010
Hello,
I am not a lemon author, just some random user:
Dev-C++ is just a graphical layer over the real backend called "minGW" (minimalist GNU for windows). This is a different unix environment compatibility layer than cygwin, which is separate.
So basically, the setup for cygwin should not affect your minGW install. In turn, dev-C++ will not see lemon when you install it for mingw. Remember, dev-c++ is not a compiler, its just a graphical system that wraps up the actual compiler ("gcc") and organises your source code.
Now the hard bit. MinGW is a difficult to use and understand project, as it does not have the nice package installer that cygwin does. Nor does it supply a terminal to use directly.
So the trick is then you have to build a copy of the lemon library, using the compiler & library versions that exactly reflect your computer, and then use that. In short, Dev-C++ is a bit complex to modify.
The semi-good news is that you can actually just use dev-C++ as a text editor, and simply issue the compile commands by hand in the cygwin window. I would guess that you have installed lemon correctly, and are linking it properly with your program (when using cygwin), because the exe is appearing. If there was a problem with locating the installed lemon library I would expect lots of "undefined reference to blah in...." errors.
You get the DLL message because you are probably running the built executable from windows explorer (by double clicking the exe). This is because windows has no idea to search for DLLs inside cygwin's folder, whilst this could be set up in theory, in practice it results in DLLs from different applciations being available, and the program you are trying to run not knowing which DLL to use (called DLL hell (its on wiki)).
Windows however will search the folder that the program resides in (the working directory), and thus you can simply copy the directory from cygwin's bin folder into the program dir, and the DLL will be found.
Alternately, if you run the program from within the cygwin terminal, using ./nameofyourprogram.exe , then you can run the program from within cygwin. This has the added advantage that the terminal will persist after the program finishes, so you can avoid the non-portable call to "system("PAUSE")" at the end of your program.
In short, I personally would recommend just compiling by hand, and if this gets to complicated, lookup how to write and use "makefiles", which is the step that dev-c++ does for you.
Hope this helps, and was at the right level of detail.
(apologies if this gets sent multiple times, email be slow today...)
--- On Sun, 10/17/10, Nayyar Kazmi <nayyarkazmi50 at yahoo.com> wrote:
> From: Nayyar Kazmi <nayyarkazmi50 at yahoo.com>
> Subject: [Lemon-user] Using lemon library in Dev C++
> To: lemon-user at lemon.cs.elte.hu, lemon-user at lemon.cs.elte.hu
> Date: Sunday, October 17, 2010, 1:57 AM
> Hello
>
> I am a Phd student, working on graphs and algorithms. I
> have been trying to use lemon in dev-C++ program in windows
> environment, but i get error messages. When I use cygwin and
> compile the code on command line it does compile it, but I
> am not very comfortable with cygwin environment. The exe
> file compiled at cygwin does not run from windows. I get the
> message cygwin1.dll not found -- although it is in the bin
> folder.
>
> Have I done any mistake in installation?
>
> Regards
>
> Nayyar Kazmi
>
>
>
>
>
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
>
More information about the Lemon-user
mailing list