From: Romain Beauxis <toots@rastageeks.org>
To: OCaml List <caml-list@inria.fr>
Cc: Samuel Mimram <smimram@gmail.com>
Subject: [Caml-list] Mingw-ocaml and C++
Date: Sun, 24 Mar 2013 12:43:21 +0100 [thread overview]
Message-ID: <CABWZ6OSFym5vwgcKvF19rtyq3zPXfAoSwYjpvhO+Kfw_fx0s-Q@mail.gmail.com> (raw)
Hi all,
I have extracted the debian-specific build for mingw-ocaml into a
standalone build:
https://github.com/savonet/mingw-ocaml
You should be able to use it to build mingw-ocaml for windows 32 and
64 bit. It has been updated with the latest ocaml (4.00.1) and flexdll
(0.30)
However, I am having some serious trouble with C++ FlexDLL linking on
Debian wheezy and sid.
This is a problem that occurs when building OCaml modules based on C++
libraries. Here's a simple way to reproduce. It does not involve OCaml
but showcases the exact issue I am having with libraries and is damn
simple:
- Install mingw-ocaml or compile it from the sources above. Doesn't
matter the version, bug is the same.
- Create this file:
% cat hello.cpp
#include <iostream>
int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}
- Compile it:
% i686-w64-mingw32-g++ -c hello.cpp
- Link it with gcc:
% i686-w64-mingw32-gcc -o hello.exe ./hello.o -lstdc++
- Try to link it with flexlink:
% flexlink -exe -chain mingw -L/usr/i686-w64-mingw32/lib -o
hello-flexlink.exe -lstdc++ hello.o -v -v -v
** Use cygpath: false
** Search path:
/usr/i686-w64-mingw32/lib
/usr/lib/gcc/i686-w64-mingw32/4.6
/mingw/lib
** Default libraries:
crt2.o
-lmingw32
-lgcc
-lmoldname
-lmingwex
-lmsvcrt
-luser32
-lkernel32
-ladvapi32
-lshell32
** Cannot resolve symbols for hello.o:
__ZSt4cout
** open: /usr/i686-w64-mingw32/lib/crt2.o
** open: /usr/i686-w64-mingw32/lib/libmingw32.a
** open: /usr/lib/gcc/i686-w64-mingw32/4.6/libgcc.a
** open: /usr/i686-w64-mingw32/lib/libmoldname.a
** open: /usr/i686-w64-mingw32/lib/libmingwex.a
** open: /usr/i686-w64-mingw32/lib/libmsvcrt.a
** open: /usr/i686-w64-mingw32/lib/libuser32.a
** open: /usr/i686-w64-mingw32/lib/libkernel32.a
** open: /usr/i686-w64-mingw32/lib/libadvapi32.a
** open: /usr/i686-w64-mingw32/lib/libshell32.a
zsh: exit 2 flexlink -exe -chain mingw -L/usr/i686-w64-mingw32/lib
-o hello.exe -lstdc++
Any input or directions to grab more information would be greatly
welcome as I am pretty dry on how to fix this issue currently..
Thanks!
Romain
next reply other threads:[~2013-03-24 11:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-24 11:43 Romain Beauxis [this message]
2013-03-25 2:22 ` [Caml-list] " Romain Beauxis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABWZ6OSFym5vwgcKvF19rtyq3zPXfAoSwYjpvhO+Kfw_fx0s-Q@mail.gmail.com \
--to=toots@rastageeks.org \
--cc=caml-list@inria.fr \
--cc=smimram@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox