-2
Windows上でGTKmm 3アプリケーションをコンパイルしようとしていました。コードはUbuntuの上で正常にコンパイルされるが、口が達者な:: UStringでは、コンストラクタGTKmm 3アプリをminGW64とリンクできませんMSYS2:ustringコンストラクタが見つかりません
Glib:: ustring:: ustring(std::string*)
を持っていない、コンパイル時にエラーが発生します。
サンプルコード:
#include <gtkmm.h>
#include <string>
int main()
{
std::string a("aa");
Glib::ustring b(a);
return 0;
}
してコンパイル:
g++ -std=c++14 -c test.cpp `pkg-config gtkmm-3.0 --cflags` && \
g++ test.o `pkg-config --libs gtkmm-3.0`
出力する(Windows 10のx64上で、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
Windowsの場合:口が達者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