New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text example can't run. #62

Closed
Angluca opened this Issue Jul 26, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@Angluca

Angluca commented Jul 26, 2014

Hi:
I try magnum on osx, but more matter.
example: text
/* Load FreeTypeFont plugin */
//if(!(manager.load("FreeTypeFont") & PluginManager::LoadState::Loaded))
//std::exit(1);
//font = manager.instance("FreeTypeFont");

I think It's error, so I change to:
if(!(manager.load("MagnumFont") & PluginManager::LoadState::Loaded))
std::exit(1);
font = manager.instance("MagnumFont");

if I build magnum to share lib, echo:
Using optional features:
GL_APPLE_vertex_array_object
GL_ARB_ES2_compatibility
GL_ARB_separate_shader_objects
GL_ARB_texture_storage
GL_EXT_debug_label
GL_EXT_debug_marker
GL_EXT_texture_filter_anisotropic
PluginManager::Manager::load(): unresolved dependency TgaImporter of plugin MagnumFont

if I build magnum to static lib, failed to build
[ 92%] Building CXX object src/text/CMakeFiles/text.dir/resource_TextExample_RESOURCES.cpp.o
Linking CXX executable text
Undefined symbols for architecture x86_64:
"Magnum::TextureTools::distanceField(Magnum::Texture<2u>&, Magnum::Texture<2u>&, Magnum::Math::Range2D const&, int, Magnum::Math::Vector2 const&)", referenced from:
Magnum::Text::DistanceFieldGlyphCache::setImage(Magnum::Math::Vector2 const&, Magnum::ImageReference<2u> const&) in libMagnumText.a(DistanceFieldGlyphCache.cpp.o)
"Magnum::TextureTools::atlas(Magnum::Math::Vector2 const&, std::__1::vectorMagnum::Math::Vector2<int, std::__1::allocatorMagnum::Math::Vector2 > const&, Magnum::Math::Vector2 const&)", referenced from:
Magnum::Text::GlyphCache::reserve(std::__1::vectorMagnum::Math::Vector2<int, std::__1::allocatorMagnum::Math::Vector2 > const&) in libMagnumText.a(GlyphCache.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/text/text] Error 1
make[1]: *** [src/text/CMakeFiles/text.dir/all] Error 2
make: *** [all] Error 2

@mosra

This comment has been minimized.

Show comment
Hide comment
@mosra

mosra Jul 26, 2014

Owner

Hi, thanks for your interest in this library.

The FreeTypeFont plugin is not an error, it is available in magnum-plugins repository. It requires FreeType library, but I don't know if it is easily available for OSX.

The MagnumFont plugin doesn't have FreeType dependency, but is far more limited, as you need to pregenerate all glyphs to a file which you then load. It requires TgaImporter plugin, which needs its own manager instance to be successfully loaded, as mentioned in the docs. Also it has its own file format which needs to be converted from TTF files (e.g.) using the magnum-fontconverter utility.

Anyway, if you want to try it without too much hassle, check out ports branch where the text example uses MagnumFont and has everything needed in place.

Owner

mosra commented Jul 26, 2014

Hi, thanks for your interest in this library.

The FreeTypeFont plugin is not an error, it is available in magnum-plugins repository. It requires FreeType library, but I don't know if it is easily available for OSX.

The MagnumFont plugin doesn't have FreeType dependency, but is far more limited, as you need to pregenerate all glyphs to a file which you then load. It requires TgaImporter plugin, which needs its own manager instance to be successfully loaded, as mentioned in the docs. Also it has its own file format which needs to be converted from TTF files (e.g.) using the magnum-fontconverter utility.

Anyway, if you want to try it without too much hassle, check out ports branch where the text example uses MagnumFont and has everything needed in place.

@Angluca Angluca closed this Jul 28, 2014

@Angluca Angluca reopened this Jul 28, 2014

@Angluca

This comment has been minimized.

Show comment
Hide comment
@Angluca

Angluca Jul 28, 2014

