relative locations in templates in devpaks

  • tim

    tim - 2013-10-20

    I have created a devpak for SDL2 but the template for it needs to refer to the SDL2 include directory and lib. This works with an absolute "include" and "lib" directory, but that assumes that devcpp is installed in the default place. how do you do a "relative to devcpp app" include etc. inside a template ?

  • Michal Molhanec

    Michal Molhanec - 2013-10-20

    Why don't you put your header files and libraries to the standard directories in the first place?

  • tim

    tim - 2013-10-20

    The old standard place used to be %app%\lib and %app%\include and %app%\bin but post it might also be %app%\mingw32\lib and %app%\mingw32\include or even %app%\mingw32\mingw32\lib and %app%\mingw32\ming32\include
    It used to be recommended to install devcpp to c:\ to avoid spaces in directory paths, and I still follow that recommendation, although the current default is c:\program files\ What I need to know is how to define a template so that the include and lib directories needed are relative to devcpp app directory that devcpp was installed in as the actual directory is unknown.

  • Michal Molhanec

    Michal Molhanec - 2013-10-21

    But you should not need any directories in your template at all. The compiler and linker knows where to look for the files no matter where you've installed them.

  • tim

    tim - 2013-10-22

    That is what used to happen. However it is not quite as simple now. The api has changed somewhat for SDL so 1.2.x is quite a bit different to 2.x It is quite likely that both will be installed at the same time. SDL is installed into SDL and SDL2 into SDL2. however, a number of their include files etc. still have the same name, so I have to specify the include directory specifically. I did try without an extra include directory and SDL2 could not find it's own includes or libs. That is where I get the problems.
    When compiling on linux you can use `sdl2-config --cflags --libs` in your compiling and linking to include the correct extra paths, but that does not work in windows.

    Last edit: tim 2013-10-22
    • Michal Molhanec

      Michal Molhanec - 2013-10-22

      SDL header files should be in e.g.
      and SDL2 header files in
      The template C file should then use

      #include <SDL/whatever.h>


      #include <SDL2/whatever.h>
      Last edit: Michal Molhanec 2013-10-22
  • tim

    tim - 2013-10-22

    thanks. It is not the recommended method for SDL2, but it works, and keeps things simple for now. I've created a package. how can I make it available?


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks