bjam does not find *.lib file

Dear all, I have troubles to compile because bjam does not find a *.lib file which I would expect to be there. I am on Windows 7 with Boost 1.50.0 and visual studio 10. It complains: |LINK : fatal error LNK1181: cannot open input file '..\boost-build\additional\msvc-10.0\release\address-model-64\threading-multi\pugixml.lib'| Which is true, the compiler does not build a pugixml.lib. I don't understand why it is not build, since I am building a *.dll. I would appriciate any help, because I have no clue where I should look for the problem. Thanks a lot, Ronny I have the following setup: |\Jamroot.jam \*.cpp *.hpp (contains the source of the main program) \additional\Jamfile.jam \additional\*.cpp *.hpp (contains a module)| The Jamfile in \addtional is: |using msvc ; # external libs lib pugixml : pugixml.cpp ;| The Jamroot in \ is: |using msvc ; use-project boost : c:/boost_1_50_0 ; project spectraImport : requirements <library>/boost/filesystem//boost_filesystem <library>/boost/regex//boost_regex <library>/boost/python//boost_python # disable autolinking <define>BOOST_ALL_NO_LIB <link>shared : build-dir ../boost-build ; exe spectraImport : [ glob *.cpp ] additional//pugixml ; install ../boost-build : spectraImport ;| I compile with: bjam address-model=64 variant=release -d2 and get the following output: |C:\Users\Duke\my_projects\lipotypexplorer\trunk\c_modules\spectraimport\spectrai mport>bjam address-model=64 variant=release -d2 Performing configuration checks - has_icu builds : no ...patience... ...patience... ...found 2471 targets... ...updating 7 targets... common.mkdir ..\boost-build\additional\msvc-10.0\release\address-model-64 if not exist "..\boost-build\additional\msvc-10.0\release\address-model- 64\\" mkdir "..\boost-build\additional\msvc-10.0\release\address-model-64" common.mkdir ..\boost-build\additional\msvc-10.0\release\address-model-64\thread ing-multi if not exist "..\boost-build\additional\msvc-10.0\release\address-model- 64\threading-multi\\" mkdir "..\boost-build\additional\msvc-10.0\release\address -model-64\threading-multi" file ..\boost-build\additional\msvc-10.0\release\address-model-64\threading-mult i\pugixml.obj.rsp "additional\pugixml.cpp" -Fo"..\boost-build\additional\msvc-10.0\release\address -model-64\threading-multi\pugixml.obj" -TP /O2 /Ob2 /W3 /GR /MD /Zc:forScope /Zc:wchar_t /favor:blend /wd4675 /EHs -c -DBOOST_ALL_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_DYN_LINK=1 -DNDEBUG "-IC:\boost_1_50_0" "-Ic:\Python27\Include" compile-c-c++ ..\boost-build\additional\msvc-10.0\release\address-model-64\threa ding-multi\pugixml.obj call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86_amd64 >nul cl /Zm800 -nologo @"..\boost-build\additional\msvc-10.0\release\address-model-64 \threading-multi\pugixml.obj.rsp" pugixml.cpp file ..\boost-build\additional\msvc-10.0\release\address-model-64\threading-mult i\pugixml.dll.rsp "..\boost-build\additional\msvc-10.0\release\address-model-64\threading-multi\pu gixml.obj" "C:\boost_1_50_0\bin.v2\libs\python\build\msvc-10.0\release\address-model-64\thr eading-multi\boost_python-vc100-mt-1_50.lib" "C:\boost_1_50_0\bin.v2\libs\regex\build\msvc-10.0\release\address-model-64\thre ading-multi\boost_regex-vc100-mt-1_50.lib" "C:\boost_1_50_0\bin.v2\libs\system\build\msvc-10.0\release\address-model-64\thr eading-multi\boost_system-vc100-mt-1_50.lib" "C:\boost_1_50_0\bin.v2\libs\filesystem\build\msvc-10.0\release\address-model-64 \threading-multi\boost_filesystem-vc100-mt-1_50.lib" "python27.lib" msvc.link.dll ..\boost-build\additional\msvc-10.0\release\address-model-64\threa ding-multi\pugixml.dll call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.b at" x86_amd64 >nul link /NOLOGO /INCREMENTAL:NO /DLL /MACHINE:X64 /subsystem:console /out:"..\boost -build\additional\msvc-10.0\release\address-model-64\threading-multi\pugixml.dll " /IMPLIB:"..\boost-build\additional\msvc-10.0\release\address-model-64\threadin g-multi\pugixml.lib" /LIBPATH:"c:\Python27\libs" @"..\boost-build\additional\m svc-10.0\release\address-model-64\threading-multi\pugixml.dll.rsp" if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL% msvc.manifest.dll ..\boost-build\additional\msvc-10.0\release\address-model-64\t hreading-multi\pugixml.dll if exist "..\boost-build\additional\msvc-10.0\release\address-model-64\t hreading-multi\pugixml.dll.manifest" ( call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsa ll.bat" x86_amd64 >nul mt -nologo -manifest "..\boost-build\additional\msvc-10.0\release\address-model- 64\threading-multi\pugixml.dll.manifest" "-outputresource:..\boost-build\additio nal\msvc-10.0\release\address-model-64\threading-multi\pugixml.dll;2" ) file ..\boost-build\msvc-10.0\release\address-model-64\threading-multi\spectraIm port.exe.rsp "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\Align.obj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\AlignPrecurso r.obj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\AssociateSpec tra.obj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\averaging.obj " "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\averagingmsms .obj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\Import.obj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\ImportSpectra .obj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\ReadRaw.obj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\Resolution.ob j" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\SIException.o bj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\SpectraCalibr ate.obj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\spectraimport .obj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\SpectraImport Tools.obj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\stdafx.obj" "..\boost-build\msvc-10.0\release\address-model-64\threading-multi\Tolerance.obj " "..\boost-build\additional\msvc-10.0\release\address-model-64\threading-multi\pu gixml.lib" "C:\boost_1_50_0\bin.v2\libs\python\build\msvc-10.0\release\address-model-64\thr eading-multi\boost_python-vc100-mt-1_50.lib" "C:\boost_1_50_0\bin.v2\libs\regex\build\msvc-10.0\release\address-model-64\thre ading-multi\boost_regex-vc100-mt-1_50.lib" "C:\boost_1_50_0\bin.v2\libs\system\build\msvc-10.0\release\address-model-64\thr eading-multi\boost_system-vc100-mt-1_50.lib" "C:\boost_1_50_0\bin.v2\libs\filesystem\build\msvc-10.0\release\address-model-64 \threading-multi\boost_filesystem-vc100-mt-1_50.lib" "python27.lib" msvc.link ..\boost-build\msvc-10.0\release\address-model-64\threading-multi\spec traImport.exe call "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.b at" x86_amd64 >nul link /NOLOGO /INCREMENTAL:NO /MACHINE:X64 /subsystem:console /out:"..\boost-buil d\msvc-10.0\release\address-model-64\threading-multi\spectraImport.exe" /LIBPATH :"c:\Python27\libs" @"..\boost-build\msvc-10.0\release\address-model-64\threadi ng-multi\spectraImport.exe.rsp" if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL% LINK : fatal error LNK1181: cannot open input file '..\boost-build\additional\ms vc-10.0\release\address-model-64\threading-multi\pugixml.lib' ...failed msvc.link ..\boost-build\msvc-10.0\release\address-model-64\threading- multi\spectraImport.exe... ...skipped <p..\boost-build>spectraImport.exe for lack of <p..\boost-build\msvc- 10.0\release\address-model-64\threading-multi>spectraImport.exe... ...failed updating 1 target... ...skipped 1 target... ...updated 5 targets...|

