[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] [Bulk] How to link...? (Restated, with full code thi
From: |
Lostgallifreyan |
Subject: |
Re: [Tinycc-devel] [Bulk] How to link...? (Restated, with full code this time) |
Date: |
Tue, 14 Feb 2012 17:42:56 -0000 |
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib,"libwinmm.a")
HMIDIOUT H_device;
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR
lpCmdLine,int nCmdShow)
{
BYTE A[4]={0x90,61,78,0};
midiOutOpen(&H_device,(UINT)-1,0,0,CALLBACK_NULL);
midiOutShortMsg(H_device,*(DWORD*)A);
Sleep(1000);
A[2]=0;
midiOutShortMsg(H_device,*(DWORD*)A);
midiOutClose(H_device);
return 0;
}
DOS Batch file:
@ECHO OFF
PATH=%PATH%;E:\CODING\TCC
TCC.EXE C:\WINDOWS\DESKTOP\TEST\TEST2.c -LE:\Coding\tcc\lib\libwinmm.a
-oC:\WINDOWS\DESKTOP\TEST\TEST.exe
This fails with undefined-symbol errors, even though libwinmm.a is provided,
copied from GCC. Why? GCC will link libwinmm.a and compile this code, and it
runs ok.
Also, is that #pragma line needed? GCC doesn't need it, but plenty of coders
seem to think it's required.
Please help. I really want to use TCC for this as first choice, as I like it
best out of all compilers I have tried.