Skip to content
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

Compiling error. #54

Closed
Stanlyhalo opened this issue Nov 24, 2022 · 14 comments
Closed

Compiling error. #54

Stanlyhalo opened this issue Nov 24, 2022 · 14 comments

Comments

@Stanlyhalo
Copy link

I'm trying to link this to my project, and I seem to only have one compiling error at the moment, and it's '&' requires I-value at ImmediateAtlasGenerator.hpp at line 39 on the most recent source code download.

Is this simply a linking error? Just as an FYI, I use C++ 20 on the msvc build compiler.

@Chlumsky
Copy link
Owner

There is no '&' on line 39. What did you pass as GEN_FN?

@Stanlyhalo
Copy link
Author

That's what I'm confused about, I didn't change any code. All libs and includes are referenced correctly.

@Chlumsky
Copy link
Owner

I get no such error in MSVC 2022, even with ISO C++20. How are you calling the library?

@Stanlyhalo
Copy link
Author

What do you mean by calling, if by linking, at least for msdf-atlas-gen, I'm including the directory just above the source files so I can than have my include statement work exactly like examples. Do I also need to set the library and linking paths (I'm doing that for the other libraries that are required for this project).

@Chlumsky
Copy link
Owner

This is not a link error. You quoted a compilation error originating in a template header file, but you didn't say which CPP file it was emitted for (or which template instance). I am not getting this error from any CPP file in the project, so you have to provide more information.

@Stanlyhalo
Copy link
Author

That's all the info it tells me, it was that error at line 39 in ImmediateAltasGenerator.hpp, I can continue checking, I'll look into some implementation files. I'll also rewrite some of my linking for includes and lib directories. I'm hoping it was just a weird linking error.

@Stanlyhalo
Copy link
Author

Stanlyhalo commented Nov 24, 2022

Okay, I think I'm getting close, it actually has to do something with the example code I'm using, the only thing I changed in the example code, is I added the include statements for the regular msdf library, and I replace the myProject... bit with attempting to see if I can call the savePng function.

Edit*: It's not the savePng, I'm gonna just do some testing with commenting to see which code statement is causing the compiling error.

@Stanlyhalo
Copy link
Author

Alright, I have narrowed it down to this statement: generator.generate(glyphs.data(), glyphs.size());. I'll see if I can just quickly fix what's going on here.

@Stanlyhalo
Copy link
Author

I removed the & from msdfGenerator when creating the generator, and now it compiles, however I get some unresolved external symbols I need to solve.

@Stanlyhalo
Copy link
Author

I'm still stuck on the compiling errors, in my main project (the engine), it compiles just fine, but in my other project (the editor), which includes the engine and all the exact same include, libraries, and links as the engine, I get 10 unresolved external symbol errors when trying to use the example code.
image

@Stanlyhalo
Copy link
Author

Stanlyhalo commented Nov 26, 2022

I have all the same libraries being included & linked correctly almost 1:1 with the msdf-atlas-gen solution projects. The only difference is that skia didn't compile nor came with a skia.lib so I didn't add that. Could that be it?

Edit*: I'm gonna look around to see how I can compile skia, from the description of skia and these errors, it may be that I don't have a skia.lib.

@Chlumsky
Copy link
Owner

Yes, these are due to Skia not being linked, however, you can use this project without Skia by turning off MSDFGEN_USE_SKIA in CMake configuration or by removing the define in MSVC project configuration if you don't use CMake.

@Stanlyhalo
Copy link
Author

Yes, these are due to Skia not being linked, however, you can use this project without Skia by turning off MSDFGEN_USE_SKIA in CMake configuration or by removing the define in MSVC project configuration if you don't use CMake.

Oh wow, thanks so much, I'll look into that right now.

@Stanlyhalo
Copy link
Author

Oh my gosh, thank you so much, been tackling with these compiling issues with this library for quite some time. So far, it's already much easier to understand than utilizing something like freetype by hand, so I already appreciate you making this library to do these font atlas generation methods for me. And I think I can say the same for everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants