Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
FLARE [ARCHIVED]

Help with Compilation [SOLVED]

Diablo IV
Tuesday, October 2, 2012 - 16:29

Hi, i,m new in Flare Forums, yesterday i find this engine (something I've been looking for a while) and the true, this engine have more future.

I want make my own ARPG based in Medieval, and want edit or add any things in the source.

I have Dev C++ 4.9.9.2, and i create new project (API?). Add all source files and in Project Options, i linked all SDL objects.

The program said me:

 

[Linker error] undefined reference to `SDL_Quit' 

[Linker error] undefined reference to `SDL_RWFromFile' 

 [Linker error] undefined reference to `TTF_WasInit' 

(More errors)

 

How i can fix this problem?

 

Thanks in advance, sorry for my english i,m spanish xD.

  • Log in or register to post comments
Clint Bellanger
joined 15 years 9 months ago
Tuesday, October 2, 2012 - 16:32
Clint Bellanger's picture

Sounds like SDL isn't linked properly.

Solving this is usually very specific to the IDE or compiler you're using. I suggesting looking up how to set up an SDL project in Dev C++. Maybe this one is up to date?

http://lazyfoo.net/SDL_tutorials/lesson01/windows/devcpp/index.php

  • Log in or register to post comments
Diablo IV
joined 12 years 8 months ago
Tuesday, October 2, 2012 - 16:57

Thanks for info :D. Now i reduced more errors, but I still have some error.

Follow this guide step by step and the number of errors has been reduced a lot but there is some.

 

Undefined reference to TTF_XXX (sdl_ttf suposse) 

[Linker error] undefined reference to `SDL_gfxBlitRGBA' 

more undefined references to `SDL_gfxBlitRGBA' follow 

[Linker error] undefined reference to `WinMain@16' 

 

I have Windows 7 64 bits, 

 

In project linked i put:

-lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_mixer -lSDL_ttf

 

Thanks for reply!

  • Log in or register to post comments
Clint Bellanger
joined 15 years 9 months ago
Tuesday, October 2, 2012 - 17:02
Clint Bellanger's picture

The same way you added SDL, you'll have to do that for SDL_image, SDL_mixer, SDL_ttf.

The SDL_gfxBlitRGBA issues is because one of the files in the project is a .c file instead of .cpp. Either set up your project to also compile .c files (not sure how to do that in your IDE) or just rename that file to .cpp

  • Log in or register to post comments
Diablo IV
joined 12 years 8 months ago
Tuesday, October 2, 2012 - 17:26

Yep! Now only have errors with SDL_ttf, is more strange, i add linked object into project 

  • Log in or register to post comments
Clint Bellanger
joined 15 years 9 months ago
Tuesday, October 2, 2012 - 17:35
Clint Bellanger's picture

The only thing that comes to mind about SDL_ttf is that it's on version 2.0 and the other libraries are version 1.2. So if you had to type out the version number anywhere in the settings, you may want to check for that.

  • Log in or register to post comments
Diablo IV
joined 12 years 8 months ago
Wednesday, October 3, 2012 - 11:49

I did this:

 

New Empty Project -> Win32 Gui.

Add all c++ and header Flare files into project.

In Compiler Options i add in directories include folder with SDL files and in Libraries i add lib folder with SDL, sdlmain, SDL_mixer, SDL_ttf and SDL_image.

In linker i put this:

-lmingw32 

-lSDLmain 

-lSDL 

-lSDL_image 

-lSDL_mixer 

-lSDL_ttf

 

 

And Dev C++ say me: Undefined reference to TTF_xxx.

 

It's as if he did not recognize the library or as if it were not linked to the project. Is more strange.

 

  • Log in or register to post comments
Diablo IV
joined 12 years 8 months ago
Thursday, October 4, 2012 - 07:14

Is solved, it seems that the library SDL_ttf not coded for  call by -l, put on linker options, add lib and put the exact address and I already compiled without errors.

 

Will do a video guide for those who are compiling with Dev C + + to see xD.

 

Greetings!

  • Log in or register to post comments