Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble building DOSBox for IDA 6.8 with fresh MSys2 installation #7

Open
RayKoopa opened this issue Feb 29, 2016 · 3 comments
Open

Comments

@RayKoopa
Copy link

I have several issues being able to build IdaDOS and DOSBox on a fresh MSys2 installation when strictly following BUILD.md as I'm new to MSys2. There are some things which can be tricky for a beginner like me, which I bolded. I still can't compile DOSBox correctly eventually.

Sorry that I can't even teach Github to continue my list numbers when using code blocks.

Preparations

  1. Install MSys2 from http://msys2.github.io/ (msys2-i686-20160205.exe) and running it.
  2. Running pacman -S mingw-w64-i686-toolchain (installing all members)
  3. Running pacman -S mingw-w64-i686-SDL as I need to build DOSBox too later on.
  4. Copying my idasdk68 to /d/idasdk68.

Compiling IdaDOS

  1. Download idados into /d/idados.
  2. Since I use IDA 6.8, change two lines back to what was changed here: 8b0ef6a
  3. Editing build_mingw.sh to use ../idasdk68 rather than ../idasdk69
  4. Starting MSys2 with the "MinGW-w64 Win32 Shell" shortcut in the MSys2 folder in the start menu.
  5. Switching to /d/idados and executing ./build_mingw.sh.
  6. Getting the following error:
In file included from ../idasdk68/plugins/debugger/tcpip.h:4:0,
from dosbox_rstub.cpp:15:
../idasdk68/include/pro.h:735:84: error: conflicting declaration of C function 'int memicmp(const void*, const void*, size_t)'
idaman THREAD_SAFE int ida_export memicmp(const void *x, const void *y, size_t size);
  1. Thinking this is the issue actually described under the "DOSBox" compilation section in BUILD.md.
    Thus, changing #ifdef __GNUC__ in pro.h to #if 0 so it looks like this:
#if 0
idaman THREAD_SAFE int ida_export memicmp(const void *x, const void *y, size_t size);
#endif
  1. Executing ./build_mingw.sh again. Getting the error:
C:/msys32/mingw32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lida
collect2.exe: error: ld returned 1 exit status
  1. Also copying over ida.wll into /d/idasdk68/bin/ida.dll as actually described under the "DOSBox" section in BUILD.md.
  2. Now, compiling the IdaDOS plugin works flawlessy.
  3. Copying dosbox_rstub.plw to my IDA plugin directory.
  4. Copying C:\msys32\mingw32\bin\libwinpthread-1.dll to my IDA installation directory.

The notes about __GNUC__ and ida.dll should probably go under the IdaDOS section already.

Compiling DOSBox

  1. Download DOSBox repository from https://github.com/wjp/dosbox into /d/dosbox.
  2. Switching into that directory with MSys2.
  3. Running .autogen-sh. Getting the following output:
Generating build information using aclocal, autoheader, automake and autoconf
This may take a while ...
./autogen.sh: line 8: aclocal: command not found
./autogen.sh: line 9: autoheader: command not found
./autogen.sh: line 10: automake: command not found
./autogen.sh: line 11: autoconf: command not found
Now you are ready to run ./configure.
You can also run  ./configure --help for extra features to enable/disable.
  1. Trying to install the missing commands with pacman -Su automake and pacman -Su autoconf.
  2. Re-running ./autogen-sh. Getting quite a few warnings about source files being in subdirectories (if required, I can upload the warnings). But no errors.
  3. Running ./configure --enable-debug=ida32 --with-ida-sdk=/d/idasdk68 --with-ida-plugin=/d/idados, no errors.
  4. Running make. Noticing it's not installed. Installing it with pacman -Su make.
  5. Getting the following error:
In file included from debug.cpp:47:0:
debug_inc.h:22:20: fatal error: curses.h: No such file or directory
compilation terminated.
  1. Looking up how to get curses.h, following the instructions found in http://www.dosbox.com/wiki/BuildingDOSBox under the "Enabling the debugger (You probably don't want this)" section (requiring to install tar too).
  2. Switching back to the DOSBox directory and re-running make, now running without errors (build log on request).
  3. Copying src/DOSBox.exe into my DOSBox 0.74 directory.
  4. Trying to start it, missing some DLLs, requiring me to copy over libgcc_s_dw2-1.dll and libwinpthread-1.dll from C:\msys32\mingw32\bin as it is not in my PATH. Also having to copy over IDA.WLL from my IDA directory.
  5. Starting DOSBox again. Getting following error:
The procedure entry point _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE13find_first_ofEPKcjj could not be located in the dynamic link library D:\Archive\Games\Emulators\DOSBox Debug\DOSBox.exe. 

I'm out of ideas, I had a similar error yesterday about a missing symbol. What do I have to do to correctly compile DOSBox?

@wjp
Copy link
Owner

wjp commented Feb 29, 2016

Thanks for the detailed write-up. I'll look at it in detail later, but to start with the error at the end: that looks like a symbol from libstdc++. Do you have a libstdc++.dll (or maybe similar) in C:\msys32\mingw32\bin that you could also try copying to the dosbox directory?

@RayKoopa
Copy link
Author

In fact, I had libstdc++-6.dll, copying that into the DOSBox directory helped.
Funny, I thought if Windows says it doesn't find the symbol in DOSBox.exe, it had to be compiled into it =3

@Artoymyp
Copy link

I had some specific problems with my MinGW/MSys installation. Make command resulted in some compiller errors like:
::sprintf has not been declared in some *.cpp.

I have solved it by adding at the top of all problem cpp-files the following include:
#include <cstdio>

On a side note. RayKoopa, just let me to kiss you for three times! I have meddled in all this mess for three evenings straight, just until I have found your marvelous instruction for MinGW begginners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants