Jump to content
David Schwartz

FastMM4 with D10.4.2 -- need $G ???

Recommended Posts

I've used FastMM4 plenty of times, but I don't think I've used it with 10.4.2 at all.

 

I keep getting this error message now:

 

[dcc32 Error] E2201 Need imported data reference ($G) to access 'IsMultiThread' from unit 'FastMM4'

 

I read the info on it, and nothing I tried worked. 

 

i didn't see this with 10.3.x or earlier versions.

 

I've tried both FastMM 4992 and 4993, and get the same results when compiling.

 

Is there a flag in the 10.4.2 IDE I need to set?

 

 

Share this post


Link to post

I have had this while using the Mormot library for years. It is FastMM related and I need to go into the mormot library and uncomment the FastMM stuff.

Only happens when compiling custom packages though, never had it outside of that scenario. 

Share this post


Link to post

I'm trying again with this, and am still getting the same errors.

 

There is a flag in compiler settings that is checked globally. (See attached image that shows it's checked.)

 

The FAQ and several other places say this is related to the compiler thinking that I'm using Runtime Packages, which I AM NOT. (See second attached image below.)

 

The HELP info on it just says this:

 

To alleviate the problem, it is generally easiest to turn on the $IMPORTEDDATA switch and recompile the unit that produces the error. 

 

The problem is, I'm not sure what unit is producing the error. I'm doing a BUILD ALL. It's just a compile error:

[dcc32 Error] E2201 Need imported data reference ($G) to access 'IsMultiThread' from unit 'FastMM4'

 

I put this at that at the top of my .dpr file, and the top of the main .pas file, made no difference.

(*$IMPORTEDDATA ON*)  <<----
unit u0;


I set this option in the .inc file, which should declare the needed options in the FastMM4 unit:

{Set this option when you use runtime packages in this application or library.
 This will automatically set the "AssumeMultiThreaded" option. Note that you
 have to ensure that FastMM is finalized after all live pointers have been
 freed - failure to do so will result in a large leak report followed by a lot
 of A/Vs. (See the FAQ for more detail.) You may have to combine this option
 with the NeverUninstall option.}
{$define UseRuntimePackages}

{-----------------------Concurrency Management Options------------------------}

{Enable to always assume that the application is multithreaded. Enabling this
 option will cause a significant performance hit with single threaded
 applications. Enable if you are using multi-threaded third party tools that do
 not properly set the IsMultiThread variable. Also set this option if you are
 going to share this memory manager between a single threaded application and a
 multi-threaded DLL.}
{$define AssumeMultiThreaded}

Again, made no difference.

 

It simply refuses to build. Both 4.992 and 4.993.

 

I've never had a problem before Delphi 10.4.2.

 

 

 

2021-12-11_23-15-35.png

2021-12-11_23-32-22.png

Share this post


Link to post

Don't know if you have solved this, but just ran to same problem.
And found solution {$define UseRuntimePackages} to FastMM4options.inc

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×