| View previous topic :: View next topic |
| Author |
Message |
epag00 beginner
Joined: 15 Apr 2007 Posts: 6 Location: Italy
|
Posted: 15.04.2007, 22:06 Post subject: Problem running executables under Ms Windows |
|
|
Hello all,
I installed PILIB on my Microsoft Windows XP SP2 machine, following the instructions given in this topic.
Everything was ok during the installation and I tried to compile (with g95 version 0.9) and run the example code suggested in the PILIB website. I did it under Msys and all went well: I ran the executable file typing its name and the "Hello World" windows appeared correctly.
Then I closed Msys and tried to run the executable with the double-click on the icon in the Ms Windows folder and the OS says that he can't find "libpilib-0.dll". I can't understand why this happens.
I tried to copy the .dll file in the same directory of the executable or in "C:\Windows\system" folder and I get the same effect: the command prompt window opens with this message: | Code: | | *** no graphical output available | What this means? How can I make running the executable even in "pure" Ms Windows environment?
I searched the forum and I think this problem is brand new, otherwise please excuse me but I can't figure out how to solve my question using the answers on other posts.
Remember that I'm using:- Ms Windows Xp SP2;
- MinGW 5.1.3;
- MSYS 1.0.10;
- g95 0.9;
- gtk-dev-2.10.11-win32-1;
- PILIB CVS version (downloaded today)
Thanks in advance and please excuse my bad english! _________________ Bye,
Emanuele |
|
| Back to top |
|
 |
mhier Site Admin
Joined: 07 Jan 2007 Posts: 106 Location: Germany
|
Posted: 16.04.2007, 08:19 Post subject: |
|
|
Is this the first version of pilib you try? It looks like you have somewhere in MSYS a working version of pilib and using outside MSYS a not-working version. Windows uses the PATH environment variable to locate DLLs, and MSYS changes the PATH.
Probably the working version is an older one (because the error message is new since pilib 0.4, which is equal to the current CVS), and probably I did not test it enough on Windows before release
I will have a look on that error message this evening.
Cheers
Martin _________________ pilib mostly on gentoo linux (32 and 64 bits) |
|
| Back to top |
|
 |
epag00 beginner
Joined: 15 Apr 2007 Posts: 6 Location: Italy
|
Posted: 16.04.2007, 15:01 Post subject: |
|
|
| mhier wrote: | | Is this the first version of pilib you try? It looks like you have somewhere in MSYS a working version of pilib and using outside MSYS a not-working version. Windows uses the PATH environment variable to locate DLLs, and MSYS changes the PATH. | Yes! Before yesterday I didn't know about the existence of pilib: so I think your guess is wrong.
However, is there a way to view and to compare the PATH in Windows and in MSYS? For Windows PATH I know that I have to type "path" at command prompt, but in MSYS I don't know...
Thanks for the time and interest in my problem, Martin. I hope you'll find the answer this evening. _________________ Bye,
Emanuele |
|
| Back to top |
|
 |
epag00 beginner
Joined: 15 Apr 2007 Posts: 6 Location: Italy
|
Posted: 17.04.2007, 15:12 Post subject: |
|
|
Hello all,
I have another hint for you (I hope can be useful). I compiled "example.f95" at Windows command prompt, calling g95 as done in this post, precisely | Quote: | | Code: | | g95 pilib_hello.f95 -IC:\MinGW\msys\1.0\include -LC:\MinGW\msys\1.0\lib -lpilibf -lpilib |
| changing the syntax to match my computer tree and to name the output file "exwin.exe" (so that I still have the two "versions" of the executables).
Unfortunately, things haven't changed. The behaviour is exactly equal to the fist attempt: under Windows/command prompt it doesn't run but with MSYS all goes well. _________________ Bye,
Emanuele |
|
| Back to top |
|
 |
ziggy76 pilib user
Joined: 11 Jan 2007 Posts: 13 Location: Rouen (FRANCE)
|
Posted: 18.04.2007, 12:56 Post subject: |
|
|
If you want to know the value of PATH variable with msys ( or linux ), just type :
echo $PATH
To change this variable on a Windows XP system, you must use the configuration panel then go to system and advanced and environment variables and modify.
For my system, to be able to execute the program with a double click on the icon, I added :
c:\MinGW\msys\1.0\bin
Be careful under msys not to use path like c:\MinGW ... msys doesn't like backslash ...
Ziggy _________________ Pilib 0.3 (CVS) - PC with Windows XP Pro
MinGW + MSYS - Fortran compiler g95 |
|
| Back to top |
|
 |
