You are not logged in.
Hi,
I posted some comments here with a similar problem with mORMot.
I received the following errors while trying to compile synPDF:
[DCC Warning] synpdf_proj.dpk(41): W1029 Duplicate constructor 'TZipWrite.CreateFrom' with identical parameters will be inacessible from C++
[DCC Warning] synpdf_proj.dpk(41): W1032 Exported package threadvar 'SynCommons.SynLogFileIndex' cannot be used outside of this package
[DCC Error] E2201 Need imported data reference ($G) to access 'VarCopyProc' from unit 'SynCommons'
[DCC Warning] W1029 Duplicate constructor 'TZipWrite.CreateFrom' with identical parameters will be inacessible from C++
I found this note on the embarcadero forum that describes one of the warnings:
An object file is being generated and Two, differently named, constructors or destructors with identical parameter lists have been created; they will be inaccessible if the code is translated to an HPP file because constructor and destructor names are converted to the class name. In C++ these duplicate declarations will appear to be the same function.
I fixed the following warnings by changing the signature of this CreateFrom constructor to include a default integer parameter that does nothing.
[DCC Warning] synpdf_proj.dpk(41): W1029 Duplicate constructor 'TZipWrite.CreateFrom' with identical parameters will be inacessible from C++
[DCC Warning] W1029 Duplicate constructor 'TZipWrite.CreateFrom' with identical parameters will be inacessible from C++
constructor CreateFrom(const aFileName: TFileName; param:integer=0);
Last edited by hugh (2011-12-06 21:26:06)
Offline
There there are warnings and an Error. The error is failing compilation. I was just trying to also clean up the warnings so I posted a hack to fix the problem.
The error is [DCC Error] E2201 Need imported data reference ($G) to access 'VarCopyProc' from unit 'SynCommons',
I tried to include {$IMPORTEDDATA ON} and {$G+}in the .inc file but it didn't make a difference.
Last edited by hugh (2011-12-06 21:32:06)
Offline
I did some more poking around and the problem seems to be that I want to add the synpdf source files to its own package. Here is the package source that I have:
package synpdf_proj;
{$R *.res}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO OFF}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS OFF}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION ON}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO ON}
{$SAFEDIVIDE OFF}
{$STACKFRAMES OFF}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DESCRIPTION 'SynPDF'}
{$RUNONLY}
{$IMPLICITBUILD OFF}
requires
rtl,
vcl;
contains
SynZip in 'SynZip.pas',
SQLite3Pages in 'SQLite3Pages.pas',
SynCommons in 'SynCommons.pas',
SynGdiPlus in 'SynGdiPlus.pas',
SynLZ in 'SynLZ.pas',
SynPdf in 'SynPdf.pas';
end.
Any ideas how I can work around the above error?
I've added the source directly to my application project and it seems to compile without error but I would like to use in a couple of applications so it would make more sense to create a package.
Offline
Do I need to do that explicitly? The Variants is in the uses clause for the SynCommons.pas file.
I'm not sure how I would add the Variants unit to the project file itself.
Offline
I guess this is a known issue in the Delphi linker about packages.
See https://forums.embarcadero.com/message. … ageID=6844
It appears that asm functions (like the standard VarCopyProc).
If you add the PUREPASCAL conditional to your package options, I think you'll get rid of this problem.
I've added a specific conditional define named USEPACKAGES which would do it more efficiently.
See http://synopse.info/fossil/info/7a843d95e8
Offline
That works! I just uncommented the {.$define PUREPASCAL} already defined in synopse.inc.
Thanks
Offline