DSFML building error (VisualD) - visual-studio

And at first, sorry for my bad English. It is my first project in D. And my first project with SFML (DSFML of course).
I use dub for making Visual Studio project (I use VS2010). Then
open it and set up project settings:
general
compiler
linker
Autocomplete works correctly:
When I try build project, here is error:
Error 42: Symbol Undefined _D5dsfml8graphics12__ModuleInfoZ
How I can resolve it?

This particular error is saying that it can't find the actual D code for the library. It could mean that dub isn't grabbing/linking the source somewhere, but I've never used dub with an IDE so I can't be sure.
My suggestion to help you figure out what is going wrong and to fix this issue is to bug the maintainer (who is me, actually) on github by opening an issue about a lack of tutorials for the IDE's that are available to D right now.
If you want to get started with DSFML right now, however, you can sort of follow along with the command line tutorial and use that as a basis of figuring out what libraries need to be linked in, set up import search paths, etc.

Create project by dub init dsfml_test (where dsfml_test is our project name)
Add libs dependencies to dub.json
Generate Visual Studio project
Open project in Visual Studio
Open project properties
Enter path to directory where is placed dsfml lib files
Thats all. Now can add import dsfml.graphics, dsfml.window, dsfml.system; ...etc and build project.

Related

Linker error building Adobe DNG SDK on MacOS 11

I am working on a project that uses Adobe's DNG SDK 1.6 library, and it is supposed to work on Windows and MacOS.
The library has instructions on how to build it for both platforms, but I had to figure out an error that came up on Windows with Visual Studio. I am not very experienced with big C++ projects so it was not trivial but I got it working. Most of my own code will be done in C# .Net Core, calling the native libraries using a wrapper class with P/Invoke.
Now for Mac that's a different story, I have a MacOS 11 VM, installed Xcode 12.5.1 and followed the steps provided, as expected, it does not work. Bare in mind this is my first time touching Xcode and MacOS.
The project I am trying to build is dng_validate, and it depends on two libraries built by these projects: XMPFiles64 and XMPCore64.
The library projects build without any hiccups, each one of them creating a ".a" file in the folder: dng_sdk_1_6/xmp/toolkit/public/libraries/macintosh/intel_64_libcpp/Debug, they are named libXMPFilesStaticDebug.a and libXMPCoreStaticDebug.a respectively.
When I try to build the dng_validate project, I get the following error:
Library not found for -lXMPFilesStaticDebug
Because of the the error starting with an "l" instead of "lib", under both libraries project settings, I changed the "Executable Prefix" setting to "l" instead of "lib". Rebuilt both of them and made sure the file names changed as expected. But the error persists when trying to build the main project.
Under dng_validate's project settings, there is a setting called "Library Search Paths" and it does point to the proper aforementioned folder using a relative path. I even changed it to an absolute path to see if that would make it work.
I am really lost here, does anyone have an idea of what might be causing it?
Well... After asking on other forums and almost hiring a freelancer to fix this for me, I tried another shot in the dark of renaming the library files and it worked.
I changed the extensions of libXMPFilesStaticDebug.a and libXMPCoreStaticDebug.a from ".a" to ".dylib" and it just compiled and blew my mind with it.

Mono.Android reference in PCL project in VS 2017 Mac

