PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: FB FireFly 378 compile error when including AfxStr.inc from CWindow RC26  (Read 547 times)

David Warner

  • FireFly3 Registered User
  • Junior FireFly Member
  • *
  • Posts: 110

Hi Paul,

I just tried including the AfxStr.inc from Josť's CWindow Release Candidate 26 framework and FireFly FB 378 (todays build) generated a compile error because the AfxScaleX and AfxScaleY functions are defined in both AfxWin.inc and in the FireFly generated code CODEGEN_PROJECT1_MAIN.bas

To replicate this behaviour...

1) Create a new FireFly FB 378 Project.

2) Append the following line to the list of include files in FF_Appstart.

   #Include Once "Afx/AfxStr.inc"


3) Compile error generated by FireFly.

    (X) The Compiler returned an error during compiling:

        Error 4: Duplicated definition in 'Function AfxScaleX (BYVAL cx AS SINGLE) AS SINGLE'

        Additional compile information (including compile warnings can be found in the '_compilelog.txt' log file.

        [OK]


4) _project1_compilelog.txt

FreeBASIC Compiler - Version 1.05.0 (01-31-2016), built for win32 (32bit)
Copyright (C) 2004-2016 The FreeBASIC development team.
standalone
target:       win32, 486, 32bit
compiling:    CODEGEN_PROJECT1_MAIN.bas -o CODEGEN_PROJECT1_MAIN.asm (main module)
CODEGEN_PROJECT1_MAIN.bas(146) error 4: Duplicated definition in 'Function AfxScaleX (BYVAL cx AS SINGLE) AS SINGLE'
CODEGEN_PROJECT1_MAIN.bas(162) error 4: Duplicated definition in 'Function AfxScaleY (BYVAL cy AS SINGLE) AS SINGLE'

5) AfxScaleX and AfxScaleY functions are defined in both AfxWin.inc and CODEGEN_PROJECT1_MAIN.bas
Logged

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8104
  • Windows 10
    • PlanetSquires Software
Re: FB FireFly 378 compile error when including AfxStr.inc from CWindow RC26
« Reply #1 on: February 12, 2017, 11:26:54 AM »

Thanks David, yes, a long time ago I stole Jose's afx scale code to implement into FireFly in order correctly handle DPI scaling. I will rename them in the code generation so as not to cause conflict. i rarely use FireFly these days other than to maintain my legacy programs (and to code FireFly itself of course). All my new stuff is using Jose's CWindow code. I hope to have a form designer built on top of WinFBE that will make placing controls, etc a little easier than having to do it all manually via code. I am also working on a very thin wrapper over Jose's classes that will emulate a lot of the dot syntax that we used to have in Visual Basic and that is present in most modern languages these days like .Net

Lots to do... it just requires time and motivation  :)
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

David Warner

  • FireFly3 Registered User
  • Junior FireFly Member
  • *
  • Posts: 110
Re: FB FireFly 378 compile error when including AfxStr.inc from CWindow RC26
« Reply #2 on: February 12, 2017, 01:33:22 PM »

Thanks Paul, I took the opportunity to exercise FB FireFly a little while checking out Josť's includes and as usual I immediately put my finger on something to report to you. I think I told you before that Iím quite good a breaking things. Sorry about that. :) Anyway thanks for the promised fix. I will look forward to testing the other new developments you described as and when you find the time etc.
Logged