Hi,
I'm trying to compile a project which uses CEF with MinGW, but I'm getting "undefined reference to" errors on C++ classes. I have linked libcef and libcef_dll_wrapper (.lib versions). Anyone had any success with MinGW and C++ API?
PolesApart wrote:I've successfully built libcef_dll on mingw-w64 (targetting win32) for cef 3.1750.1738 build.
there are some subtleties which may bite:
a) Code bloat. You'll probably need to carry along mingw stuff consisted of c and c++ runtimes and libgcc_s. The c runtime will be statically linked, but normally the c++ runtime isn't (but -static-libstdc++ is your friend).
b) Your mingw build may or may not have compatible threading support. This may impact how you pass data between your application and cef. Some deadlock may occur if you try to play mr smart guy on top of cef.
c) Don't try to use -flto. It'll work on recent gcc/binutils combo. But it'll introduce heisenbugs that'll bite you long on the development path.
I'll try to attach my relevant Makefile. Please note that it's used on Linux, I cross-compile it, so you'll probably need some fine tunings.
#if defined(__MINGW32__)
#ifndef COMPILER_MINGW
#define COMPILER_MINGW 1
#endif
#ifndef CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_
#define CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_
#pragma once
#include "include/base/cef_build.h"
#if defined(COMPILER_MINGW)
#define CEF_EXPORT __attribute__ ((visibility("default")))
#define CEF_CALLBACK __stdcall
#endif // CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_
#endif
Users browsing this forum: No registered users and 116 guests