1

When I try to compile a simple GLFW program with TCC, I get an error in the gl.h header.

The command I'm using for the compile is

tcc -L./ -lglfw3 -Iglfw/include main.c

Here's the full output of this command

>tcc -L./ -lglfw3 -Iglfw/include main.c
In file included from main.c:1:
In file included from glfw/include/GLFW/glfw3.h:153:
c:/tcc/include/GL/gl.h:1152: error: declaration for parameter '__stdcall' but no such parameter

And here's the simple program I'm trying to compile

#include <GLFW/glfw3.h>

int main()
{
    glfwInit();
    glfwTerminate();
}

Am I linking something wrong? Or not linking something I'm supposed to be linking? What's wrong with my compile parameters?

  • 3
    TCC (which doesn't seem to be maintained anymore) seems to not support the __stdcall syntax that GLFW is trying to use. – Colonel Thirty Two Jan 11 '16 at 00:42
  • I found something about using stdcall with TCC here http://bellard.org/tcc/tcc-doc.html#IDX6 And more info here https://lists.gnu.org/archive/html/tinycc-devel/2016-01/msg00037.html – Chad Zawistowski Apr 19 '16 at 21:08

1 Answers1

0

I had the exact same problem as you, I had to include the windows.h file before GLFW to fix it I managed to compile and run this program. Program code

I had to create a .def file for the glfw3.dll and link against it, I also had to put the dll in the same folder as the compiled exe to run the program.

Box Box Box Box
  • 5,094
  • 10
  • 49
  • 67