Hi Ronny, On Monday, 4. March 2013 14:28:58 Ronny Herzog wrote:
Dear all,
I have troubles to compile because bjam does not find a *.lib file which I would expect to be there. I am on Windows 7 with Boost 1.50.0 and visual studio 10.
It complains:
LINK : fatal error LNK1181: cannot open input file '..\boost-build\additional\msvc-10.0\release\address-model-64\threading-mult i\pugixml.lib' Which is true, the compiler does not build a pugixml.lib. I don't understand why it is not build, since I am building a *.dll. I would appriciate any help, because I have no clue where I should look for the problem.
That is most probably the classical bug that the msvc link.exe does not generate a .lib export library when no visible symbols are available. Do you export your symbols from "pugixml.cpp" via "dllexport/import"? Your Jamfile for "pugixml" seems to contain no controlling define for that. Yours, Jürgen -- * Dipl.-Math. Jürgen Hunold ! * voice: ++49 4257 300 ! Fährstraße 1 * fax : ++49 4257 300 ! 31609 Balge/Sebbenhausen * jhunold@gmx.eu ! Germany

Thank you, Juergen, there is a switch in the pugixml.hpp for the dll export. When I switch this on, it does not complain about not-finding the *.lib. I am just wondering, because the compilation worked some months ago. Anyway, I get another strange error. It says |error LNK2019: unresolved external symbol [...]| The linker cannot resolve a function which is defined in the same file: pugixml.cpp: |//[...] // Writer interface for node printing (see xml_node::print) class PUGIXML_CLASS xml_writer { public: virtual ~xml_writer() {} // Write memory chunk into stream/file/whatever virtual void write(const void* data, size_t size) =0; }; // xml_writer implementation for FILE* class PUGIXML_CLASS xml_writer_file:public xml_writer { public: // Construct writer from a FILE* object; void* is used to avoid header dependencies on stdio xml_writer_file(void* file); virtual void write(const void* data, size_t size); private: void* file; }; #ifndef PUGIXML_NO_STL // xml_writer implementation for streams class PUGIXML_CLASS xml_writer_stream:public xml_writer { public: // Construct writer from an output stream object xml_writer_stream(std::basic_ostream<char,std::char_traits<char> >& stream); xml_writer_stream(std::basic_ostream<wchar_t,std::char_traits<wchar_t> >& stream); virtual void write(const void* data, size_t size); private: std::basic_ostream<char,std::char_traits<char> >* narrow_stream; std::basic_ostream<wchar_t,std::char_traits<wchar_t> >* wide_stream; }; #endif //[...]| and pugixml.hpp: |//[...] namespace pugi { PUGI__FN xml_writer_file::xml_writer_file(void* file_): file(file_) { } PUGI__FNvoid xml_writer_file::write(const void* data, size_t size) { size_t result = fwrite(data,1, size,static_cast<FILE*>(file)); (void)!result;// unfortunately we can't do proper error handling here } #ifndef PUGIXML_NO_STL PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream<char,std::char_traits<char> >& stream): narrow_stream(&stream), wide_stream(0) { } PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream<wchar_t,std::char_traits<wchar_t> >& stream): narrow_stream(0), wide_stream(&stream) { } PUGI__FNvoid xml_writer_stream::write(const void* data, size_t size) { if (narrow_stream) { assert(!wide_stream); narrow_stream->write(reinterpret_cast<const char*>(data),static_cast<std::streamsize>(size)); } else { assert(wide_stream); assert(size %sizeof(wchar_t) ==0); wide_stream->write(reinterpret_cast<const wchar_t*>(data),static_cast<std::streamsize>(size /sizeof(wchar_t))); } } #endif //[...]| Thanks for the help! Ronny Am 3/4/2013 2:40 PM, schrieb Jürgen Hunold:
Hi Ronny,
On Monday, 4. March 2013 14:28:58 Ronny Herzog wrote:
Dear all,
I have troubles to compile because bjam does not find a *.lib file which I would expect to be there. I am on Windows 7 with Boost 1.50.0 and visual studio 10.
It complains:
LINK : fatal error LNK1181: cannot open input file '..\boost-build\additional\msvc-10.0\release\address-model-64\threading-mult i\pugixml.lib' Which is true, the compiler does not build a pugixml.lib. I don't understand why it is not build, since I am building a *.dll. I would appriciate any help, because I have no clue where I should look for the problem. That is most probably the classical bug that the msvc link.exe does not generate a .lib export library when no visible symbols are available. Do you export your symbols from "pugixml.cpp" via "dllexport/import"? Your Jamfile for "pugixml" seems to contain no controlling define for that.
Yours,
Jürgen

