[cfe-dev] Building Boost Serializer library with Clang, no symbols exported

Kim soldoutseashell at gmail.com
Sat Sep 7 21:09:01 PDT 2013


Hey guys,

I'm trying to compile Boost Serializer library using Clang on windows 
targeting mingw and I get a lot of warnings like this:

In file included from 
F:\boost_1_54_0\boost/serialization/base_object.hpp:39:
F:\boost_1_54_0\boost/serialization/void_cast_fwd.hpp:29:1: warning: 
dllexport attribute ignored [-Wignored-attributes]
BOOST_DLLEXPORT
^
F:\boost_1_54_0\boost/serialization/force_include.hpp:37:43: note: 
expanded from macro 'BOOST_DLLEXPORT'
#       define BOOST_DLLEXPORT __declspec(dllexport)
                                           ^
<built-in>:158:38: note: expanded from here
#define __declspec(a) __attribute__((a))
                                      ^

And none of the symbols are actually being exported so when I try to 
link the resulting library I get a lot of symbol not found errors. 
Clang/LLVM was built with mingw and I'm pointing bjam to the mingw STL 
headers. Here are the full build logs for building the static and 
dynamic versions of the library.
https://dl.dropboxusercontent.com/u/1735585/buildlogstatic.txt
https://dl.dropboxusercontent.com/u/1735585/buildlogdynamic.txt

Bjam is calling clang like this:

clang-linux.compile.c++.without-pth 
bin.v2\libs\serialization\build\clang-linux-3.4\debug\link-static\threading-multi\binary_iarchive.obj
clang version 3.4 (trunk)
Target: i686-pc-mingw32
Thread model: posix
Selected GCC installation:
  "F:\LLVM-fresh\release\Release+Asserts\bin\clang++.exe" -cc1 -triple 
i686-pc-mingw32 -S -disable-free -main-file-name binary_iarchive.cpp 
-mrelocation-model static -mdisable-fp-elim -fmath-errno 
-mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.23.2 
-v -v -g -coverage-file 
"C:\\Users\\Kim\\AppData\\Local\\Temp\\binary_iarchive-e303b0.s" 
-nostdsysteminc -nobuiltininc -resource-dir 
"F:\\LLVM-fresh\\release\\Release+Asserts\\bin\\..\\lib\\clang\\3.4" -D 
BOOST_ALL_NO_LIB=1 -I "F:\\\\boost_1_54_0" -I 
"C:\\MinGW\\mingw32\\include" -I 
"C:\\MinGW\\lib\\gcc\\mingw32\\4.8.1\\include\\c++\\mingw32" -I 
"C:\\\\mingw\\\\lib\\\\gcc\\\\mingw32\\\\4.8.1\\\\include" -I 
"C:\\\\MinGW\\\\lib\\\\gcc\\\\mingw32\\\\4.8.1\\\\include\\\\c++\\\\mingw32" 
-I "C:\\\\MinGW\\\\lib\\\\gcc\\\\mingw32\\\\4.8.1\\\\include\\\\c++" -I 
"C:\\\\MinGW\\\\lib\\\\gcc\\\\mingw32\\\\4.8.1\\\\include\\\\c++\\\\tr1" 
-I . -O0 -Wall -std=c++11 -fdeprecated-macro -fno-dwarf-directory-asm 
-fdebug-compilation-dir "F:\\boost_1_54_0" -ferror-limit 19 
-fmessage-length 0 -mstackrealign -fno-use-cxa-atexit -fno-inline 
-fobjc-runtime=gcc -fobjc-default-synthesize-properties -fcxx-exceptions 
-fexceptions -fdiagnostics-show-option -vectorize-slp -o 
"C:\\Users\\Kim\\AppData\\Local\\Temp\\binary_iarchive-e303b0.s" -x c++ 
"libs\\serialization\\src\\binary_iarchive.cpp"
clang -cc1 version 3.4 based upon LLVM 3.4svn default target i686-pc-mingw32
ignoring duplicate directory 
"C:\MinGW\lib\gcc\mingw32\4.8.1\include\c++\mingw32"
ignoring duplicate directory "F:\boost_1_54_0"
#include "..." search starts here:
#include <...> search starts here:
  F:\boost_1_54_0
  C:\MinGW\mingw32\include
  C:\MinGW\lib\gcc\mingw32\4.8.1\include\c++\mingw32
  C:\\mingw\\lib\\gcc\\mingw32\\4.8.1\\include
  C:\\MinGW\\lib\\gcc\\mingw32\\4.8.1\\include\\c++
  C:\\MinGW\\lib\\gcc\\mingw32\\4.8.1\\include\\c++\\tr1
End of search list.
In file included from libs\serialization\src\binary_iarchive.cpp:14:
In file included from F:\boost_1_54_0\boost/archive/binary_iarchive.hpp:20:
In file included from 
F:\boost_1_54_0\boost/archive/binary_iarchive_impl.hpp:21:
In file included from 
F:\boost_1_54_0\boost/archive/basic_binary_iprimitive.hpp:56:
In file included from F:\boost_1_54_0\boost/serialization/array.hpp:19:
In file included from F:\boost_1_54_0\boost/serialization/nvp.hpp:34:
In file included from 
F:\boost_1_54_0\boost/serialization/base_object.hpp:39:
F:\boost_1_54_0\boost/serialization/void_cast_fwd.hpp:29:1: warning: 
dllexport attribute ignored [-Wignored-attributes]
BOOST_DLLEXPORT
^
F:\boost_1_54_0\boost/serialization/force_include.hpp:37:43: note: 
expanded from macro 'BOOST_DLLEXPORT'
#       define BOOST_DLLEXPORT __declspec(dllexport)
                                           ^
<built-in>:158:38: note: expanded from here
#define __declspec(a) __attribute__((a))
                                      ^
In file included from libs\serialization\src\binary_iarchive.cpp:14:
In file included from F:\boost_1_54_0\boost/archive/binary_iarchive.hpp:20:
In file included from 
F:\boost_1_54_0\boost/archive/binary_iarchive_impl.hpp:22:
In file included from 
F:\boost_1_54_0\boost/archive/basic_binary_iarchive.hpp:31:
In file included from 
F:\boost_1_54_0\boost/archive/detail/common_iarchive.hpp:23:
In file included from 
F:\boost_1_54_0\boost/archive/detail/interface_iarchive.hpp:22:
In file included from 
F:\boost_1_54_0\boost/archive/detail/iserializer.hpp:79:
F:\boost_1_54_0\boost/serialization/void_cast.hpp:265:1: warning: 
dllexport attribute ignored [-Wignored-attributes]
BOOST_DLLEXPORT
^
F:\boost_1_54_0\boost/serialization/force_include.hpp:37:43: note: 
expanded from macro 'BOOST_DLLEXPORT'
#       define BOOST_DLLEXPORT __declspec(dllexport)
                                           ^
<built-in>:158:38: note: expanded from here
#define __declspec(a) __attribute__((a))


I hope someone can tell me why this is happening and how it can be 
fixed. Thanks a lot for your time.



More information about the cfe-dev mailing list