You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2007/08/03 21:22:10 UTC

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

RE: running tests linked with stdcxx.dll on Windows

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Saturday, August 04, 2007 3:06 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: running tests linked with stdcxx.dll on Windows
> 
> 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.

  In automated builds the any dll's aren't copied, but lib path is
added to PATH environment variable before running the exec utility.

Farid.

Re: running tests linked with stdcxx.dll on Windows

Posted by Martin Sebor <se...@roguewave.com>.
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:sebor@roguewave.com] 
>> 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
>>


RE: running tests linked with stdcxx.dll on Windows

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Travis Vitek [mailto:tvitek@quovadx.com] 
> Sent: Saturday, August 04, 2007 1:07 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: RE: running tests linked with stdcxx.dll on Windows
> 
> 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.

  Fixed: http://svn.apache.org/viewvc?view=rev&rev=563498

Farid.

RE: running tests linked with stdcxx.dll on Windows

Posted by Travis Vitek <tv...@quovadx.com>.
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.

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.
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:sebor@roguewave.com] 
>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
>

RE: running tests linked with stdcxx.dll on Windows

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Tuesday, August 07, 2007 6:11 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: running tests linked with stdcxx.dll on Windows
> 
> >   In MSVC8 you can manually set the environment variables in
> > Properties->Configuration Properties->Debugging->Environment.
> > 
> >   Or, as already mentioned Travis, use /COPYDLL option.
> 
> Isn't there a way to set it automatically when generating the 
> solution? This seems like a familiar discussion -- I suspect 
> we had it before and your answer was no... Still, it's 
> strange that there would be no way to run a project that 
> links against a DLL created by another project in the same 
> solution. We can't be the only ones doing it.

  Unfortunately, no :(

  The MSVC8 has "references to other projects". So .rwtest and examples
are referenced
to .stdcxx project. All tests are referenced to .rwtest and .stdcxx
projects. The reference
has the following build properties: Copy Local, Copy Local Dependencies
and so on.
All of these properties are set to True, but MSVC still doesn't copies
the dependencies
for C++ projects (but does that for C# projects).

Farid.

Re: running tests linked with stdcxx.dll on Windows

Posted by Martin Sebor <se...@roguewave.com>.
Farid Zaripov wrote:
>> -----Original Message-----
>> From: Martin Sebor [mailto:sebor@roguewave.com] 
>> Sent: Friday, August 03, 2007 10: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.
> 
>   In MSVC8 you can manually set the environment variables in
> Properties->Configuration Properties->Debugging->Environment.
> 
>   Or, as already mentioned Travis, use /COPYDLL option.

Isn't there a way to set it automatically when generating
the solution? This seems like a familiar discussion -- I
suspect we had it before and your answer was no... Still,
it's strange that there would be no way to run a project
that links against a DLL created by another project in
the same solution. We can't be the only ones doing it.

Martin

RE: running tests linked with stdcxx.dll on Windows

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Friday, August 03, 2007 10: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.

  In MSVC8 you can manually set the environment variables in
Properties->Configuration Properties->Debugging->Environment.

  Or, as already mentioned Travis, use /COPYDLL option.

Farid.