Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. pkg_config ??

pkg_config ??

Scheduled Pinned Locked Moved C / C++ / MFC
linuxtutorialquestion
9 Posts 4 Posters 0 Views 1 Watching
  • 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.
  • V Offline
    V Offline
    Vaclav_
    wrote on last edited by
    #1

    I like to live dangerously so I'll risk forum or administration wrath with this one. Found this Linux application which supposedly helps with file linking. I have created using pkg_config - "opencv.pc" file and added it in -L - add library path. It does contain OpenCV libraries , I verified that, but linker complain of "incorrect extension ". However, I cannot find in any pkg_config related sites HOW to actually tell GCC linker to use this "opencv.pc". Also this pkg_config info is not that new. There is no open access user forum which makes me suspicious if this "packaging libraries " is a good and useful tool. Please, if this post is not in line with CodeProject policies just ignore it or let me know and I'll delete it. Cheers Vaclav

    L M 2 Replies Last reply
    0
    • V Vaclav_

      I like to live dangerously so I'll risk forum or administration wrath with this one. Found this Linux application which supposedly helps with file linking. I have created using pkg_config - "opencv.pc" file and added it in -L - add library path. It does contain OpenCV libraries , I verified that, but linker complain of "incorrect extension ". However, I cannot find in any pkg_config related sites HOW to actually tell GCC linker to use this "opencv.pc". Also this pkg_config info is not that new. There is no open access user forum which makes me suspicious if this "packaging libraries " is a good and useful tool. Please, if this post is not in line with CodeProject policies just ignore it or let me know and I'll delete it. Cheers Vaclav

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I think you are making life more complicated than it needs to be. This is just another utility that you will need to learn ... see pkg-config(1) - Linux man page[^].

      J 1 Reply Last reply
      0
      • L Lost User

        I think you are making life more complicated than it needs to be. This is just another utility that you will need to learn ... see pkg-config(1) - Linux man page[^].

        J Offline
        J Offline
        Jochen Arndt
        wrote on last edited by
        #3

        ... or enter "man pkg-config" at a shell prompt.

        L 1 Reply Last reply
        0
        • J Jochen Arndt

          ... or enter "man pkg-config" at a shell prompt.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          The 'man' command is the first thing one needs to learn when working on Unix/Linux.

          V 1 Reply Last reply
          0
          • L Lost User

            The 'man' command is the first thing one needs to learn when working on Unix/Linux.

            V Offline
            V Offline
            Vaclav_
            wrote on last edited by
            #5

            Thanks for lectures. I 'll let you know HOW to actually tell GCC linker to use this "opencv.pc". when I answer my own question. Cheers Vaclav

            L 1 Reply Last reply
            0
            • V Vaclav_

              Thanks for lectures. I 'll let you know HOW to actually tell GCC linker to use this "opencv.pc". when I answer my own question. Cheers Vaclav

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              No lectures, just advice. Unfortunately your question is not detailed enough for a better answer.

              1 Reply Last reply
              0
              • V Vaclav_

                I like to live dangerously so I'll risk forum or administration wrath with this one. Found this Linux application which supposedly helps with file linking. I have created using pkg_config - "opencv.pc" file and added it in -L - add library path. It does contain OpenCV libraries , I verified that, but linker complain of "incorrect extension ". However, I cannot find in any pkg_config related sites HOW to actually tell GCC linker to use this "opencv.pc". Also this pkg_config info is not that new. There is no open access user forum which makes me suspicious if this "packaging libraries " is a good and useful tool. Please, if this post is not in line with CodeProject policies just ignore it or let me know and I'll delete it. Cheers Vaclav

                M Offline
                M Offline
                markkuk
                wrote on last edited by
                #7

                Vaclav_Sal wrote:

                However, I cannot find in any pkg_config related sites HOW to actually tell GCC linker to use this "opencv.pc".

                The linker doesn't use .pc files. You must use the pkg-config command to generate the options for the compiler or linker. Use command substitution[^] to embed the pkg-config command on the linker command line or to store the output in a variable.

                V 2 Replies Last reply
                0
                • M markkuk

                  Vaclav_Sal wrote:

                  However, I cannot find in any pkg_config related sites HOW to actually tell GCC linker to use this "opencv.pc".

                  The linker doesn't use .pc files. You must use the pkg-config command to generate the options for the compiler or linker. Use command substitution[^] to embed the pkg-config command on the linker command line or to store the output in a variable.

                  V Offline
                  V Offline
                  Vaclav_
                  wrote on last edited by
                  #8

                  Thanks for actually answering my question without an additional commentaries. Appreciate that. I have also found that I could include the pkg_config command(s) in "make" file. Of course I need to figure out how to either modify the "make" automatically build by IDE or learn how to build my own. Cheers Vaclav

                  1 Reply Last reply
                  0
                  • M markkuk

                    Vaclav_Sal wrote:

                    However, I cannot find in any pkg_config related sites HOW to actually tell GCC linker to use this "opencv.pc".

                    The linker doesn't use .pc files. You must use the pkg-config command to generate the options for the compiler or linker. Use command substitution[^] to embed the pkg-config command on the linker command line or to store the output in a variable.

                    V Offline
                    V Offline
                    Vaclav_
                    wrote on last edited by
                    #9

                    Still struggling with the issue Here is exact syntax I have used - it suppose to "print" , I assume substitute, the libraries in package ( opencv ) to the linker as -l options. It does not matter if the options are --libs opencv or opencv --libs - which is expected. "$(pkg-config opencv --libs)" Here is partial liker output make all Building target: TEST_1 Invoking: GCC C++ Linker g++: error: missing argument to ā€˜-l’ g++ -L/usr/local/lib -o "TEST_1" ./src/TEST_1.o -l"" make: *** [TEST_1] Error 1 makefile:45: recipe for target 'TEST_1' failed I have tried different format / syntax and "$(command)" is correct per the link you have provided. From the output it is notable that no -l files were included - -l"". I do not know what else can be wrong. The command does not expands to anything linker can use and it should look as terminal output. jim-desktop:~$ pkg-config opencv --libs -L/usr/local/lib -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_viz -lopencv_core I have asked in several forums and all I am getting is how to add -L/-l options MANUALLY to the linker options. BTW including ":" before the manually inserted file name specifies to the pkg-config to use library file WITHOUT using the file extension. Nice to know but does not solve my issue. Cheers Vaclav

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups