Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. using pre processor defines in .pro
Qt 6.12 LTS is out! See what's new in the release blog

using pre processor defines in .pro

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 1 Posters 1.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tony67
    wrote on last edited by
    #1

    Hi All,
    in my standard makefile project I use some defines to stop some sections of code being built. However I need to translate over to qt and add to my .pro. In my makefile I used

    DDEFS =-DWITH_NONAMESPACES -DWITH_OPENSSL
    
    .....
    
    then 
    all:
    	$(CC) $(CPFLAGS) $(CPPFLAGS) $(DDEFS) $(DINCDIR) $(SOURCE) $(DLIBDIR) -o $(PROGRAM)  $(DLIBDIR) $(LIBS)
    

    How can I do this in qt with .pro? Thanks

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tony67
      wrote on last edited by
      #2

      Should add I've tries

      DEFINES += -DWITH_NONAMESPACES -DWITH_OPENSSL
      

      but get the following errors

      <command-line>:0: error: macro names must be identifiers
      <command-line>:0: error: macro names must be identifiers
      
      1 Reply Last reply
      0
      • T Offline
        T Offline
        tony67
        wrote on last edited by
        #3

        Got it through trial and error, you don''t use -D in qt

        DEFINES += WITH_NONAMESPACES WITH_OPENSSL
        
        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt
        • Unsolved