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

Author Topic: Font Tutorial Problems  (Read 6547 times)

0 Members and 1 Guest are viewing this topic.

acrin1

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://www.crpgdev.com
Font Tutorial Problems
« on: August 28, 2007, 03:12:17 pm »
Hi,

I'm really interested in SFML but I've been having some problems getting some of the tutorials to work. I'm using Visual Studio 2005 Professional. For example with the font tutorial I've a few questions.

What libraries should I be specifying in the Linker/Input settings and in what order?
Does the arial.ttf file need to be in the same folder as the .exe?

I can get the program to compile ok but it won't run - see below.

--

1>------ Rebuild All started: Project: sftest2, Configuration: Debug Win32 ------
1>Deleting intermediate and output files for project 'sftest2', configuration 'Debug|Win32'
1>Compiling...
1>main.cpp
1>Compiling manifest to resources...
1>Linking...
1>sfml-graphics.lib(RenderWindow.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Generating code
1>Finished generating code
1>Embedding manifest...
1>sfml-graphics.lib(RenderWindow.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Generating code
1>Finished generating code
1>Build log was saved at "file://c:\Files\sftest2\sftest2\sftest2\Debug\BuildLog.htm"
1>sftest2 - 0 error(s), 4 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========


Are these warnings anything to worry about?

If I try to run the compiled program without debugging I get a sftest.exe failed to run / encountered an error style Windows message.

If I run it in debug mode I get an unhandled exception and memcpy.asm appears along with call stack information.

Unhandled exception at 0x10232014 (msvcr80d.dll) in sftest2.exe: 0xC0000005: Access violation writing location 0xcccccc00.

Sorry for all the questions but I'm not that familiar with VS2005 either but I seem to be able to use it with SDL/OpenGL without any major problems and I'm keen to try SFML properly.

Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Font Tutorial Problems
« Reply #1 on: August 28, 2007, 03:20:03 pm »
Quote
What libraries should I be specifying in the Linker/Input settings and in what order?

sfml-graphics.lib, sfml-window.lib and sfml-system.lib
Don't worry about the order, only gcc cares about it.

Quote
Does the arial.ttf file need to be in the same folder as the .exe?

It has to be in the current working directory when your app tries to load it. This is can be a different folder than the .exe one, if you run from Visual Studio.

Quote
Are these warnings anything to worry about?

No ;)

Quote
If I try to run the compiled program without debugging I get a sftest.exe failed to run / encountered an error style Windows message.

If I run it in debug mode I get an unhandled exception and memcpy.asm appears along with call stack information

Make sure you link with the debug libraries in debug mode (sfml-graphics-d.lib, and so on).
Laurent Gomila - SFML developer

acrin1

  • Newbie
  • *
  • Posts: 45
    • View Profile
    • http://www.crpgdev.com
Font Tutorial Problems
« Reply #2 on: August 29, 2007, 03:13:44 pm »
Quote

Make sure you link with the debug libraries in debug mode (sfml-graphics-d.lib, and so on).


Thanks for the quick response. Linking with the debug libraries seems to have resolved the problems I was having.

I'm not really sure I appreciate the differences between the static/dynamic and release/debug libraries. It might be useful to some people if you could expand some of the documentation for these at some time in the future.

Thanks

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Font Tutorial Problems
« Reply #3 on: August 29, 2007, 03:19:05 pm »
Quote
I'm not really sure I appreciate the differences between the static/dynamic and release/debug libraries. It might be useful to some people if you could expand some of the documentation for these at some time in the future.

You're right, this will be included in the FAQ I'm writing.
Laurent Gomila - SFML developer

 

anything