Jump to content
Geochemist's Workbench Support Forum

Creating Dynamic Link Libraries

Recommended Posts


Dear Jia or Brian,

I created several dll's that my previous version of GWB (version 14) could read without any issues. However, now when I am trying to run a X1t script using GWB v. 17, it can't read the previous dll. So I tried to recompile the C++ code and save as a dll for the current version. I am attaching the C++ code, which is based on something that Craig published. 

The "activity" files shows a screen shot of the error message I get, which seems to be saying that it doesn't recognize the use of "activity" in the C++ code. I assume this definition of the activity of a species hasn't changed, but maybe it is different, which could explain the error. Is it possible that one of the #include files, e.g., "gwb_context.h" that came with the new version of GWB has changed the way activity is defined. I am also attaching the script I was running with the previous version 14 with the previously compiled dll.



ionx.cpp %22activity%22.pdf Carrizo_Weathering_5o.x1t ionx2.dll thermo_ionx.tdat

Link to comment
Share on other sites

Hello Karen,

Thanks for attaching all your files. With every version of the software, you will need to recompile the function.

In general, we recommend working in your own file space and not within Program Files, which has been known to cause issues.

I noticed that in your screenshot of the command prompt, there was not a command executed for compiling the function. I think it would be best for you to try again, working in a local directory, and follow the most up-to-date steps for Compiled Rate laws in Chapter 5.3 of the GWB Reaction Modeling User Guide. Examples are provided for compiling and linking a function for a React run but you can make simple modifications for a corresponding X1t file.

I would also recommend checking that you are working with the correct version of the compiler for your GWB installation. For example, if you have a 64-bit version of the software installed, you should use a 64-bit compiler.

If this doesn't help to resolve the issue, please let us know what you have tried and which step had gone awry.

Best regards,
Jia Wang
Aqueous Solutions LLC


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...