Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


#Actualdeathreaper945

Posted 22 October 2013 - 12:10 PM

Hello everyone,

 

I have been struggling with an issue the past few days (since Saturday really) with CMake and MinGW/SDL2. First of all, I'm already experienced with MinGW and making Makfiles for it. However, I am not experienced with CMake thus why I wanted to learn to use it. I've made a quick test project using SDL2 to experiment with CMake. CMake seems to build just perfectly but I will run into issue of linking SDL.

 

The errors is undefined references to SDL_Init and SDL_Quit (which obviously means it's not being link). The strange thing, -lSDL2main and -lSDL2 is being used. I have three pictures for you to refer: http://imgur.com/a/j2qbH. Additionally, I was using this quick 'tutorial' - http://duganchen.ca/building-sdl2-programs-with-cmake-and-pkgconfig/ although I had to adjust some things to make it work.

 

Useful information:

  • Windows 8
  • MinGW
  • Using PkgConfig to find SDL2 (I have not had much success with FindSDL2.cmake for some reason)
  • Placed SDL2 in their respective folders of MinGW (bin, include, lib)

Thank you for your time.

 

P.S. I apologize if this wasn't the right subforum to ask this kind of question.


#1deathreaper945

Posted 22 October 2013 - 12:07 PM

Hello everyone,

 

I have been struggling with an issue the past few days (since Saturday really) with CMake and MinGW/SDL2. First of all, I'm already experienced with MinGW and making Makfiles for it. However, I am not experienced with CMake thus why I wanted to learn to use it. I've made a quick test project using SDL2 to experiment with CMake. CMake seems to build just perfectly but I will run into issue of linking SDL.

 

The errors is undefined references to SDL_Init and SDL_Quit (which obviously means it's not being link). The strange thing, -lSDL2main and -lSDL2 is being used. I have three pictures for you to refer: http://imgur.com/a/j2qbH

 

Useful information:

  • Windows 8
  • MinGW
  • Using PkgConfig to find SDL2 (I have not had much success with FindSDL2.cmake for some reason)
  • Placed SDL2 in their respective folders of MinGW (bin, include, lib)

Thank you for your time.

 

P.S. I apologize if this wasn't the right subforum to ask this kind of question.


PARTNERS