Issue installing SFML in Xcode - no suitable image found - c++

I'm trying to use SFML 2.5.1 in a C++ Xcode project. I followed this tutorial on Youtube. After completing, when trying to build my project, I get the following error code:
dyld: Library not loaded: #rpath/sfml-system.framework/Versions/2.5.1/sfml-system
Referenced from: /Users/will/Library/Developer/Xcode/DerivedData/FirstSFMLApp-bzfbmdnymuynqtatiocyskrsacno/Build/Products/Debug/FirstSFMLApp.app/Contents/MacOS/FirstSFMLApp
Reason: no suitable image found. Did find:
/Library/Frameworks/sfml-system.framework/Versions/2.5.1/sfml-system: code signature in (/Library/Frameworks/sfml-system.framework/Versions/2.5.1/sfml-system) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
I've ticked "Run script only when installing" under build phases as required.
Does anyone know how to resolve this issue? I'm new to both C++ and Xcode so I'm ready to believe that I've done something dumb.
Thanks in advance.

Late, but posting to help others as I came across this question first when I was looking for an answer myself.
Go to the app view, and instead of going to the "Build phases menu", now go to "Signing and Capabilities". Go to the "Hardened Runtime" subsection.
Select "Disable Library Validation".
Run main.cpp again and it should be good to go!
I believe this is related to the privacy settings for the updated OS. NB: I have previously run the 'sudo spctl --master-disable' command in Terminal to disable gatekeeper; I've heard that without doing so you may have to accept the libraries one by one, but for some disabling gatekeeper is not an option. Running this command in terminal may have been a prerequisite for the above solution working, but I can't confirm that. Good luck!

Related

Solving DL4J compilation error

I am trying to download DL4J source without error.
https://github.com/deeplearning4j/deeplearning4j
I cloned https://github.com/deeplearning4j/deeplearning4j.git
and imported using existing Maven project in Eclipse.
Tons of dependencies are downloaded but it's bombarded with errors.
Anyone who knows which branch version is free of compile error?
The site says 0.9.1 is most stable version, but it still generates errors.
So there's a few things here:
No major open source project in today's day and age operates without a build system. This can be maven,gradle,sbt,..
You ignored all of our docs about building from source and the like. You don't need to do that. Use the build system like it's intended.
My suggestion here:
Learn what the rest of the java world did and use maven:
Our quick start is here: http://deeplearning4j.org/quickstart
Follow our examples for the latest versions:
https://github.com/deeplearning4j/dl4j-examples
Chances are you do not need to build from source (this involves 5 other projects you probably do not want to do that) - but if you absolutely must be prepared to use c++ among other things.
The guide for that can be found here:
https://deeplearning4j.org/devguide

WSL: make fails when using -j

I'm working on a project for my cryptography course, and I've been using the Windows Subsystem for Linux. Up until recently I was able to use make -j to build my entire project quickly.
Recently, I started getting compilation errors like the one below. Strangely enough, I have no issues compiling with just make (no -j)
Because this used to work fine, I do not believe the issue has anything to do with dependencies specified in my makefiles. (Most of my code is in header files anyway because templates)
In file included from /usr/include/stdlib.h:314:0,
from /usr/include/c++/5/cstdlib:72,
from /usr/include/c++/5/ext/string_conversions.h:41,
from /usr/include/c++/5/bits/basic_string.h:5249,
from /usr/include/c++/5/string:52,
from tests/cryptomath/../../catch.hpp:207,
from tests/cryptomath/test_extgcd.cpp:2:
/usr/include/x86_64-linux-gnu/sys/types.h:219:25: fatal error: /home/ipiano/[student id]/Documents/Code/Homework/512/project/modules/module_crypto/unittests/../libclassiccrypto/affine/headers/sys/select.h: Invalid argument
It looks to me like the compiler is trying to find c++ source files (sys/select.h in this specific error) in my project directory, which implies maybe a path issue?
The only thing that I can think of that changed recently is that IT approved the Creator's Update and I installed that, but I don't know if it's relevant or not.
If anyone has seen this behavior or errors like this and knows how to resolve it, help would be appreciated.
---------EDIT---------
Was able to narrow down to a specific makefile that my main makefile was including. It was defining part of it's targets, but not all of them. Still not sure why the -j flag brought this to light, but at least it's working now
I had the same problem: my compilation failed when using "make -jN", for N>1. After some research I found the same issue described here.
The problem is likely caused by a bug introduced in DrvFs, the Windows filesystem plugin for WSL, and it happens at least in Windows builds 16273.1000, 16299.19 and 16299.64 (mine). It doesn't happen in build 16251.
According to this, the bug was fixed on Windows Build 16299.98.
Since I cannot update my Windows due the company policies and I couldn't execute this workaround, I moved my files from /mnt/c to /home/<username> and they compiled without further problems.

How to set up wxWidgets 3.1.0 with Visual Studio 2015

