Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Compile Add-on in SFML  (Read 5568 times)

0 Members and 1 Guest are viewing this topic.

caro1302

  • Newbie
  • *
  • Posts: 2
    • View Profile
Compile Add-on in SFML
« on: November 28, 2009, 04:26:30 am »
Hi,

I'm trying to add an add-on project: http://www.sfml-dev.org/wiki/en/projects/cpgui#cpguicontainer with a SFML project I am creating. I do not have any problem with SFML but I think I just dont understand how to add add-ons.


I am a beginner and I'm not pretty sure where and which informations I am supposed to put for links. I tried to put in Linker/Input with SFML libs

in Release mode: cpGUI.lib
in Debug mode: cpGUI-d.lib

I also put in Options/Project and Solutions/VC++ Directories in Include Files the path to the cpGUI\include folder.

And include "#include <cpGUI.h>" in main file.

I'm not sure where I am supposed to put the cpGUI folder. Is it in the same directory as my solution, is it in the folder where I have my .cpp and .h files or is it somewhere in the SFML-1.5 folder?

I got the following errors in Debug mode that looks like this:
Error 61 error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::String & __thiscall sf::String::operator=(class sf::String const &)" (__imp_??4String@sf@@QAEAAV01@ABV01@@Z) referenced in function "public: virtual void __thiscall cp::cpObject::SetFontSize(unsigned int)" (?SetFontSize@cpObject@cp@@UAEXI@Z) cpGUI-d.lib


There is somebody to help me with this basic problems?
Thanks!

I am using Visual Studio 2008.

Sorry for my english! :)

forrestcupp

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Compile Add-on in SFML
« Reply #1 on: December 04, 2009, 12:19:45 am »
You almost got it all.

In Options/Projects and Solutions/VC++ Directories, you need to put ...\cpGUI\lib in the list of Library files.

You can put the cpGUI folder anywhere you want as long as you include the right directories in your Visual Studio options.  I wouldn't put it in your solutions folder because you might want to use it for other projects.  Put it somewhere where it will be safe.

model76

  • Full Member
  • ***
  • Posts: 231
    • View Profile
Compile Add-on in SFML
« Reply #2 on: January 24, 2010, 08:47:13 pm »
Hi,

I am having problems compiling the example code, as well, using VC++ 2008 Express on Windows XP.

These are the 7 linker errors I get:
Code: [Select]

cpGUI-d.lib(cpGUI.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Font::Font(class sf::Font const &)" (__imp_??0Font@sf@@QAE@ABV01@@Z) referenced in function "public: __thiscall cp::cpGuiContainer::cpGuiContainer(void)" (??0cpGuiContainer@cp@@QAE@XZ)

cpGUI-d.lib(cpGUI.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::String & __thiscall sf::String::operator=(class sf::String const &)" (__imp_??4String@sf@@QAEAAV01@ABV01@@Z) referenced in function "public: virtual void __thiscall cp::cpObject::SetFontSize(unsigned int)" (?SetFontSize@cpObject@cp@@UAEXI@Z)

cpGUI-d.lib(cpGUI.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Sprite::SetImage(class sf::Image const &)" (__imp_?SetImage@Sprite@sf@@QAEXABVImage@2@@Z) referenced in function "public: __thiscall cp::cpImageButton::cpImageButton(class sf::RenderWindow *,class cp::cpGuiContainer *,class sf::Image *,float,float)" (??0cpImageButton@cp@@QAE@PAVRenderWindow@sf@@PAVcpGuiContainer@1@PAVImage@3@MM@Z)

cpGUI-d.lib(cpGUI.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Sprite::Sprite(void)" (__imp_??0Sprite@sf@@QAE@XZ) referenced in function "public: __thiscall cp::cpImageButton::cpImageButton(class sf::RenderWindow *,class cp::cpGuiContainer *,class sf::Image *,float,float)" (??0cpImageButton@cp@@QAE@PAVRenderWindow@sf@@PAVcpGuiContainer@1@PAVImage@3@MM@Z)

cpGUI-d.lib(cpGUI.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class sf::Shape & __thiscall sf::Shape::operator=(class sf::Shape const &)" (__imp_??4Shape@sf@@QAEAAV01@ABV01@@Z) referenced in function "private: virtual void __thiscall cp::cpCheckBox::CreateRects(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?CreateRects@cpCheckBox@cp@@EAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

cpGUI-d.lib(cpGUI.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::String::String(class sf::String const &)" (__imp_??0String@sf@@QAE@ABV01@@Z) referenced in function "public: void __thiscall cp::cpSelectionBox::AddChoice(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?AddChoice@cpSelectionBox@cp@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)


I added cpGUI\include and SFML-1.5\include to the include files directories, and cpGUI\lib and SFML-1.5\lib\vc2008 to the library files derectories.

In the project (debug mode), I have added these as additional dependencies:
Code: [Select]
sfml-main-d.lib sfml-system-s-d.lib sfml-window-s-d.lib sfml-graphics-s-d.lib cpGUI-d.lib


What am I missing? It is probably something stupid...


Thank you in advance!

led

  • Newbie
  • *
  • Posts: 28
    • View Profile
Compile Add-on in SFML
« Reply #3 on: April 02, 2010, 12:52:16 am »
Sorry for the bump, but im having the same exact problem. I linked the libs, include in VC directories and added the cpGUI.lib to the linker. :roll:
while (!idle)
{
   DoSomething();
}

forrestcupp

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Compile Add-on in SFML
« Reply #4 on: April 11, 2010, 11:53:33 pm »
I doubt if this is the problem, but in your project settings in Configuration Properties for C/C++ in the Preprocessor Definitions did you add SFML_DYNAMIC ?

Also, unfortunately for some reason cpGUI doesn't work with SFML 1.6, at least for me.  I don't really have time to really work on this project right now to get that worked out.

led

  • Newbie
  • *
  • Posts: 28
    • View Profile
Compile Add-on in SFML
« Reply #5 on: April 12, 2010, 02:43:04 pm »
Yes i added that and had the same problem. I really need a GUI to work with SFML (i dont have time to learn and do 1 by myself), can you sugest me 1?
Thanks
while (!idle)
{
   DoSomething();
}

nulloid

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Compile Add-on in SFML
« Reply #6 on: April 12, 2010, 04:20:11 pm »
Guichan (which I'm using at the moment, but I'm thinking on another solution), FLTK, Cegui, WxWidgets, GTK+, Qt, SFUI (It's on googlecode somewhere, but there is a forum about that on this forum), and if you don't want to use it actually, sfGui :D (It hasn't released yet, AFAIK).

My problem with guichan is that is ported to SFML-1.4. I'm using it with 1.6, but thinking of migrating to 2.0, so if I want to use it, I need to write a backend. But that's probably not a big deal, when the 2.0 API will be stable (if it isn't already).

But to not to be offtopic: I solved this really easy (it's on the wiki): just copied the cpGui.cpp and .h files into my project, and it ran like it should :) (But those little bugs in widget handling were quite annoying for me, so this is why I moved on to guichan.)

led

  • Newbie
  • *
  • Posts: 28
    • View Profile
Compile Add-on in SFML
« Reply #7 on: April 15, 2010, 03:41:05 pm »
Quote from: "nulloid"
I solved this really easy (it's on the wiki): just copied the cpGui.cpp and .h files into my project, and it ran like it should :)


Thank you very much! :D
It's working now! :wink:
while (!idle)
{
   DoSomething();
}

 

anything