I install plugins (freetypefont) , But still error when I run text exmaple.
Using optional features:
GL_APPLE_vertex_array_object
GL_ARB_ES2_compatibility
GL_ARB_separate_shader_objects
GL_ARB_texture_storage
GL_EXT_debug_label
GL_EXT_debug_marker
GL_EXT_texture_filter_anisotropic
Shader::compile(): compilation of fragment shader 2 failed with the following message:
ERROR: 2:86: Initializer not allowed
ERROR: 2:96: Use of undeclared identifier 'position'
ERROR: 2💯 Use of undeclared identifier 'isInside'
ERROR: 2:110: Initializer not allowed
ERROR: 2:118: Use of undeclared identifier 'position'
ERROR: 2:118: Use of undeclared identifier 'offset'
ERROR: 2:118: Use of undeclared identifier 'isInside'
ERROR: 2:119: Use of undeclared identifier 'position'
ERROR: 2:119: Use of undeclared identifier 'offset'
ERROR: 2:119: Use of undeclared identifier 'isInside'
ERROR: 2:120: Use of undeclared identifier 'position'
ERROR: 2:120: Use of undeclared identifier 'offset'
ERROR: 2:120: Use of undeclared identifier 'isInside'
ERROR: 2:121: Use of undeclared identifier 'position'
ERROR: 2:121: Use of undeclared identifier 'offset'
ERROR: 2:121: Use of undeclared identifier 'isInside'
ERROR: 2:123: Use of undeclared identifier 'offset'
ERROR: 2:123: Use of undeclared identifier 'offset'
ERROR: 2:130: Use of undeclared identifier 'distanceSquared'
ERROR: 2:131: Use of undeclared identifier 'distanceSquared'
ERROR: 2:137: Use of undeclared identifier 'offset'
ERROR: 2:146: Attempt to use 'sign' as a variable
Assertion Shader::compile({vert, frag}) failed in /Users/xxx/SDK/magnum_sdk/magnum/src/Magnum/TextureTools/DistanceField.cpp on line 96

Angluca commented Jul 28, 2014

I install plugins (freetypefont) , But still error when I run text exmaple.
Using optional features:
GL_APPLE_vertex_array_object
GL_ARB_ES2_compatibility
GL_ARB_separate_shader_objects
GL_ARB_texture_storage
GL_EXT_debug_label
GL_EXT_debug_marker
GL_EXT_texture_filter_anisotropic
Shader::compile(): compilation of fragment shader 2 failed with the following message:
ERROR: 2:86: Initializer not allowed
ERROR: 2:96: Use of undeclared identifier 'position'
ERROR: 2💯 Use of undeclared identifier 'isInside'
ERROR: 2:110: Initializer not allowed
ERROR: 2:118: Use of undeclared identifier 'position'
ERROR: 2:118: Use of undeclared identifier 'offset'
ERROR: 2:118: Use of undeclared identifier 'isInside'
ERROR: 2:119: Use of undeclared identifier 'position'
ERROR: 2:119: Use of undeclared identifier 'offset'
ERROR: 2:119: Use of undeclared identifier 'isInside'
ERROR: 2:120: Use of undeclared identifier 'position'
ERROR: 2:120: Use of undeclared identifier 'offset'
ERROR: 2:120: Use of undeclared identifier 'isInside'
ERROR: 2:121: Use of undeclared identifier 'position'
ERROR: 2:121: Use of undeclared identifier 'offset'
ERROR: 2:121: Use of undeclared identifier 'isInside'
ERROR: 2:123: Use of undeclared identifier 'offset'
ERROR: 2:123: Use of undeclared identifier 'offset'
ERROR: 2:130: Use of undeclared identifier 'distanceSquared'
ERROR: 2:131: Use of undeclared identifier 'distanceSquared'
ERROR: 2:137: Use of undeclared identifier 'offset'
ERROR: 2:146: Attempt to use 'sign' as a variable
Assertion Shader::compile({vert, frag}) failed in /Users/xxx/SDK/magnum_sdk/magnum/src/Magnum/TextureTools/DistanceField.cpp on line 96

@mosra

This comment has been minimized.

Show comment
Hide comment
@mosra

mosra Jul 28, 2014

Owner

It seems that the GL driver on OSX doesn't like GLSL const keyword, I'll try to work around that. In the meantime, if you try the text example from ports branch, it should work without issues.

The cubemap example currently requires OpenGL 4.3, which is a mistake.

Will fix these later today, hopefully :-) Thank you very much for reporting the issues.

Owner

mosra commented Jul 28, 2014

It seems that the GL driver on OSX doesn't like GLSL const keyword, I'll try to work around that. In the meantime, if you try the text example from ports branch, it should work without issues.

The cubemap example currently requires OpenGL 4.3, which is a mistake.

Will fix these later today, hopefully :-) Thank you very much for reporting the issues.

@mosra mosra added the bug label Jul 28, 2014

@mosra

This comment has been minimized.

Show comment
Hide comment
@mosra

mosra Jul 30, 2014

Owner

Should be fixed in 6fa9d36.

Owner

mosra commented Jul 30, 2014

Should be fixed in 6fa9d36.

@mosra mosra closed this Jul 30, 2014

@mosra mosra added this to the 2015.05 milestone Feb 15, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment