User forums > Using Code::Blocks
Fail to run executable
thaumiel:
This is something simple, I am doing a small aplication for windows, and decided to use gtk. I found about Code::Blocks and decided to use it, its a great IDE, I just have one problem so far.
I downloaded gtk and added its route to the windows path, so now I can execute gtk aplications, I added gtk route to my project in Code::Blocks, so it compiles and link ok.
But when I click the run button, the aplication fails and a message says that it can not find libglib dll, but if I go to the project folder and run directly the executable, the aplication runs without problems.
I know its not big deal, but I would like to be able to build and run.
Any idea what the problem is?
Thanks in advance and I apologize for my english, I almost never write in english.
stahta01:
If on Windows, I suggest one of the following.
1. Copy the needed DLLs to the folder holding the executable
2. Adding the folder holding the needed DLLs to the Compiler's "Additional Path".
I prefer solution 1; no idea if these solutions are correct in a NON-Windows based system.
Tim S
oBFusCATed:
stahta01: 1 and 2 are wrong with gtk, because there is gtk-runtime package, which is global for the system.
thaumiel:
Do you have the runtime package?
I have it (because I use pidgin for windows).
This package places the dlls in my C:\Program Files\Common Files\GTK\2.0\bin\ .
And there is a path entry about that.
So the dlls should be found automatically, if C::B respects the PATH environment variable.
The things I've said above are speculations/assumptions which I have not tested myself, so they might be wrong (you could try to find some official docs about the correct way of using gtk on windows)
thaumiel:
I solved my problem, well, it kind of solved by itself.
I downloaded the gtk boundle, it has the source code, and all the needed executables and dlls, after I added gtk directory to windows PATH, the gtk aplicatios could be executed.
Only Code:Blocks failed to execute when I launched them with the acctions run and, build and run of Code::Blocks.
The solution was, reboot. After this I was able to launch the executables from within Code::Blocks.
Thanks a lot to the people that answer my cuestion, I think I asked for help too soon, but I did not think that I would need to reboot since the builded aplication was able to run from the windows explorer.
Again thanks for the help and I apologize for my english.
oBFusCATed:
This is because C::B sees the old PATH variable, it is not updated until the process is restarted (not sure if the shell (Explorer.exe) rereads it when the value changes)
Navigation
[0] Message Index
[#] Next page
Go to full version