[cfe-dev] clang::FileManager -> getFile returns NULL on Windows Visual Studio ### On Linux everything works fine

Nikola Smiljanic popizdeh at gmail.com
Sun Dec 11 04:59:58 PST 2011


I think that you problem is due to Clang's assumption that all paths are in
UTF8 and that's not true for Windows, try converting your argv[1] to UTF8
and see if it helps.

On Sun, Dec 11, 2011 at 12:03 PM, Peter <clang_llvm_123-4 at yahoo.de> wrote:

> Hi everybody,
>
> I just started hacking on a small command line tool and
> when I try to get a file with the following code it always gives
> me an empty address.
>
> main.exe c:\test.c
>
> The same code compiled and running on linux works just fine.
>
> int main (int argc, char **argv)
> {
>     int ret = 0;
>
>    clang::FileManager *fm = new
> clang::FileManager(clang::FileSystemOptions());
>    const clang::FileEntry* file = fm->getFile(llvm::StringRef(argv[1]));
>
>
>     return(ret);
> }
>
> Is it a bug? I hope anybody can help me?
>
> Thanks in advance,
> Peter
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111211/159487f7/attachment.html>


More information about the cfe-dev mailing list