SFML Font: failed to load font - visual-c++

I'm using VS 2015 with the latest sfml. All the configuration works. I'm using debug libs (...-d.lib), etc.
I'm calling font.loadfromfile() in my main function. I placed the font file into my project folder. I checked over and over again that the default directory for VS is my project folder. I even manually changed it to "C:\sfmlprojects\sfmlpong\sfmlpong\" just to be sure. Although the font file is in that folder, I'm still getting the error "failed to load font ... ".
I've looked at dozens of posts and every single one of them either says to double check font file is in the right location, or a mixing debug/release lib issue, either of which seems to be my problem.
I am using VS 2015 on a virtual machine on my Mac. Could this be messing up the program directory? This is the only reason I can think of that would make me place the font file in the wrong directory.
Any insight as to why font is failing to load even though its in the right directory/with the right libs would be immensely helpful.

Related

Only partial syntax highlighting in Kotlin script file

I opened a folder in Android Studio which contains a Kotlin script file (.kts). I configured a JDK as SDK in Project Structure (but I added no gradle files), and running the file as Kotlin script works fine. However the syntax highlighting is only PARTIALLY working, see below example (Linux Mint 19.3 and AS 4.1.3):
Some of the stuff missing:
unused variable should be gray (val unused)
to/forEach keyword should be yellow and italic
misspelled variable names should be red
bad style such as extra spaces should be underlined
etc.
What's even going on here? Is this some sort of "fallback" mode?
Any way to use the "full" syntax highlighting from normal Android projects, so I can spot mistakes earlier?
For reference, this is what it "should" look like (pasted into a random Android project):
Renaming the file to end in *.main.kts (scriptname.main.kts) enabled full highlighting for me!
I get this type of issues from time to time with IntelliJ IDEA. I haven't found the reason why it happens, neither do I know the 100% working solution. But here are the options that usually help me solve it:
Restart IDE
Invalidating caches: File > Invalidate Caches...
Re-import the project. Remove the .idea folder and the project.iml file and try to import the project again.
Update the IDE. Last time I had this issue, nothing helped but updating IDEA to 2021.1.
I hope some of these options will help.

how can I change Android Studio system files folder path on Windows?

I install my development tools from zipped distributions and by setting paths by self so I can easily continue using after system fails/reinstallations as well as copying into other PCs I have.
I am trying to use Android Studio on a path portable as possible, and it is mostly going well. I extracted android studio under t:\Tools\Android\android-studio\ and use following command in CMD console to start it.
set ANDROID_SDK_ROOT=t:\Tools\Android\sdk\
set ANDROID_HOME=t:\Tools\Android\sdk\
set ANDROID_SDK_HOME=t:\Tools\Android\.android
set ANDROID_PREFS_ROOT=t:\Tools\Android\.android
t:\Tools\Android\android-studio\bin\studio64.exe
Today I found out this is not enough for my purposes after a plugin fails to load because of incompatibility, that the path to "Android Studio system files" is still set to
%USER%\AppData\Local\Google\AndroidStudio4.1
I couldn't find a proper answer on how to set this path under t:\Tools\Android\ through an environment variable. answers I could find are just mentioning this path but does not tell about changing it. (or just missed in like millions of topics containing same search terms)
Can you please show a way, if there is any, to change this folder path?
This does not seems to be done by simple environment variables.
However, it seems a bit of manual work makes it possible.
editing editing these lines in t:\Tools\Android\android-studio\bin\idea.properties file
idea.config.path=${idea.home.path}/.AndroidStudio/config
idea.system.path=${idea.home.path}/.AndroidStudio/system
idea.plugins.path=${idea.config.path}/plugins
idea.log.path=${idea.system.path}/log
and then using this environment variable
set STUDIO_PROPERTIES=t:\Tools\Android\android-studio\bin\idea.properties
Visit Making Android Studio Portable (2017+ versions) for more info for portability

javax.microedition.io.file does not exist in BlueJ

Trying j2me app development. I got a simple Hello to work, and a simple TextBox user as well. But when I tried to compile code for a file browser I got "javax.microedition.io.file does not exist".
The WTK according to the Sun website is supposed to include JSR75. And there's a camera demo .java file that uses it.
I've looked in various places (the WTK, BlueJ, even Netbeans) for menu options to turn it on. Nothing. And a search of this forum turned up exactly ONE message and it pertains to another IDE, and it seemed to work for him in BlueJ.
So what am I missing and how do I get it?
In NetBeans, you go to Project Properties (right-click the project, and select Properties). Then click "Platform" and mark "File Connection and PIM Optional Packages 1.0".
On a whim I did a search for JSR75 jar download and found a few zipped jar files that seemed to contain the file classes. I unzipped one of them and put it in the Libraries/Userlib directory of BlueJ; and now I seem to have the File... Classes. Reading and writing seem to work in the emulator.
I'll take another look at Netbeans when I get a chance.

