Boost File System on Cygwin and native paths
Hi, I am having some troubles with Boost File System on Cygwin. It seems to use Posix file paths as native, but I need Windows paths since I am using Cygwin to develop an application for Windows. I compiled my own projects and the boost libraries on Cygwin using msvc-8.0. Do I need to pass some special compiler flag to tell the file system library that native is Windows, and not Cygwin/Posix? Cheers, Andrej __________________________________________________________ Not happy with your email address?. Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
When building the library, you need to set the variable BOOST_WINDOWS_API which I imagine should be declared like this in the user-config.jam file: <cflags>/DBOOST_WINDOWS_API <cxxflags>/DBOOST_WINDOWS_API <compilerflags>/DBOOST_WINDOWS_API When compiling your code, do the same. F. Bron ___________________________________ Frédéric Bron (frederic.bron@alcan.com) Unité ALT, Alcan CRV, BP 27, 38341 Voreppe +33 4 76 57 81 72, +33 6 07 48 56 67 Avis : Ce message et toute pièce jointe sont la propriété d'Alcan et sont destinés seulement aux personnes ou à l'entité à qui le message est adressé. Si vous avez reçu ce message par erreur, veuillez le détruire et en aviser l'expéditeur par courriel. Si vous n'êtes pas le destinataire du message, vous n'êtes pas autorisé à utiliser, à copier ou à divulguer le contenu du message ou ses pièces jointes en tout ou en partie. Notice: This message and any attachments are the property of Alcan and are intended solely for the named recipients or entity to whom this message is addressed. If you have received this message in error please inform the sender via e-mail and destroy the message. If you are not the intended recipient you are not allowed to use, copy or disclose the contents or attachments in whole or in part.
Hi,
When building the library, you need to set the variable BOOST_WINDOWS_API which I imagine should be declared like this in the user-config.jam file: <cflags>/DBOOST_WINDOWS_API <cxxflags>/DBOOST_WINDOWS_API <compilerflags>/DBOOST_WINDOWS_API
I tried this with <define>BOOST_WINDOWS_API but still
the test-program below gives me the output:
"Directory does not exist: c:" (and /tmp obviously
does exist). I also tried experimenting with
BOOST_WINDOWAS_PATH, but nothing seems to help. What
am I doing wrong?
Cheers,
Andrej
#include <iostream>
#include
Hi,
I just found that Boost File System seems to be
completely broken on my system. The mini-program below
always behaves the same, it will print the string
enclosed in the first if-statement, regardless what
the values of p1 and p2 are.
I compiled boost on Cygwin with msvc-8.0. I also tried
the binary distribution for Windows XP, but I get the
same problems. What can this be?
Cheers,
Andrej
#include <iostream>
#include
Andrej van der Zee wrote:
Hi,
I just found that Boost File System seems to be completely broken on my system. The mini-program below always behaves the same, it will print the string enclosed in the first if-statement, regardless what the values of p1 and p2 are.
I compiled boost on Cygwin with msvc-8.0. I also tried the binary distribution for Windows XP, but I get the same problems. What can this be?
Please provide a command line with which you built your example.
[snip]
Hi, Thanks for your help. I am getting worse problems when I try to run the "simple_ls" example from the boost distribution. It throws an unexpected exception (somewhere in detail::get_current_path_api()). In the meanwhile I found out it is not Cygwin that is in the way, but it looks like some missing compiler/linker option: When I compile "simple_ls" in a new project in Visual Studio 2005 as a win32 application it works fine, but when I use a custom Visual Studio 2005 project that uses bjam, I get the runtime exception again. Identical for Cygwin builds.
Please provide a command line with which you built your example.
Anyway, I really hope you can help me, I am struggling with this all day. Coming back to your question, these are the commands when I compile it in Cygwin: $ bjam -d2 ...patience... ...found 380 targets... ...updating 2 targets... file bin\msvc-8.0\debug\optimization-speed\threading-multi\simple_ls.obj.rsp "simple_ls.cpp" -Fo"bin\msvc-8.0\debug\optimization-speed\threading-multi\simple_ls.obj" -TP /O2 /Z7 /Ob0 /W3 /GR /MDd /Zc:forScope /Zc:wchar_t /wd4675 /EHs -DBOOST_WINDOWS_API -c -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB=1 -DBOOST_WINDIOWS_API -D_CRT_SECURE_NO_DEPRECATE -D_WIN32_WINNT=0x0501 "-IC:\cygwin\home\Andrej\speedo\trunk" "-IC:\cygwin\usr\local\include\boost-1_35" compile-c-c++ bin/msvc-8.0/debug/optimization-speed/threading-multi/simple_ls.obj cmd.exe /S /C call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 ">nul" "&&" cl /Zm800 -nologo @"bin\msvc-8.0\debug\optimization-speed\threading-multi\simple_ls.obj.rsp" simple_ls.cpp file bin\msvc-8.0\debug\optimization-speed\threading-multi\simple_ls.exe.rsp "bin/msvc-8.0/debug/optimization-speed/threading-multi/simple_ls.obj" "boost_filesystem-mt.lib" "boost_system-mt.lib" msvc.link bin/msvc-8.0/debug/optimization-speed/threading-multi/simple_ls.exe cmd.exe /S /C call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 ">nul" "&&" link /NOLOGO /INCREMENTAL:NO /DEBUG /subsystem:console /out:"bin\msvc-8.0\debug\optimization-speed\threading-multi\simple_ls.exe" /LIBPATH:"C:\cygwin\usr\local\lib" @"bin\msvc-8.0\debug\optimization-speed\threading-multi\simple_ls.exe.rsp" if test -e "bin/msvc-8.0/debug/optimization-speed/threading-multi/simple_ls.exe.manifest"; then cmd.exe /S /C call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 ">nul" "&&" mt -nologo -manifest "bin\msvc-8.0\debug\optimization-speed\threading-multi\simple_ls.exe.manifest" "-outputresource:bin\msvc-8.0\debug\optimization-speed\threading-multi\simple_ls.exe;1" fi Cheers, Andrej __________________________________________________________ Not happy with your email address?. Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
Andrej van der Zee wrote:
[snip] bin\msvc-8.0\debug\optimization-speed\threading-multi\simple_ls.obj.rsp "simple_ls.cpp"
It seems strange that you are building with variant=debug and optimization=speed. Make sure you are linking against libraries built with the same properties. HTH
[snip]
Hi,
It seems strange that you are building with variant=debug and optimization=speed. Make sure you are linking against libraries built with the same properties.
The problem is indeed when building my own project with variant=debug and linking against boost_filesystem with variant=release (and visa versa). On Linux this does not result in any problems though, and also other libraries on Windows do not seem to suffer. Anyway, problem solved... Thanks alot! Andrej __________________________________________________________ Not happy with your email address?. Get the one you really want - millions of new email addresses available now at Yahoo! http://uk.docs.yahoo.com/ymail/new.html
participants (3)
-
Andrej van der Zee
-
frederic.bron@alcan.com
-
Ilya Sokolov