PhreeqcUsers Discussion Forum

Please email phreeqcusers at gmail.com with your name and affiliation to request an account.
Welcome Guest
 

  • Forum Home
  • Login
  • Register

  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • Installation questions »
  • IPhreeqc COM error during MATLAB compilation (DLL initialization routine failed)
« previous next »
  • Print
Pages: [1]   Go Down

Author Topic: IPhreeqc COM error during MATLAB compilation (DLL initialization routine failed)  (Read 13737 times)

Jeonghwan Hwang

  • Top Contributor
  • Posts: 81
IPhreeqc COM error during MATLAB compilation (DLL initialization routine failed)
« on: 10/12/25 14:16 »
Hello,

I am using the IPhreeqc COM interface in MATLAB, and it works normally when I run my script inside the MATLAB environment. The COM server is created without any issues during normal MATLAB execution.
However, when I attempt to compile the same MATLAB script using MATLAB Compiler, the compilation process fails and produces the following error:

[ERROR] actxserver failed
identifier: MATLAB:COM:servercreationfailed
message: Failed to create server: Cannot run the DLL initialization routine.
The key point is that the error occurs during compilation, not during execution of a compiled program. MATLAB is unable to generate the standalone executable because the IPhreeqc COM DLL fails to initialize during the build process.
PHREEQC itself runs normally, and the COM interface works as expected when MATLAB is used interactively. The issue appears only at compile time.

I would like to ask:
Are there known limitations or restrictions when using the IPhreeqc COM interface with MATLAB Compiler?
Under what conditions does IPhreeqc return the error ?DLL initialization routine failed??
Could this be caused by permissions, registry settings, or a runtime context that MATLAB Compiler does not inherit?
Is there a recommended approach for using IPhreeqc in compiled MATLAB applications?

Any guidance would be appreciated.
Thank you.
Logged

dlparkhurst

  • Global Moderator
  • *****
  • Posts: 4336
Re: IPhreeqc COM error during MATLAB compilation (DLL initialization routine failed)
« Reply #1 on: 10/12/25 15:54 »
Sorry, I have no experience compiling with Matlab. Perhaps some other Matlab users can provide some help.
Logged

  • Print
Pages: [1]   Go Up
« previous next »
  • PhreeqcUsers Discussion Forum »
  • Beginners »
  • Installation questions »
  • IPhreeqc COM error during MATLAB compilation (DLL initialization routine failed)
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines | Terms and Policies
  • XHTML
  • RSS
  • WAP2