SDL in Visual C++ - where to properly put images used in the program?

I'm just learning SDL and I would like to know where is the correct place to put images and other file stuff in?
I use Visual C++ 2010 Express and the problem is that when I compile a program and start it straightly from IDE, it instantly stops because it can't load images. But when I start it by clicking on it in Release/Debug folder, where these images are placed, it is, of course, OK.
It seems that the IDE starts the program from another path than Release/Debug folder.
My question is - how shall I deal with it? Is there a way of setting the location of images directly in Visual C++? I'm asking this question because when I'm unable to start the program from IDE -> I can't use that IDE's debugger.
I hope I explained my situation well enough and thanks for the answers.
If you click on your project with the right mouse button, select properties, on the window that opens, click on "Debugging", notice the entry "Working directory", put there the directory where you want your program to run.
I am used to create a folder called work and put images, sounds, etc, there and configure the working directory to use this folder.
Also, any dlls not in system path must go there for your program to find it or in the same folder where visual is creating your exe.
Also on the same window, you will see the "Environment" entry, you can use it to configure path to dlls if neeeded setting the PATH environment variable, like for example:
PATH=c:\mylibs\dlls\

error RC2176 : old DIB in res\icon3.ico; pass it through SDKPAINT?

what is this Error, and how to resolve it?
I am using Visual studio 2005 for Smart device MFC developement,
Is upgrading to 2008 can solve my problem.
Error 85 error RC2176 : old DIB in res\icon3.ico; pass it through SDKPAINT
Thanks
this might help you:
http://www.axialis.com/tutorials/vistaicons.html
It looks like vista icons now use PNG headers. The error is slightly false though as its not an old DIB its just a header it doesn't recognize, PNG.
How was that icon created? Long ago Visual C++ 6.0 had its own little way of creating icon .ico files. Probably not using PNG so this might be the way to go is to find some program to emulate that and create an icon using the old DIB way. Or upgrading to 2008 :)
Actually there is another way not mentioned here in the other answers.
If you would install and integrate a more recent (same or later release date than VS 2008) SDK with VS 2005, that also resolves it. You can also go to C:\Program Files\Microsoft Visual Studio 8\VC\bin (or your equivalent of the path) and replace the files rcdll.dll and rc.exe with the ones from a more recent VS, WDK or SDK.
Side-note: the version of rcdll.dll and rc.exe must match, that is you need to copy both at once from your source (be it VS, WDK or SDK). For me any version starting with 6.0 or 6.1 worked. That's any version starting from the compilers that accompanied the Vista SDKs and VS versions or later.
There are actually 2 situations I've encountered that lead to this error RC2176.
As you probably know, a Windows .ICO file can contain multiple images for different sizes and color depth. VS2005 throws this error in at least two situations (unrelated to DIB)
.PNG images in the icon (as described in Codejoy's answer)
256x256 or larger images in the icon
By using GIMP to shrink the largest image size to 128x128, and avoiding .PNG, the problem is resolved with VS2005. Or, upgrade to a newer VS ;)
I had this problem in VS2012 for which I googled but didn't find anything else but this link to a MSDN site which talked about opening it up with sdk-paint , so in my project I doubleclicked the icon that was responsible for the error and deleted the PNG format and voila program started.
Greetz
Richard
The compressed/packed 256x256 was the problem for me. Once I unchecked the option to save as compressed (for Vista) in my icon editor app, the problem went away.
There is another situation I encountered which triggered the error, that is a corrupted PNG file. I've used the sed command to globally replace some strings in the project folder, and it just replaced the (looks liked) windows line ending to UNIX one, which caused my image files corrupted.
So, maybe there are some bugs in the PNG parser of MFC library, which cannot handle malformed input files.
Best resolution I have come across is from Axialis where they offer guidance of saving the ICO file in uncompressed PNG format.
https://www.axialis.com/docs/iw/How_to_use_a_Windows_Vista_Compressed_Icon_in_a_Software_Project.htm

Resources