David Schwartz 426 Posted September 16, 2021 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
Martin Sedgewick 30 Posted September 16, 2021 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
David Schwartz 426 Posted December 12, 2021 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. Share this post Link to post
Fr0sT.Brutal 900 Posted December 13, 2021 What happens if you add this define to Fastmm.inc? Share this post Link to post
mikak 2 Posted October 18, 2023 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