-4

I am trying to compile some C code (generated from python using cpython), and I'm getting the C1083 error saying the file doesn't exist.

structmember.h is actually in the same folder as the C file, and is also in its include folder in case it was looking there instead, so I've no idea how to fix it. I'm attempting to generate the file by using cl test.c.

Here's the entire output:

C:\test>cl test.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.10.25019 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

test.c
test.c(1018): fatal error C1083: Cannot open include file: 'structmember.h': No such file or directory

Here's a shot from the folder: enter image description here

Here is the code around each mention of structmember (took screenshots as coping a full page of text probably isn't useful):

enter image description here

enter image description here

If anyone would like to have a glance at the file, it's on onedrive here, a little too large for pastebin.

Peter
  • 3,186
  • 3
  • 26
  • 59
  • How do you include this file? – Michael Jun 24 '17 at 15:28
  • It's generated code with Cython and about 50k lines, I'll edit the post the code around each include – Peter Jun 24 '17 at 15:29
  • Added some shots of where it's included – Peter Jun 24 '17 at 15:37
  • 1
    Why is your file to include in angle brackets <>? Include it in quotes. – Michael Jun 24 '17 at 15:38
  • I personally aren't aware of the C syntax and was relying on the generated code, but thanks, that appeared to work. The script itself appears to be horribly broken by the conversion, but at least it complies, cheers :) – Peter Jun 24 '17 at 15:42

1 Answers1

2

Microsoft compilers will not look in the cpp folder when using the #include <> form.

Change your include statement to the correct form for including a 'local' header.

#include "structmember.h"
Michaël Roy
  • 6,338
  • 1
  • 15
  • 19
  • Yeah cheers, I don't suppose you'd know why it happened to use <> instead of quotes? Seems a weird bug when it's something so simple – Peter Jun 24 '17 at 18:23
  • It happens quite often... Most other compilers do implicitly include the local folder in the include path... This is afaik a peculiarity of Microsoft. – Michaël Roy Jun 24 '17 at 18:26