I have created a project in Visual Studio 2017 Windows. Now I am trying to work on it from Mac. While tried to build the project I can see reference to Mono.Android is not available. Also System.ComponentModel is unavailable. How I can add the reference for both of it?
I also facing the same issue mono.android is missing, finally it work by adding mono.android.dll. I did something like this in my project, in Deploy.cs file add this line
class Deploy
{
[Android.Runtime.Register("getExternalStoragePublicDirectory", "(Ljava/lang/String;)Ljava/io/File;", "")]
it show missing mono.android.dll library is missing need to add into the project. Problem solved later I comment this line.
From the picture above you can see that the reference is made to a particular file on your Windows computer which on the Mac is obviously not on that path. If you want to make the project work you should find those files on the Mac and reference them. Copying them from Windows somewhere and referencing them should work too.
But as people noted, the point of PCL project is not to contain references like this so whole the architecture of your app is wrong and that's why you see the problems. So you may want to resolve the root of the problem as this probably won't be the last thing that you encounter by doing the things in the wrong way.

Build problems with SQLite3 on VS2010

I try to build SQLite v3 from source using VS2010 and run into problems which I do not know how to tackle.
This is what I have:
VS2010 pro.
using sqlite-amalgamation-3160100.zip
Microsoft article: SQLite databases
This is what I did:
Created a C++ 'Win32 Console application'.
Disabled procompiled headers.
Added preprocessor definitions: (dont do this, this is the problem!)
_HAVE_SQLITE_CONFIG_H;SQLITE_OS_WINRT;SQLITE_API=__declspec(dllexport);
(as specified by 'SQLite databases' section 3.)
Created config.h (which is empty for the moment.)
Included the source files from sqlite-amalgamation-3160100.zip in the project.
build.
I get a number of compiler errors
1> sqlite3.c
1>e:\andre\ontwikkeling\sqlite\sqlite-amalgamation-3160100\sqlite3.c(38515): error C2065: 'MapViewOfFileFromApp' : undeclared identifier
1>e:\andre\ontwikkeling\sqlite\sqlite-amalgamation-3160100\sqlite3.c(38515): error C2099: initializer is not a constant
1>e:\andre\ontwikkeling\sqlite\sqlite-amalgamation-3160100\sqlite3.c(38524): error C2065: 'CreateFile2' : undeclared identifier
....
... which I try to solve.
The first one leads me to the following code snipped:
#if SQLITE_OS_WINRT && (!defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0)
{ "MapViewOfFileFromApp", (SYSCALL)MapViewOfFileFromApp, 0 },
#else
{ "MapViewOfFileFromApp", (SYSCALL)0, 0 },
#endif
Now 'MapViewOfFileFromApp' leads to MapViewOfFileFromApp function, 'Maps a view of a file mapping into the address space of a calling Windows Store app.', a valid microsoft call for which my project setup is missing the correct configuration.
I could get a workaround for this one, but other errors are depending only on SQLITE_OS_WINRT and as such not possible to work around it.
It looks like that I'm missing some configuration options but I do not know which ones. I read all of the documented compile time options but can't find out what it is that I do wrong.
I tried to find a working exaple of a VS2010 solution but came up with nothing. And of cause I checked here for similar questions! (If there is one covering this then I missed it, sorry.)
Does anybody have a suggestion on what I'm missing? I'm running out of idea's.
* edit 6 jan 2017 *
On advice of MaxFurry I followed the steps of the blog by David Cravey which does exact the same steps as I did but without declaring SQLITE_OS_WINRT;SQLITE_API=__declspec(dllexport);. Leaving these two defines out solved the problem.
Aparently I misinterpreted the advice in the Microsoft article.
Compile time problems solved.
Kind regards.
Do you have your sqlite3.dll file already built? If so just create a folder in your visual studio folder. When u want to use sqlite3 just copy the dll file to the folder of the project in visual studio u want to use it also copy the following files there sqlit3.c, sqlite3.h. When this is done open the project in your visual studio IDE. Right click on the project name, add, add existing then click on the sqlite3.h and sqlite3.c. Let me know how it goes.

Cannot build EmulationStation (VS2015) from CMake solution file

I'm having difficulties trying to compile an opensource framework (EmulationStation) in VS2015 on Windows. I've never used any of the tools before, apart from Visual Studio - so please forgive me if these are some obvious mistakes.
The guide says i need to do like this:
Boost (you'll need to compile yourself or get the pre-compiled binaries)
Eigen3 (header-only library)
FreeImage
FreeType2 (you'll need to compile)
SDL2
cURL (you'll need to compile or get the pre-compiled DLL version)
(Remember to copy necessary .DLLs into the same folder as the executable: probably FreeImage.dll, freetype6.dll, SDL2.dll, libcurl.dll, and zlib1.dll. Exact list depends on if you built your libraries in "static" mode or not.)
CMake (this is used for generating the Visual Studio project)
(If you don't know how to use CMake, here are some hints: run cmake-gui and point it at your EmulationStation folder. Point the "build" directory somewhere - I use EmulationStation/build. Click configure, choose "Visual Studio [year] Project", fill in red fields as they appear and keep clicking Configure (you may need to check "Advanced"), then click Generate.)
This is how my CMake looks like (it says generating done)
I get alot of compilation errors in visual studio when trying to build though:
1) Cannot open include file: 'curl/curl.h': No such file or directory (compiling source file C:\Users\retropie\Documents\GitHub\EmulationStation\es-app\src\guis\GuiMetaDataEd.cpp) emulationstation C:\Users\retropie\Documents\GitHub\EmulationStation\es-core\src\HttpReq.h
Where do I get this header file from?
2) 'round': redefinition; different exception specifications (compiling source file C:\Users\retropie\Documents\GitHub\EmulationStation\es-app\src\guis\GuiMenu.cpp) emulationstation C:\Users\retropie\Documents\GitHub\EmulationStation\es-core\src\Util.h 18
I have a lot of these errors with round. Am I missing a reference to a library?
Another screendump of some of the errors from VS2015:
Hope someone can point me in the right direction.
I am currently in de same boat as you, trying to get ES building under MSVS2015.
I am also very green, so hopefully others chime in as well.
Regarding the 'round' errors, apparently the MS compiler has no knowledge of these. For this issue, and some others, the newer ES fork by Herdinger has fixed this.
As this is currently the most active ES branch out there, and has the explicit goal of consolidating at least some of the backlog of PRs from the original Aloshi git, I would suggest you use this one.
In issue #4, there is some more information on building in recent VS versions. There is also a link for the precompiled cURL libs, including the header.
Having gone that far, I am sad to say that I still do not have a succesfull build as of yet. Compiling is no problem, however linking gives me a LNK2005 error.
Hope this helps a bit. Let me know how you fare.

Visual Studio cannot link to Allegro?

I'm following the basic Allegro 5 tutorial to try to make my first basic Allegro project, but despite following the instructions to the letter I cannot successfully link to the libraries.
Here were the instructions:
Under Configuration Properties->C/C++->General, enter c:\allegro\include in Additional Include Directories.
Under Configuration Properties->Linker->General, enter c:\allegro\lib in Additional Library Directories.
Under Configuration Properties->Linker->Input, append allegro-5.0.5-monolith-md-debug.lib to Additional Dependencies.
Under Configuration Properties->Debugging, enter PATH=c:\allegro\bin;%PATH% in Environment.
Click Apply.
Visual C++ can now link your project with the Allegro 5 library.
You should now select the "Release" configuration (upper left corner) and repeat the steps with one minor change: use the non-debug library allegro-5.0.5-monolith-md.lib.
But then it gives me the following error nevertheless:
LINK : fatal error LNK1104: cannot open file 'allegro-5.0.5-monolith-md-debug.lib'
Ideas?
I didn't realize this was getting a bunch of views; I would have put up the answer eons ago. Hopefully people have been seeing my comment containing the answer--
Wow, answered my own question. You have to update the Linker Input file path thing. The current version is 5.0.6 -- just change that and it works.
Basically their installation instructions aren't updated to reflect the current version. Make sure you change things accordingly when changing project linker settings to include Allegro.

Resources