Author Topic: Running executable from C::B behaves differently from console (windows)  (Read 224 times)

Offline BDick

  • Single posting newcomer
  • *
  • Posts: 5
I use the Portland Group Fortran compiler in C::B on Win10. I build a DLL with a subroutine and a main program that calls this subroutine. When I run this from C::B (the green arrow button next to build), I get the error message that the program can not find a particular entry point ("pgf90io_src_info03a") in the DLL.

When I run the same exe-file from the command line in a new cmd-Window, it works fine. When a program that uses a DLL is made with the PGI compiler and linker, it expects that several run-time DLLs of PGI are also in the path (i.e., not only the own DLL but everything is dynamically linked). Hence the directory with these run-time DLLs must be in the path. I think I did this correctly, in the "settings -> environment" menu, by adding:

c:\PROGRA~1\PGI\win64\18.10\bin;%PATH%

But I dont know whether this environment is also used for running, or only for compiling and linking.
The strange thing is that C::B behaves the same way, if I add this to the path or not. And if the path is missing in a "normal" console window, the error message is different. I.e., the program complains about the missing run-time DLLs, not a missing "entry point".

So the green "run"-button does something different from opening a console and running the program, but what is missing?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2281
Re: Running executable from C::B behaves differently from console (windows)
« Reply #1 on: January 15, 2019, 07:08:34 pm »
Quote
So the green "run"-button does something different from opening a console and running the program, but what is missing?
As far as i can tell it adds the pathto the libraries from the linker settings to the PATH environment variable, so the libraries can be found.

You can modify the PATH variable from within codeblocks before the execution if this is what you need.