June 18, 2011

Peppy Peppy
Hobby Entomologist
389 posts

[solved] QMAKE: unknown replace function…

 

Hi guys, I am here again, now I am learning QMAKE from QtCreator Git Clone and I am trying to use that directory structure, everything works fine but:
I have got Project.pri file where is defined function:

  1. defineReplace(getLibraryTarget) { return($${PROJECT_NAME}.$$1) }

And it should replace library target in library subproject (Project.pri is included there) to: Project.LibraryName
But: If I run that project, QMAKE writes:
  1. "Unknown replace function: getLibraryTarget"

In library project is:

  1. include(../../../Project.pri)
  2. QT       += xml xmlpatterns gui
  3.  
  4. TARGET = $$getLibraryTarget(ServicesManager)
  5. TEMPLATE = lib
  6.  
  7. DEFINES += SERVICESMANAGER_LIBRARY
  8.  
  9. SOURCES += ServicesManager.cpp
  10.  
  11. HEADERS += ServicesManager.h\
  12.         ServicesManager_global.h

I really don’t know where is the problem.

EDIT: I tried to define another function in Project.pri, but the same problem result: unknown function… I don’t know where is the problem…But when I wrote message($${PROJECT_NAME}), that variable was found and wrote the “Project” .. I really don’t understand it…

2 replies

June 18, 2011

Franzk Franzk
Lab Rat
830 posts

I think qmake is pretty strict in the function formatting. See if it helps if you no longer make it a one-liner:

  1. defineReplace(getLibraryTarget) {
  2.     return($${PROJECT_NAME}.$$1)
  3. }

 Signature 

“Horse sense is the thing a horse has which keeps it from betting on people.”—W.C. Fields

http://www.catb.org/~esr/faqs/smart-questions.html

June 19, 2011

Peppy Peppy
Hobby Entomologist
389 posts

Well, I rewrote it…Probably .pri file was missing (but it was there!)… And then it worked fine… thanks for help and time :)

 
  ‹‹ qmake, slashes, and custom build steps      symbol(s) not found for architecture x86_64 ››

You must log in to post a reply. Not a member yet? Register here!