Author Topic: Using pkg-config in the Build Options with mingw32 on windows  (Read 7526 times)

Offline ozbarry

  • Single posting newcomer
  • *
  • Posts: 3
Hello,

I've used code::blocks for a long time, but this is the first time I've had to use it for a "real" project that's being developed on Windows, Mac and Linux.
Using Linux and OSX, we can use `pkg-config <lib> --cflags`, the the --libs equivalent under Build Options > Compiler Settings > Other Options and Build Options > Linker Settings > Other Linker Options, but in windows, I can't seem to get that working.

I've tried using code::blocks variables, too, but that doesn't seem to work.

Any suggestions?

Thanks,
-oz

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Using pkg-config in the Build Options with mingw32 on windows
« Reply #1 on: May 12, 2011, 07:32:21 pm »
Test from the cmd.exe prompt that "pkg-config <lib> --cflags" works.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ozbarry

  • Single posting newcomer
  • *
  • Posts: 3
Re: Using pkg-config in the Build Options with mingw32 on windows
« Reply #2 on: May 12, 2011, 08:03:44 pm »
Quote from: cmd.exe
C:\Users\Alexander>pkg-config
Must specify package names on the command line

C:\Users\Alexander>pkg-config --list-all
opencv OpenCV - Open Source Computer Vision Library

C:\Users\Alexander>pkg-config opencv --cflags
-IC:/MinGW/msys/1.0/etc/local/include/opencv -IC:/MinGW/msys/1.0/etc/local/include

Still no dice with code::blocks

-oz

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Using pkg-config in the Build Options with mingw32 on windows
« Reply #3 on: May 12, 2011, 08:08:06 pm »
Did you turn on Full Compiler Logging and see what CB sends to the Compiler?
What version of Code::Blocks?
Make sure you are using the right tick marks.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ozbarry

  • Single posting newcomer
  • *
  • Posts: 3
Re: Using pkg-config in the Build Options with mingw32 on windows
« Reply #4 on: May 12, 2011, 08:15:30 pm »
Ah, thanks for the help - turns out when I did mingw32-make install to opencv, it didn't copy the include files over to where the package config file said they were.

Thanks for the help (even though it wasn't code::blocks fault)
-Oz