Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qmake and prl files

Qmake and prl files

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 812 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.
  • G Offline
    G Offline
    gserm
    wrote on last edited by gserm
    #1

    I am trying to get my head around how prl files work. Working on a Windows machine, I have created two static libraries, lib1.lib (exporting void my_lib1_func()) and lib2.lib (exporting void my_lib2_func() which uses my_lib1_func). I then create a console app which I link statistically against lib2.lib. Unfortunately, when trying to compile it the compiler complains that it can't find my_lib1_func.

    I was under the impression that qmake's prl files would tackle this issue as explained here, but unfortunately I haven't been successful using it. Below is the source code, there are a few files but they are trivial. The directory structure structure is as follows:

        root
    	|---my_lib1
    		|---my_lib1.pro
    		|---my_lib1.cpp
    		|---my_lib1_header.h
    	|---my_lib2
    		|---my_lib2.pro
    		|---my_lib2.cpp
    		|---my_lib2_header.h
    	|---main
    		|---main.pro
    		|---main.cpp
    
    
    //my_lib1_header.h
    #pragma once
    void my_lib1_func();
    
    
    
    // my_lib1.cpp
    #include <iostream>
    #include "my_lib1_header.h"
    
    void my_lib1_func() {
    	std::cout << "Hello" << std::endl;
    }
    
    
    
    #my_lib1.pro
    
    TEMPLATE = lib
    
    HEADERS += my_lib1_header.h
    SOURCES += my_lib1.cpp
    
    TARGET = my_lib1
    CONFIG += static create_prl
    CONFIG -= qt
    
    
    
    //my_lib2_header.h
    #pragma once
    
    void my_lib2_func();
    
    
    
    
    //my_lib2.cpp
    #include "../my_lib1/my_lib1_header.h"
    #include "my_lib2_header.h"
    #include <iostream>
    
    void my_lib2_func() {
    	my_lib1_func();
    	std::cout << "World" << std::endl;
    }
    
    
    
    
    #my_lib2.pro
    
    TEMPLATE = lib
    
    SOURCES += my_lib2.cpp
    
    CONFIG += static link_prl create_prl
    CONFIG -= qt
    
    CONFIG(debug, debug|release) {
    	LIBS += ../my_lib1/debug/my_lib1.lib
    }
    
    CONFIG(release, debug|release) {
    	LIBS += ../my_lib1/release/my_lib1.lib
    }
    
    
    
    // main.cpp
    #include "../my_lib2/my_lib2_header.h"
    
    int main() {
    	my_lib2_func();
    }
    
    
    
    
    #main.pro
    TEMPLATE = app
    CONFIG -= qt
    CONFIG += console link_prl
    
    CONFIG(debug, debug|release) {
    	LIBS += ../my_lib2/debug/my_lib2.lib
    }
    
    CONFIG(release, debug|release) {
    	LIBS += ../my_lib2/release/my_lib2.lib
    }
    
    SOURCES += main.cpp
    

    The resulting Makefile for main.cpp links against the my_lib2.lib but not against my_lib1.lib, despite the prl file being generated. Any help would be appreciated!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      deleted287
      wrote on last edited by
      #2

      I'd be interested to know if you came up with a solution for this, as I've also run up against the same problem. In our project, we've ended up having every of the dependent libs specified in the pro files which is not ideal.

      1 Reply Last reply
      0

      • Login

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