unable to start program QuantLib-vc120-mt-gd.lib - quantlib

I have installed Visual Studio Community 2013, QuantLib and Boost and have gone through the steps of building the complete quantlib project as per http://quantlib.org/install/vc10.shtml guidelines.
I created a new project under QuantLib_vc11.
I both built Quantlib and the project in Debug Mode. No errors.
Then when I try to debug, I have the following error:
unable to start program QuantLib-vc120-mt-gd.lib_
Do you know where it comes from?
And another question, can we use QuantLib with CodeBlocks?
Thanks.

You're debugging with the QuantLib project as the startup project. Since
QuantLib-vc120-mt-gd.lib is a library, and not an executable file, the debugger rightly complains that it can't start it.
Before launching the debugger, select your new project as the start-up project instead. (I'm assuming that your new project defines a main function and creates an executable, right?) This will cause the debugger to start your program with QuantLib linked.
As for CodeBlocks: there's no included project for it, but QuantLib works with most (if not all) compilers it supports. Creating a new project in CodeBlocks and adding all the sources in the ql folder should enable you to create QuantLib. Note that you'll have to tell CodeBlocks to create a library; I'm not familiar with the IDE, so I'm not able to advise on how to do that.

Related

I'm trying to use native C++ libraries in a MAUI app and cannot get it working for MacOS/iOS

There's a great article here that describes how to use native C++ libraries in Xamarin/C#, and I would assume that this would extend to MAUI: https://learn.microsoft.com/en-us/xamarin/cross-platform/cpp/
I followed these instructions, and put together an end-to-end demo solution of it here: https://github.com/whodges/bindingsample. This does require that you link Visual Studio to a MacBook to build the full solution.
That example essentially uses the default MAUI template, and modifies it slightly so that the actual 'click counter' value is set and retrieved from a native library on a per-platform basis. For Windows, that's a C++ DLL (works great). For Android, that's a .so library (works great). And for iOS, that's a static .a library, and here's where I'm running into trouble: when I try to launch this app using the iOS Simulator, it fails with a clang++ error, and something along the lines of "Could not extract the native library 'libCounteriOS.a' from .../obj/Debug/net6.0-ios/iossimulator-x64/linker-cache/libCounteriOS.a'. Please ensure the native library was properly embedded in the managed assembly (if the assembly was built using a binding project, the native library must be included in the project, and its Build Action must be 'ObjcBindingNativeLibrary')".
I created a C# .NET iOS Binding Library project (Counter.iOS in my example), and this is supposed to bundle libCounteriOS.a, which is generated when CounteriOS (a C++ project) is compiled. First, when Counter.iOS is built using Visual Studio on Windows, it fails to generate the Counter.resources folder in its 'bin' folder, along with the subsequent 'manifest' file. When I use Visual Studio for Mac, these files do get generated. So, I stuck with Visual Studio for Mac to build the iOS.Counter project (everything else is built with Visual Studio on Windows).
Regardless, I still get the "could not extract the native library" error I described. I've tried setting the library file's Build Action in Counter.iOS to ObjcBindingNativeLibrary, but that just results in an unhelpful "Build failed - see build log for details" error in Visual Studio for Mac, and I cannot find said log file for the life of me. On top of that, it's not an Objective C library anyway - it's a C++ one - so I'm not sure if this step is actually appropriate. Does it have to be Objective C? The Xamarin article suggests otherwise, and the native reference option 'Is C++' is there as well. I've also tried setting libCounteriOS.a's Build Action to 'BundleResource' - no luck with that either. I've tried it with .NET 7.0 as well - also no luck there.
I'm really at a loss. Is this even possible? It doesn't seem to work and I've been poking at it for weeks on it. That Xamarin article seems to suggest it should be possible. Any help would be greatly appreciated.

How to build Unreal C++ project on KDevelop on LInux?

I have been unsuccessfully trying to compile a c++/blueprint project using Plugins like SocketIO-for-UE or VA-REST. And now that i realize any C++ fails. creating C++ in Source folder also leads to the same error.
Cannot even start a new C++ Project. It Fails to compile and ask me to build through an IDE.
Starts with:
"Rebuild Now" gives:
I tried few approaches but nothing seems to work.
GenerateProjectFiles.sh /path/to/.uproject
the above generated a Makefile in the project root, Having that imported to Kdevelop, build seems to work fine but doesn't seem to compile or do any thing with the Plugins folder.
Any help would be much appreciated and will generate lot of good karma for you.
I'm Using:
UE4 4.26.1 (Crashes regularly) & 4.26.2
Ubuntu 20
Kdevelop 5.5

How to build&run Unreal C++ project on Linux?

I'm trying to build my first Unreal C++ project on Linux.
I built the engine from source in accordance with "Linux Quick Start" guide. Then I installed Qt Creator and followed the "How to Set up Qt Creator for UE4" guide.
I successfully set up and ran UE4Editor, and created a new C++ project. Unfortunately when I try running the project it complains:
And when I press "yes" this error message is shown:
Here's the error message from the logs:
ERROR: Building would modify the following engine files:
/media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/Android/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/Linux/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Binaries/Linux/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Plugins/2D/Paper2D/Binaries/Linux/UE4Editor.modules
/media/redacted-disk/UnrealEngine/Engine/Plugins/AI/AISupport/Binaries/Linux/UE4Editor.modules
... many more
I tried rebuilding UE4 from IDE, then building again - but the error still persists. Same thing happens if I try starting UE4Editor from the engine files and opening the project from there.
What could cause this error? Why does it even try to rebuild the engine when I'm tring run a project?
I have the following script to add the paths to the engine scripts and binaries to my PATH:
UNREAL_HOME="/path/to/source/of/UnrealEngine"
UNREAL_SCRIPTS="${UNREAL_HOME}/Engine/Build/BatchFiles"
UNREAL_SCRIPTS_LINUX="${UNREAL_HOME}/Engine/Build/BatchFiles/Linux"
UNREAL_BINS="${UNREAL_HOME}/Engine/Binaries/Linux"
PATH="${PATH}:${UNREAL_BINS}:${UNREAL_SCRIPTS}:${UNREAL_SCRIPTS_LINUX}"
export PATH
Then I run UE4Editor '/absolute/path/to/project.uproject' from within the directory of my project.
I never create a project inside the source tree of the engine. Paths should absolutely be different.
I use VS-Code as the IDE. This is what works best from my experience. QT-Creator will work only if you create an include files with lots of #define that are missing from the .pro files created by unreal.
You can configure VS-Code to have an intelli-sense like completion by installing the C# and C/C++ extensions. I had to install mono in order to get OmniSharp working (this is the server than handles the autocompletion for VS-Code). Here is an extract of my VS-Code settings.json file:
"omnisharp.path": "/home/myuser/.vscode/extensions/ms-dotnettools.csharp-1.23.9/.omnisharp/1.37.6/omnisharp/OmniSharp.exe",
"omnisharp.monoPath": "/usr/bin/mono",
You can also install the C++ Helper extensions which is usefull for creating methods, classes, and so on.
In the directory of your project run 'make YOURPROJECTNAMEEditor', then you can run 'open YOURPROJECTNAME.uproject' and it should open.

Why is my application searching the wrong DLL for a function?

I am writing a Qt Application using Visual Studio 2010. My application 'Review.exe' links against QtAV.dll using QtAV.lib. In turn, QtAV links against ffmpeg, portaudio, gdiplus, etc.
The debug version works correctly.
When I try and run the release version I get:
The procedure entry point GdipAlloc could not be located in the dynamic link library avcodec-54.dll.
GdipAlloc is a part of Gdiplus. Why is the wrong dll being searched for the function? This only happens in the release build.
If I replace the release version of QtAV.dll with the debug version of QtAV.dll, the release version of Review will load the debug version of QtAV.dll.
Setting the linker flag /DEBUG on the release build causes the problem to go away. However I'd like to figure out the cause and a proper solution.
I find that it does happens for vs2010. vs2012 works fine. I compile portaudio by vs2010 again(use cmake is quite easy), and generate FFmpeg .lib files by vs2010 tools, then compile QtAV again, this errors disappears!
I have uploaded new development files to build QtAV. Download FFmpeg-2.0.1_mingw32+msvc.7z and portaudio-v19_msvc2010x86_20130813.7z here: https://sourceforge.net/projects/qtav/files/depends
: )

Can I edit my C++ project in Xcode (with jump to definition/auto completion) without building the project?

I'm working on a C++ project. My company has an internal build system which runs on Linux only. I'm not able to build the project on my mac. I would try to edit my C++ code with Xcode. I'd like to have at least 'jump to definition' and 'auto completion'. I created an empty project in Xcode and imported my files in there. It shows 'Symbol not found' when I tried to jump to definition. Is it possible to let Xcode parse my code without building the project?