Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6681853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:38:14+00:00 2026-05-26T04:38:14+00:00

I have a qmake file generated by Qt creator. I am modifying it but

  • 0

I have a qmake file generated by Qt creator.
I am modifying it but I do not manage to understand how to create a variable.

For example, I want to declare the library MYPATH as I did here:

MYPATH = /lib/aaa/bbb
unix:!macx:!symbian: LIBS += -L$(MYPATH)

When I run qmake I find in the generated makefile

LIBS = ....... -L$(MYPATH) .....

But the MYPATH variable is not declared anywhere.

Does anyone know how to declare such a variable properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:38:14+00:00Added an answer on May 26, 2026 at 4:38 am

    QMake uses its own syntax for variable references.

    • VAR = foobar => Assign value to variable when qmake is run
    • $$VAR => QMake variable’s value at the time qmake is run
    • $${VAR} => QMake variable’s value at the time qmake is run (identical but enclosed to separate from surrounding text)
    • $(VAR) => Contents of an Environment variable at the time Makefile (not qmake) is run
    • $$(VAR) =>Contents of an Environment variable at the time qmake (not Makefile) is run

    Try it like this

    MYPATH = /lib/aaa/bbb
    unix:!macx:!symbian: LIBS += -L$${MYPATH}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a (partial) qmake project file like this: TEMPLATE=lib TARGET=whatever SOURCES=whatever.cpp HEADERS=whatever.h This
I have a class file (header and cpp) that I made, that I want
I have a problem with qmake and the make file that it generates. My
I have multiple qmake .pro files which are called from a root .pro file
I'm using qmake for building a project of mine. I have been trying to
Is it possible to include C/C++ header files in a qmake (.pro) file? I
I already have a project with a .pro file that can be built in
I begin to study qt (I have qt creator, last version), so I read
I am using Qt Creator and have a Qt GUI project that depends on
Have not done this before, so obviously I suck at it. Here 64 pixels

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.