vircon32 / ConsoleSoftware

General repository for all code (games, BIOS, etc) that runs within the Vircon32 console itself
http://www.vircon32.com
Other
35 stars 3 forks source link

i dont understand this compiler error #1

Closed r-gt closed 2 years ago

r-gt commented 2 years ago

the compiler just returns: main.c:1:10: fatal error: expected file path string and I don't understand where is the problem

vircon32 commented 2 years ago

Hi, I can't see your code but I suspect you are trying to write a game and you have an #include with brackets. You should change: #include <header> into: #include "header" instead.

This happens because the current C compiler has some limitations, and the C language used in Vircon32 has a few differences with the standard C. You can read the full details here: C compiler guide

Another easy option to get used to it is to just follow the code in the examples and tutorials.

r-gt commented 2 years ago

Hi, I can't see your code but I suspect you are trying to write a game and you have an #include with brackets. You should change: #include <header> into: #include "header" instead.

This happens because the current C compiler has some limitations, and the C language used in Vircon32 has a few differences with the standard C. You can read the full details here: C compiler guide

Another easy option to get used to it is to just follow the code in the examples and tutorials.

I'm sure it's a compiler issue, because the code is the video, audio, and gamepad headers and the void main(void) {}

vircon32 commented 2 years ago

Can you show me the full code? I will need it to be able to help you.

r-gt commented 2 years ago

The Command: compile main.c -o obj\main.asm

The Code:

#include "video.h"
#include "time.h"
#include "input.h"

void main(void){

}
vircon32 commented 2 years ago

I have pasted your code into a new file, and it compiles fine for me. However, a couple of things can be wrong with that command:

  1. The order of parameters is wrong. If you see the program's help (compile --help) you can see that it should be: compile -o obj\main.asm main.c. Options come before the input file.
  2. Even with the right order, the command will only work if obj\ directory already existed. The compiler will not create output folders.

In any case, I'm not getting the error message at line 1 that you got before. I hope this helps you!

r-gt commented 2 years ago

I have pasted your code into a new file, and it compiles fine for me. However, a couple of things can be wrong with that command:

  1. The order of parameters is wrong. If you see the program's help (compile --help) you can see that it should be: compile -o obj\main.asm main.c. Options come before the input file.
  2. Even with the right order, the command will only work if obj\ directory already existed. The compiler will not create output folders.

In any case, I'm not getting the error message at line 1 that you got before. I hope this helps you!

that was the problem thanks!

apsz3 commented 9 months ago

@vircon32 Hi, I didn't want to open a new issue for this, but wanted some way to contact you (I didn't find an email, or Discord, on your home page. Apologies if I missed it):

This project is absolutely incredible! I am so glad I found it. It's BY FAR the most interesting and well-developed fantasy console I've found. I really appreciate the design decision you made for Vircon32 to go beyond the common micro-resource limitations of most fantasy consoles. I love the extent to which you've documented the system with care. Your commitment to Open Source, and activity on this project, is very inspiring. I think Vircon32 has enormous potential.

I'm interested in programming languages and compilers, and have been looking for a fantasy architecture to target for a new toy language. (Working with a novel CPU, without the difficulties of using a real ISA, I hope will be a good learning exercise for me -- and I find it more exciting than developing a GPL for something like WASM or LLVM, or the contrived ones used in some books.) Chip-8 was a candidate, but Vircon32's architecture is more pragmatic.

So, a few things. I think I'd like to work on your compiler, to see if I can apply some optimizations to it (as a learning exercise). I'm also interested in developing a higher-level language, that interops with Vircon32 C, similar to Lua <-> C. (Have you planned for anything like that?) It'd be great if I had some way to contact you for more casual discussions and questions -- are you open to that?

vircon32 commented 9 months ago

Hello @apsz3 . I'm glad you like Vircon32! You can find me at the Fantasy Consoles 2.0 Discord server, I have a Vircon32 channel there. You can join using this link: https://discord.gg/jcT9CXDgHB . If you speak Spanish you can also find me at MediaVida gamedev forums.

We can talk there since this is not the place, but about the current compiler: I'm not planning to update it too much. It does not really need optimizations (it is fast enough) and, since it is complex and I have to maintain it, it's better to keep it as stable as possible. You can of course make your own modified version, or make your own compiler/tools if you'd like! Having compilers for other languages would be very useful.