Travis Vitek wrote:
Martin,

There is a build configuration option that for generate.bat that appears
to setup the project files to copy the dll into the executable directory
so that it can be found at runtime. If you didn't specify that option
when generating the solution and project files, you will either need to
copy the .dll into the directory of the excutable, or make sure that it
can be found in your PATH.

Ah, yes, I forgot about the /COPYDLL option. Thanks!

On the UNIX side of things, we use the -rpath linker option
(or whatever it's called) to hardwire $BUILDDIR/lib into the
tests and examples so that the dynamic loader finds the lib
even w/o it being in LD_LIBRARY_PATH. It doesn't look like
there is an equivalent option in the Microsoft linker:
http://msdn2.microsoft.com/en-us/library/y0zzbyt4(VS.80).aspx
so copying the DLL or setting PATH are the only available
options. I wonder if there is a way to programmatically set
PATH in the IDE, either when the solution is loaded or when
a project is run.


I found that if I enabled the option when generating the solution it
added a post-build rule to copy the dlls into the executable directory,
but the post-build step always failed to copy the rwtest.dll into place.

That's not good, although I wonder how come it works in automated
builds. I suspect we'll need to get Farid to look into what's going
on here.

Martin

Here is a paste of the post-build rule. I've added the 'echo' lines to
expose the problem that I was seeing

  echo copying $(SolutionDir)15d\lib\libstd15d.dll to
$(OutDir)\libstd15d.dll
  if exist "$(SolutionDir)15d\lib\libstd15d.dll" (
    del "$(OutDir)\libstd15d.dll"
    copy /Y "$(SolutionDir)15d\lib\libstd15d.dll"
"$(OutDir)\libstd15d.dll"
  )

  echo copying $(SolutionDir)15d\tests\rwtest.dll to
$(OutDir)\rwtest.dll
  if exist "$(SolutionDir)15d\tests\rwtest.dll" (
    del "$(OutDir)\rwtest.dll"
    copy /Y "$(SolutionDir)15d\tests\rwtest.dll" "$(OutDir)\rwtest.dll"
  )

Here is the output when attempt to build/run the 0.inputiter test after
building the .rwtest project.

  Performing Post-Build Event...
  copying C:\build\stdcxx\win32.vc8x\msvc-8.0\15d\lib\libstd15d.dll to
C:\build\stdcxx\win32.vc8x\msvc-8.0\15d\tests\libstd15d.dll
        1 file(s) copied.
  copying C:\build\stdcxx\win32.vc8x\msvc-8.0\15d\tests\rwtest.dll to
C:\build\stdcxx\win32.vc8x\msvc-8.0\15d\tests\rwtest.dll
  The system cannot find the file specified.

The output that I get indicates that '$(SolutionDir)\15d\tests' is the
same as '$(OutDir)'. So the post build rule is actually deleting the
rwtest.dll and then trying to copy the deleted file. Maybe the
projects.js script should be updated to print the names of the files
that are being manipulated and avoid deleting the destination file if it
is the same as the source.

Travis

-----Original Message-----
From: Martin Sebor [mailto:[EMAIL PROTECTED] Sent: Friday, August 03, 2007 12:22 PM
To: stdcxx-dev@incubator.apache.org
Subject: running tests linked with stdcxx.dll on Windows

When I try to run stdcxx tests linked against the stdcxx.dll
using the msvc-8.0_tst.sln solution on Windows I get an error
from the loader that the DLL isn't in PATH.
Is there something special I need to do to make this work?
I expected the project/solution to automatically set things
like this up for me.

Thanks
Martin


Reply via email to