c3lang / c3c

Compiler for the C3 language
GNU Lesser General Public License v3.0
1.34k stars 80 forks source link

Cannot compile to exe file. #1201

Open HongChenLuYuan opened 1 month ago

HongChenLuYuan commented 1 month ago

I can't compile source files into ".exe" executable files in windows, it just generates many ".obj" files.

lerno commented 1 month ago

How do you invoke the compiler?

HongChenLuYuan commented 1 month ago

I use the "init" command to generate a project, and then run the "c3c build" command, which generates many ".obj" files, but no ".exe" executable files. Then I found the "main.c3" file and executed "c3c compile main.c3", but still only generated many ".obj" files.

It looks like this. What should I do? 1 2

lerno commented 1 month ago

Hmm.. let's add some logs and see try adding --print-linking and --debug-log. Because what you're seeing is that it fails to link. One possibility is that the compiler does something bad when it invokes the linker and the object files are in a different drive from the compiler. Another possibility is that you didn't download the msvc libs for linking, but that should have created an error.

HongChenLuYuan commented 1 month ago

I added --print-linking and --debug-log. but it only outputs INFO log without any error message. I think I should give up trying it.

lerno commented 1 month ago

Can you provide me with the output you get?

lerno commented 1 month ago

This may be related to #1167

lerno commented 3 weeks ago

This might have been improved in dev, but it's hard to tell without testers.

lerno commented 2 weeks ago

Please try 0.6.0

HongChenLuYuan commented 1 week ago

Please try 0.6.0

It can work. Please forgive me for not executing "msvc_build_libraries.py", I didn't know it was necessary.

lerno commented 1 week ago

Did it work only after running the python script?