epag00 beginner
Joined: 15 Apr 2007 Posts: 6 Location: Italy
|
Posted: 18.04.2007, 18:52 Post subject: |
|
|
| ziggy76 wrote: | If you want to know the value of PATH variable with msys ( or linux ), just type :
echo $PATH
To change this variable on a Windows XP system, you must use the configuration panel then go to system and advanced and environment variables and modify.
For my system, to be able to execute the program with a double click on the icon, I added :
c:\MinGW\msys\1.0\bin
Be careful under msys not to use path like c:\MinGW ... msys doesn't like backslash ...
Ziggy |
Thanks for the hint, Ziggy. Following your first suggestion I compared the system path under Windows and under MSYS. I added "c:\msys\1.0\bin" in my Windows path (I installed MSYS not in MinGW tree), as you suggested then, and now I don't have to copy "libpilib-0.dll" in the same directory of the executable.
Unfortunately the second, most important problem still remains: when I double-click on the executable icon or type its name in command prompt I still have this message: | Quote: | | *** no graphical output available |
Any further help will be very appreciated. _________________ Bye,
Emanuele |
|
| Back to top |
|
 |
ziggy76 pilib user
Joined: 11 Jan 2007 Posts: 13 Location: Rouen (FRANCE)
|
Posted: 19.04.2007, 09:31 Post subject: |
|
|
Just in case ... look in your PATH to see if you have something like
/C/GTK/bin
The problem can be the GTK library.
When I was trying to make my first pilib program to work, I tried a little GTK program in C, just to see if GTK was OK... here it is :
| Code: | #include <gtk/gtk.h>
/* compilation :
gcc prog0.c `pkg-config --cflags --libs gtk+-2.0`
*/
int main( int argc,
char *argv[] )
{
GtkWidget *window;
gtk_init (&argc, &argv);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_widget_show (window);
gtk_main ();
return 0;
}
|
The compilation command is in the first comment.
[/code] _________________ Pilib 0.3 (CVS) - PC with Windows XP Pro
MinGW + MSYS - Fortran compiler g95 |
|
| Back to top |
|
 |
epag00 beginner
Joined: 15 Apr 2007 Posts: 6 Location: Italy
|
Posted: 19.04.2007, 11:49 Post subject: |
|
|
Hello Ziggy,
thank you for the answer: I compiled, under MSYS, your C program and its executable works fine both under MSYS and Windows. Then I think that GTK is ok. I have these PATH for GTK: under MSYS | Code: | | /C/PROGRA~1/GTK/bin | under Windows | Code: | | C:\PROGRA~1\GTK\bin |
I'm out of ideas... _________________ Bye,
Emanuele |
|
| Back to top |
|
 |
mhier Site Admin
Joined: 07 Jan 2007 Posts: 106 Location: Germany
|
Posted: 22.04.2007, 13:53 Post subject: |
|
|
First, sorry for my late reply. I did not find the time to dig into this earlier.
The problem is indeed a bug in the current version of pilib. It requires an enviroment variable DISPLAY to be set, or it will prevent the graphical part to be initialized. MSYS sets that variable for compatibility reasons, but of cource windows not.
Unfortunately, sourceforge is currently down, so I cannot upload a fixed version. I will provide a fixed version as soon as sourceforge is back online. For the time being you can download an updated version of piinit from here. Just replace i, rebuild pilib and it should work.
Let me know, if you still have any trouble. _________________ pilib mostly on gentoo linux (32 and 64 bits) |
|
| Back to top |
|
 |
epag00 beginner
Joined: 15 Apr 2007 Posts: 6 Location: Italy
|
Posted: 22.04.2007, 17:47 Post subject: |
|
|
| mhier wrote: | First, sorry for my late reply. I did not find the time to dig into this earlier.
The problem is indeed a bug in the current version of pilib. It requires an enviroment variable DISPLAY to be set, or it will prevent the graphical part to be initialized. MSYS sets that variable for compatibility reasons, but of cource windows not.
Unfortunately, sourceforge is currently down, so I cannot upload a fixed version. I will provide a fixed version as soon as sourceforge is back online. For the time being you can download an updated version of piinit from here. Just replace i, rebuild pilib and it should work.
Let me know, if you still have any trouble. |
It works!
Thanks a lot, Martin. Now I can try to use PILIB with something more complicated. _________________ Bye,
Emanuele |
|
| Back to top |
|
 |
mhier Site Admin
Joined: 07 Jan 2007 Posts: 106 Location: Germany
|
Posted: 22.04.2007, 19:49 Post subject: |
|
|
The changes are now commited to CVS and released as version 0.4a on SF. _________________ pilib mostly on gentoo linux (32 and 64 bits) |
|
| Back to top |
|
 |
|