I have problems in using the irrklang library. I downloaded the .zip file from https://www.ambiera.com/irrklang/downloads.html. I have a MacBookPro with Mojave 10.14.6.
I tried to compile the following source code:
#include <stdio.h>
#include <irrKlang.h>
using namespace irrklang;
#pragma comment(lib, "irrKlang.lib") // link with irrKlang.dll
int main(int argc, const char** argv){
printf("\nHello World!\n");
return 0;
}
I have a directory which contains
- main.cpp
- include -> the headers files
- bin -> it includes the subdirectories
dotnet-4-64
,macosx-gcc
,linux-gcc-64
,winx64-visualStudio
- bell.wav, getout.ogg
- Makefile
The Makefile is pretty simple (I adapted the one from the examples
directory of the original .zip file):
CPP = g++
OPTS = -dynamiclib -I"include" -L"bin/macosx-gcc" -lirrklang -pthread
all:
$(CPP) main.cpp -o example $(OPTS)
clean:
rm example
I added the -dynamiclib
option because otherwise the linker search for the library in /usr/lib
.
When I run Make
everything seems to work fine, no errors, but if I try to execute ./example
I get the following error:
-bash: ./example: cannot execute binary file
I searched on the web, the only hint I found was to check with file ./example
the compatibility with my OS: the result is
./example: Mach-O 64-bit dynamically linked shared library x86_64
and as expected the binary file actually is executable in this OS. I can not see the problem, does someone have any suggestion?