Recent

Author Topic: [SOLVED] {$IFDEF Qt} and {$IFDEF GTK} ?  (Read 10472 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 1675
    • miXimum is the DJ's best friend
[SOLVED] {$IFDEF Qt} and {$IFDEF GTK} ?
« on: July 28, 2011, 11:11:50 pm »
Hello everybody.  ;)
Does it exists something like :

Code: [Select]
{$IFDEF Qt}
  procedureQt();
           {$ENDIF} 
{$IFDEF GTK}
  procedureGTK();
           {$ENDIF} 

So the compiler do different things for each Qt or GTK compil ?

Thanks
« Last Edit: August 01, 2011, 11:50:30 am by Fred vS »
I use Lazarus 1.8.0 32/64 and FPC 3.0.3 32/64 on Linux Mint Mate 17 32/64, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs

Blaazen

  • Hero Member
  • *****
  • Posts: 2782
  • POKE 54296,15
    • Eye-Candy Controls
Re: {$IFDEF Qt} and {$IFDEF GTK} ?
« Reply #1 on: July 28, 2011, 11:49:05 pm »
Yes, correct is:

Code: [Select]
{$IFDEF LCLQt}
  procedureQt();
{$ENDIF} 
{$IFDEF LCLGTK}
  procedureGTK();
{$ENDIF} 

http://wiki.lazarus.freepascal.org/Code_Conversion_Guide#Useful_compiler_variables_.2F_defines_.2F_macros
Lazarus 2.1.0 r61214:62238 FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Fred vS

  • Hero Member
  • *****
  • Posts: 1675
    • miXimum is the DJ's best friend
Re: {$IFDEF Qt} and {$IFDEF GTK} ?
« Reply #2 on: July 29, 2011, 12:34:17 am »
Mr Blaazen, you are really the best.  :-[

Many thanks

I use Lazarus 1.8.0 32/64 and FPC 3.0.3 32/64 on Linux Mint Mate 17 32/64, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 1675
    • miXimum is the DJ's best friend
Re: [SOLVED] {$IFDEF Qt} and {$IFDEF GTK} ?
« Reply #3 on: July 29, 2011, 12:40:42 am »
Hum and if i want :

{$IFDEF LCLQt} or {$IFDEF Darwin} ?
(what is the compiler-syntax for 'or' and 'and'  :-[)
I use Lazarus 1.8.0 32/64 and FPC 3.0.3 32/64 on Linux Mint Mate 17 32/64, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 1675
    • miXimum is the DJ's best friend
Re: [SOLVED] {$IFDEF Qt} and {$IFDEF GTK} ?
« Reply #4 on: July 29, 2011, 01:14:47 am »
I try that and it seems that the compiler like it ...

Quote
{$ifdef Darwin or ifdev LCLQt}

 ::)
I use Lazarus 1.8.0 32/64 and FPC 3.0.3 32/64 on Linux Mint Mate 17 32/64, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 1675
    • miXimum is the DJ's best friend
Re: [SOLVED] {$IFDEF Qt} and {$IFDEF GTK} ?
« Reply #5 on: July 29, 2011, 01:27:39 am »
Quote
{$ifdef Darwin or ifdev LCLQt}

Do not what i want  :'(
I use Lazarus 1.8.0 32/64 and FPC 3.0.3 32/64 on Linux Mint Mate 17 32/64, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs

Blaazen

  • Hero Member
  • *****
  • Posts: 2782
  • POKE 54296,15
    • Eye-Candy Controls
Re: [SOLVED] {$IFDEF Qt} and {$IFDEF GTK} ?
« Reply #6 on: July 29, 2011, 01:31:22 am »
Correct is:
Code: [Select]
{$IF DEFINED(DARWIN) or DEFINED(LCLQt)}
Lazarus 2.1.0 r61214:62238 FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Fred vS

  • Hero Member
  • *****
  • Posts: 1675
    • miXimum is the DJ's best friend
Re: [SOLVED] {$IFDEF Qt} and {$IFDEF GTK} ?
« Reply #7 on: July 29, 2011, 01:40:24 am »
Well done Mr Blaazen  :P
I use Lazarus 1.8.0 32/64 and FPC 3.0.3 32/64 on Linux Mint Mate 17 32/64, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs

clauslack

  • Sr. Member
  • ****
  • Posts: 275
Re: [SOLVED] {$IFDEF Qt} and {$IFDEF GTK} ?
« Reply #8 on: January 27, 2012, 11:00:56 pm »
Hello, with this code
Code: [Select]
{$IFDEF LCLQt}
  ShowMessage('qt');
{$ENDIF} 
{$IFDEF LCLGTK2}
  ShowMessage('gtk2');
{$ENDIF} 
Work fine with IDE,

but when compile the project with lazbuild
Ej: lazbuild --ws=qt project.lpi
 show gtk2

if compile with IDE on QT, then
lazbuild --ws=qt project.lpi
show qt

if delete tmp subdir lib and compile
lazbuild --ws=qt project.lpi
show gtk2

I'm going crazy

Somebody can test with lazbuild?

Tested with Lazarus 0.9.30.1 fpc 2.4.2/2.4.4 Linux 32 and 64 bits.

Thanks


clauslack

  • Sr. Member
  • ****
  • Posts: 275
Re: [SOLVED] {$IFDEF Qt} and {$IFDEF GTK} ?
« Reply #9 on: January 29, 2012, 01:08:04 am »
I found the problem
if I compile with IDE project1.lpi with GTK2
then
lazbuild --ws=qt project1.lpi
this always show GTK2, because lazbuild reuse *.o  files.

I must use
lazbuild --build-all --ws=qt project1.lpi
this erase *.o files and recompile the units.
For me, is an lazbuild error.

Regards