0
\$\begingroup\$

While I was developing my game on Linux (I'm using an ARM system), I decided that I want to cross-compile it to Windows. Yet, I get an error while I try to link Allegro (version 4.2) to the compiler.

I have installed MinGW32 (x86_64-w64-mingw32-c++ in the terminal) and have moved the bin / include / lib folders from the Windows Allegro version to the /usr/x86_64-w64-mingw32-c++/ folder.

When I enter into the command line:

x86_64-w64-mingw32-c++ *.cpp -o W_Survival `allegro-config --libs`

It returned to me a linking error:

/usr/bin/x86_64-w64-mingw32-ld: unrecognized option '-z'     
/usr/bin/x86_64-w64-mingw32-ld: use the --help option for usage  information    
collect2: ld returned 1 exit status

The compiling is all the same as I would do it using g++. the only thing different is that I have it set to compile for windows.

Is there anything that I did wrong? All help is appreciated :)

\$\endgroup\$
  • \$\begingroup\$ did you correctly link against a 64-bit mingw version of the allegro libs? \$\endgroup\$ – tubberd Feb 12 '16 at 15:33
  • \$\begingroup\$ Oh my, that did the trick! After I put the 64-bit version in it all worked properly! Thanks! \$\endgroup\$ – PlatyPi Feb 13 '16 at 19:29
  • \$\begingroup\$ Ill add that ad an answet then :D \$\endgroup\$ – tubberd Feb 14 '16 at 14:40
  • \$\begingroup\$ do you mind accepting this as the answer? for one, this will help people who have the same or similar problems. \$\endgroup\$ – tubberd Feb 15 '16 at 1:07
1
\$\begingroup\$

You need to make sure you link against the correct version of your dependencies: In this case, the 64-Bit MinGW ones.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.