AMDG On 03/04/2013 06:40 AM, Ronny Herzog wrote:
Thank you, Juergen,
there is a switch in the pugixml.hpp for the dll export. When I switch this on, it does not complain about not-finding the *.lib. I am just wondering, because the compilation worked some months ago.
Anyway, I get another strange error. It says
|error LNK2019: unresolved external symbol [...]|
You snipped the most important part of the error message. In Christ, Steven Watanabe

Thank you, Juergen, there is a switch in the pugixml.hpp for the dll export. When I switch this on, it does not complain about not-finding the *.lib. I am just wondering, because the compilation worked some months ago. Anyway, I get another strange error. It says error LNK2019: unresolved external symbol [...] The linker cannot resolve a function which is defined in the same file: pugixml.cpp: <code> //[...] // Writer interface for node printing (see xml_node::print) class PUGIXML_CLASS xml_writer { public: virtual ~xml_writer() {} // Write memory chunk into stream/file/whatever virtual void write(const void* data, size_t size) = 0; }; // xml_writer implementation for FILE* class PUGIXML_CLASS xml_writer_file: public xml_writer { public: // Construct writer from a FILE* object; void* is used to avoid header dependencies on stdio xml_writer_file(void* file); virtual void write(const void* data, size_t size); private: void* file; }; #ifndef PUGIXML_NO_STL // xml_writer implementation for streams class PUGIXML_CLASS xml_writer_stream: public xml_writer { public: // Construct writer from an output stream object xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream); xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream); virtual void write(const void* data, size_t size); private: std::basic_ostream<char, std::char_traits<char> >* narrow_stream; std::basic_ostream<wchar_t, std::char_traits<wchar_t> >* wide_stream; }; #endif //[...] </code> and pugixml.hpp: <code> //[...] namespace pugi { PUGI__FN xml_writer_file::xml_writer_file(void* file_): file(file_) { } PUGI__FN void xml_writer_file::write(const void* data, size_t size) { size_t result = fwrite(data, 1, size, static_cast<FILE*>(file)); (void)!result; // unfortunately we can't do proper error handling here } #ifndef PUGIXML_NO_STL PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream<char, std::char_traits<char> >& stream): narrow_stream(&stream), wide_stream(0) { } PUGI__FN xml_writer_stream::xml_writer_stream(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& stream): narrow_stream(0), wide_stream(&stream) { } PUGI__FN void xml_writer_stream::write(const void* data, size_t size) { if (narrow_stream) { assert(!wide_stream); narrow_stream->write(reinterpret_cast<const char*>(data), static_cast<std::streamsize>(size)); } else { assert(wide_stream); assert(size % sizeof(wchar_t) == 0); wide_stream->write(reinterpret_cast<const wchar_t*>(data), static_cast<std::streamsize>(size / sizeof(wchar_t))); } } #endif //[...] </code> Thanks for the help! Ronny Am 3/4/2013 2:40 PM, schrieb Jürgen Hunold:
Hi Ronny, On Monday, 4. March 2013 14:28:58 Ronny Herzog wrote:
Dear all, I have troubles to compile because bjam does not find a *.lib file which I would expect to be there. I am on Windows 7 with Boost 1.50.0 and visual studio 10. It complains: LINK : fatal error LNK1181: cannot open input file '..\boost-build\additional\msvc-10.0\release\address-model-64\threading-mult i\pugixml.lib' Which is true, the compiler does not build a pugixml.lib. I don't understand why it is not build, since I am building a *.dll. I would appriciate any help, because I have no clue where I should look for the problem.
That is most probably the classical bug that the msvc link.exe does not generate a .lib export library when no visible symbols are available. Do you export your symbols from "pugixml.cpp" via "dllexport/import"? Your Jamfile for "pugixml" seems to contain no controlling define for that. Yours, Jürgen
participants (3)
-
Jürgen Hunold
-
Ronny Herzog
-
Steven Watanabe