Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

mingw32 - Missing DirectX headers for 32 bit target system

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
dachschaden
n00b
n00b
Posts: 65
Joined: Sat Jun 07, 2014 1:19 pm
Location: Germany

mingw32 - Missing DirectX headers for 32 bit target system

  • Quote

Post by dachschaden » Fri Mar 20, 2015 9:30 pm

I need to write a DLL for Wndows, and since I don't plan to do that on Windows (because the build environment is crap), I decided to use mingw32.
I used this document that describes what to do in which order. The commands that I issued are:

Code: Select all

emerge --ask sys-devel/crossdev
USE=-sanitize crossdev -t x86_64-w64-mingw32
USE=-sanitize crossdev -t i686-pc-mingw32
I set USE=-sanitize because otherwise building gcc for the target system fails horribly with blood and tears.

The source code of my DLL includes ddraw.h, a DirectX library. Compiling the code for the 64 bit target platform is no problem:

Code: Select all

$ x86_64-w64-mingw32-gcc ddraw.c -c
But when I try to compile it for the 32 bit target platform, blood and tears and even bloody tears start to appear:

Code: Select all

$ i686-pc-mingw32-gcc ddraw.c -c
ddraw.c:1:19: fatal error: ddraw.h: No such file or directory
 #include <ddraw.h>
                   ^
I searched for them headers:

Code: Select all

$ find /usr/i686-pc-mingw32/ /usr/x86_64-w64-mingw32/ -name dd*.h
/usr/i686-pc-mingw32/usr/include/ddk/ddkmapi.h
/usr/i686-pc-mingw32/usr/include/ddeml.h
/usr/i686-pc-mingw32/usr/include/dde.h
/usr/x86_64-w64-mingw32/usr/include/ddk/dderror.h
/usr/x86_64-w64-mingw32/usr/include/ddrawgdi.h
/usr/x86_64-w64-mingw32/usr/include/ddrawi.h
/usr/x86_64-w64-mingw32/usr/include/ddeml.h
/usr/x86_64-w64-mingw32/usr/include/dde.h
/usr/x86_64-w64-mingw32/usr/include/ddstream.h
/usr/x86_64-w64-mingw32/usr/include/ddraw.h
So, yeah ... what did I do wrong when I installed the 32 bit version of the toolchain? Just to be extra sure I reinstalled it, to no avail.

This is what crossdev spits out if I am recompiling the toolchain:

Code: Select all

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 * crossdev version:      20140917
 * Host Portage ARCH:     amd64
 * Target Portage ARCH:   x86
 * Target System:         i686-pc-mingw32
 * Stage:                 4 (C/C++ compiler)
 * ABIs:                  default

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * headers:               w32api-[latest]
 * libc:                  mingw-runtime-[latest]

 * CROSSDEV_OVERLAY:      /usr/local/portage
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    
 * Portage flags:         
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  
 * leaving metadata/layout.conf alone in /usr/local/portage
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  
!!! WARNING - Cannot auto-configure CHOST i686-pc-mingw32
!!! You should edit /usr/i686-pc-mingw32/etc/portage/make.conf
!!! by hand to complete your configuration
 * Log: /var/log/portage/cross-i686-pc-mingw32-binutils.log
 * Emerging cross-binutils ...                                                                                                                                                                          [ ok ]
 * Log: /var/log/portage/cross-i686-pc-mingw32-w32api-quick.log
 * Emerging cross-w32api-quick ...                                                                                                                                                                      [ ok ]
 * Log: /var/log/portage/cross-i686-pc-mingw32-mingw-runtime-headers.log
 * Emerging cross-mingw-runtime-headers ...                                                                                                                                                             [ ok ]
 * Log: /var/log/portage/cross-i686-pc-mingw32-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                                                                                                                                                        [ ok ]
 * Log: /var/log/portage/cross-i686-pc-mingw32-w32api.log
 * Emerging cross-w32api ...                                                                                                                                                                            [ ok ]
 * Log: /var/log/portage/cross-i686-pc-mingw32-mingw-runtime.log
 * Emerging cross-mingw-runtime ...                                                                                                                                                                     [ ok ]
 * Log: /var/log/portage/cross-i686-pc-mingw32-gcc-stage2.log
 * Emerging cross-gcc-stage2 ...                                                                                                                                                                        [ ok ]
If you need the log files to analyze them, just say so.
Top
Hu
Administrator
Administrator
Posts: 24403
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Fri Mar 20, 2015 9:57 pm

It appears that mingw-runtime does not provide ddraw.h, but mingw64-runtime does provide it. Can you use i686-w64-mingw32 instead of i686-pc-mingw32? The i686-w64 version is supposed to be based on the mingw64 project, but produce 32-bit outputs like i686-pc-mingw32 would.
Top
dachschaden
n00b
n00b
Posts: 65
Joined: Sat Jun 07, 2014 1:19 pm
Location: Germany

  • Quote

Post by dachschaden » Sat Mar 21, 2015 4:48 am

Yup, works like a charm ... so far, I guess.
Thank you very much for the quick suggestion.
Top
Post Reply

3 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic