Question

Summary:

1>Executing Lex for d:\usr\doxygen\src\code.cpp ...
1>flex: can't open ..\src\code.l
1>Project : error PRJ0019: A tool returned an error code from "Executing Lex for d:\usr\doxygen\src\code.cpp ..."

Details

I am compiling occasionally the sources of Doxygen (http://www.doxygen.org/) to publish its Windows binaries from SVN versions. The Visual Studio C++ 2008 (i.e. version 9) is used for the purpose. As Doxygen sources use also yacc and lex tools, the cygwin bison and flex was used succesfully in the past. It stopped to work. Namely, the flex complains it cannot find its source (as shown in the summary above). The version of flex on my computer is:

d:\>flex --version
flex 2.5.35

The VS project winbuild\Doxygen.vcproj is configured to launch flex, and the Visual Studio apparently generates a batch file for the purpose. The Build Log contains the following:

Creating temporary file "d:\usr\doxygen\winbuild\Debug\BAT00000241406084.bat" with contents
[
@echo off
flex -PcodeYY  -od:\usr\doxygen\src\code.cpp  ..\src\code.l
if errorlevel 1 goto VCReportError
goto VCEnd
:VCReportError
echo Project : error PRJ0019: A tool returned an error code from "Executing Lex for d:\usr\doxygen\src\code.cpp ..."
exit 1
:VCEnd
]
Creating command line "d:\usr\doxygen\winbuild\Debug\BAT00000241406084.bat"

When trying the command manually from command line, I can really observe the same:

d:\usr\doxygen\src>flex -PcodeYY  -od:\usr\doxygen\src\code.cpp  ..\src\code.l
flex: can't open ..\src\code.l

However, when replacing backslashes at the path to the code.l by normal slashes, it works:

d:\usr\doxygen\src>flex -PcodeYY  -od:\usr\doxygen\src\code.cpp  ../src/code.l

I am not sure if the problem with backslash vs. slash in the flex version is the newly introduced bug/feature or not. Is there a way to fix that?

Was it helpful?

Solution

I tried harder and found the reason. The cygwin actually worked for me in the past. And it still works with backslashes -- it only displays a warning about better using he POSIX paths.

The reason was, that I have installed more tools that brought more flex.exe utilities. The first is the part of the msysGit installation, and the second one is from the Ruby Development Kit. Both of them do not support backlashes in paths. The Doxygen started to compile again after renaming them.

The truth is that the GnuWin flex.exe consumes backslashes without any warning -- I am prefering it now.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top