I am somewhat of a beginner when it comes to open source libraries. I have tried to compile from source and use the pre-built binaries, but in both cases I get a ton of errors when I try to run the simple 'Hello World' program on the tutorial section of the wxWidgets website. After playing around for quite some time, the closest I have got to compiling is by building the libraries from source, but I still have 2 errors remaining:
"_w64 can only be specified on int, long, and pointer types" file: defs.h
"cannot open file 'wxbase31ud.lib" - LINK
It seems strange to me that the header file provided by wx would have an error such as that one, so I imagine both errors are because of something I am doing. I am hoping that someone here can do one of the following for me:
Help me solve these errors
Provide instructions for building libraries from source and subsequently linking my program to the correct directories
Some additional info: I am working on x64 Windows 7, my target will also be x64 exclusively. I do not have admin privileges, so no editing the system PATH for me.
Thanks for your help!
The simplest way to start working with the library is this:
Grab the sources.
Unpack the sources.
Open VS IDE.
Open \build\msw\wx-vc14.sln (adjust as necessary.)
Go to "Build->Batch Build...", click "Select All", "Build".
Go drink some coffee or watch TV.
After the build finishes, open wxWidgets/samples/minimal/minimal_vc9.sln.
Let MSVC convert the solution to become an appropriate format.
Build and run the sample.
If you will acquire any issue during those steps, let us know.
The library build in step 5 should build without any issues and then all you will need is to build the minimal sample.
The next step is to copy the samples\minimal folder somewhere and start writing the code. All you will need to do is to change the Include and Lib search path.
[EDIT]
If you can build the 32-bit libraries (which are default in the provided solutions) all you will need is to convert them to be 64-bit and rebuild.
There is no changes to the $PATH or any environmental variable involved. Moreover you shouldn't build anything with the admin priviledges.
Also as Thomas pointed out you library build has to match whatever sample you are trying to build.
[/EDIT]

Where can I get FlexUnit

Simple question, where do I actually download the FlexUnit binary? I've found:
https://cwiki.apache.org/confluence/display/FLEX/FlexUnit+Getting+Started
and
https://github.com/flexunit/flexunit
The links on the first go to www.flexunit.com which doesn't appear to exist.
The second has all the source code, but no build instructions.
FlexUnit donation to Apache Flex is currently in progress and has yet to be formulated into a release. Meanwhile you can find a nightly build at https://builds.apache.org/job/flex-flexunit/ws/ (flexunit-*.zip).
Update
An official release can now be downloaded at:
http://flex.apache.org/download-flexunit.html
You can either use Maven to get access to Flexunit like in this question here:
How do I get Flexunit, FlexMojos and Mockolate to work together?
Or you can download flexunit from various open source projects like here:
https://github.com/mikechambers/as3corelib/tree/master/build/libs

C++ Logging Library Setup

I've been trying for about 2 weeks now to get a logging library to work with. I've tried Log4cxx, Log4cpp, log4cplus and boost.log. The problem isn't that none of these work for me, it's that I can't figure out how to get them to work at all. I would really like to use log4cxx since I'm working with log4j/logback at work, but I haven't been able to get any of the libraries based on log4j to build. I've been able to build and use the boost library, but boost.log gives me all kinds of linker errors no matter what I try. If anyone could direct me to a step-by-step guide to get one of these libraries working I would greatly appreciate it. Also, I'm using eclipse as my IDE if that matters.
Did you ever get this working? Log4cxx definitely works on Win7. Maybe you could post some of your build errors. Just guessing, perhaps you didn't configure your eclipse project to link with a log4cxx static lib.
Boost.Log works for me quite well (Linux and Windows). It is not a header only library, there is a compiled part that you need to link against. See instructions here.
It also depends on other, non-header, Boost libraries:
The logging library uses several other Boost libraries that need
building too. These are Boost.Filesystem, Boost.System,
Boost.DateTime, Boost.Thread and Boost.Regex. Refer to their
documentation for detailed instructions on the building procedure.
Depending on your platform there may be pre-built versions of the Boost libraries. Otherwise building it yourself is straightforward if you follow the instructions. If you get stuck update your question with where exactly you got stuck and what you're seeing.
I'd recommend Pantheios. It takes some time to build everything when you first download - type make build test and go have lunch - and you have to select the output streams (Pantheios calls them "back ends") at link time, but for coding, it is really simple, e.g.
std::string name;
int age;
pantheios::log_DEBUG("name=", name, " age=", pantheios::integer(age));
It's designed from the ground up for speed - the age won't be converted into a string unless the "DEBUG" level is switched on - and robustness - which is why you can't pass fundamental types directly, and use "inserters" (e.g. pantheios::integer). See this recent blog post by Pantheios' author for more information.
I managed to get log4cxx to work, this was done in Visual Studios 2013 running on Windows 7 OS.
This following is what I did, step by step:
Download the log4cxx ZIP package extract its contents, http://logging.apache.org/log4cxx/download.html
Download apr and apr-util ZIP packages, http://apr.apache.org/download.cgi
Then
manually extract this zip apr-1.2.11-win32-src.zip (the
extracted folder should be named 'apr', if it is not manually rename
it)
manually extract this zip apr-util-1.2.10-win32-src.zip (the
extracted folder should be named 'apr-util', if it is not manually
rename it)
open a command prompt and run the following: cd
apache-log4cxx-0.10.0 configure (this
will execute configure.bat)
We will need to disable to use of the APR ICONV and LDAP support.
In order to do so, we will append the following files manually:
Open apr-util\include\apu.hw. Find the line starting with “#define
APU_HAVE_APR_ICONV”. Change the value to 0 and save.
Open apr-util\include\apr_ldap.hw. Find the line starting with
“#define APR_HAS_LDAP” Change the value to 0 and save.
We need to build the log4cxx.dll, to do so convert *.dsw
to *.cxproj.
Launch Visual Studio 2013 and open log4cxx.dsw.
VS will ask if you like to convert everything. Simply click Yes.
There may be some warnings in the migration report, but nothing that
should prevent the solution from opening.
> The projects xml, apr, and apr-util should build successfully.
If you try compiling the log4cxx project it will most
likely fail with hundreds of errors. This is due to a bug in VC++
which can be worked around.
Move all macros outside (above) the class they are in.
LOG4CXX_LIST_DEF macro is used to define classes. All macros reported in error C2252 will need to move out of any classes. This
may also include moving definitions which are used in the macro.
Next, change all LoggingEvent::KeySet to KeySet (this is no longer nested in a parent class)
> Following this, the log4cxx project should now compile
successfully on your machine.