J'essayais de compiler mon application GTKmm 3 sur Windows. Obtenez une erreur lors de la compilation qui Glib :: ustring n'a pas de constructeurImpossible de lier GTKmm 3 app avec minGW64 ithin MSYS2: constructeur ustring pas trouvé
Glib:: ustring:: ustring(std::string*)
bien que le code est compilé avec succès sur Ubuntu.
Exemple de code:
#include <gtkmm.h>
#include <string>
int main()
{
std::string a("aa");
Glib::ustring b(a);
return 0;
}
Compiler avec:
g++ -std=c++14 -c test.cpp `pkg-config gtkmm-3.0 --cflags` && \
g++ test.o `pkg-config --libs gtkmm-3.0`
sortie (sur 64 bits de Windows 10, MSYS2 MinGW64):
test.o:test.cpp:(.text+0x51): undefined reference to `Glib::ustring::ustring(std::string const&)'
test.o:test.cpp:(.text+0x51): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `Glib::ustring::ustring(std::string const&)'
collect2: error: ld returned 1 exit status
Fenêtres: Glib 2.50.3, Glibmm 2.50.0, GCC 5.3.0 (MinGW 64bit)
Ubuntu: Glib 2.48.1, Glibmm 2.46.3, GCC 5.4 .0