Advice on which C to hang one's hat.
What do you mean with "based on..."?Moonshine wrote:Max.²: Ive downloaded that already (despite having no C/C++ knowledge) but is it all based on the .net framework or what?
You can compile also regular C and C++ sourcecodes and can run the compiled stuff on computers with no framework installed or even create PB Userlibs with it, if that is what you mean.
I used this batch for example to make a PB lib:
Code: Select all
cl -W1 -Gz -Ze /O2 /Ox /J /G7 /arch:SSE2 /Fosourcecode.obj /c sourcecode.c
pause
c:\programme\PellesC\bin\polib /machine:ix86 sourcecode.obj another.obj -out:Lib\purebasic.lib
pause
Last edited by Max.² on Sun Oct 17, 2004 11:49 pm, edited 1 time in total.
-
- Enthusiast
- Posts: 384
- Joined: Sat May 24, 2003 8:02 pm
- Location: Canada
- Contact:
This is great to, the beta express 2005 editions. I find lots of bugs, but they are usually for fancy features that I couldn't care less about. The meat and potatoes are there, and they are solid.
http://lab.msdn.microsoft.com/express/
http://lab.msdn.microsoft.com/express/
<br>"I deliver Justice, not Mercy"
    - Codemonger, 2004 A.D.
    - Codemonger, 2004 A.D.
Sorry if I did confuse you but I ment the footprint of the compiler & libs... 8Othefool wrote:50+ megs footprint??
i made a 3 kb hello world with devc++
Here some example code:
Code: Select all
// minimal.c--
// Tested on Win2000
// Compiled with Sphinx C-- Compiler Version 0.239c b4 Feb 10 2003
//
// Skeleton of a minimal Win32 GUI app, written in Sphinx C--
//
// To compile, need "c--.exe" in same directory or in DOS path.
// The "#includepath" has path of the Windows header files.
// To compile, just type "c-- Minimal" -- that's it.
// INIT stuff
#pragma option w32 //create Windows GUI EXE.
#pragma option J0 //no startup code.
#pragma option dbg //create debug information (separate .tds file).
#pragma option lst //generate listing file.
#pragma option w //enable warning.
#pragma option 3 //386 CPU.
#includepath "\sphinx\lib\win"
#include "windef.h--"
#include "winbase.h--" //kernel32.dll
#include "wingdi.h--" //gdi32.dll
#include "winuser.h--" //user32.dll
#pragma option ia //no need "$" or "asm" for inline asm.
// Variables used by main()...
dword g_hinst=0;
dword g_hwnd=0;
struct WNDCLASS s1;
struct MSG s2;
dword g_hstandardbrush=0; // handle of background
char szTitleName="MINIMAL";
char szClassName="MINIMAL";
main()
{
GetModuleHandle(NULL); //startup code.
mov g_hinst,eax // /
// initialize the WndClass structure...
s1.style=CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
s1.lpfnWndProc=#WNDproc;
s1.cbClsExtra=s1.cbWndExtra=0;
s1.hInstance=g_hinst;
s1.hCursor=LoadCursorA(0,IDC_ARROW);
// Background stuff..
GetSysColorBrush(COLOR_BTNFACE); //returns brush for window background.
mov g_hstandardbrush,eax
mov s1.hbrBackground,eax //COLOR_WINDOW + 1
mov s1.lpszMenuName,#szClassName
mov s1.lpszClassName,#szClassName
RegisterClass(#s1);
test eax,eax
jnz NOT_END //end_loop //exit if eax=0.
jmp end_loop
NOT_END:
CreateWindowEx(0,#szClassName,#szTitleName,WS_OVERLAPPEDWINDOW,5,5,300,200,0,0,g_hinst,0);
test eax,eax
jz end_loop //exit if eax=0.
mov g_hwnd,eax
ShowWindow(g_hwnd,SW_SHOWNORMAL);
UpdateWindow(g_hwnd);
msg_loop:
GetMessage(#s2,0,0,0);
or eax,eax //cmp eax,0
je end_loop
TranslateMessage(#s2);
DispatchMessage(#s2);
jmp msg_loop
end_loop:
ExitProcess(s2.wParam);
}
// ..........................................................
// main callback procedure
// ..........................................................
dword WNDproc(dword hwnd,wmsg,wparam,lparam)
{
dword hdc;
dword hbrushsaved;
switch(wmsg)
{
case WM_DESTROY: //DestroyWindow() generates this.
PostQuitMessage(0);
//...main() will get this and call ExitProcess() (see above).
break;
// case WM_COMMAND:
// case WM_PAINT:
default:
DefWindowProc(hwnd,wmsg,wparam,lparam);
jmp short getout
//...note could have "return;" here but want common exit point.
}
xor eax,eax //return 0 if have processed msg here.
getout:
}
// ..........................................................
// end code
// ..........................................................
It compiles to 1536 bytes.
Also this is only one way of doing it.
Here you get the files you need (a little bit slow...):
http://c--sphinx.narod.ru/indexe.htm
There is a new forum dedicated to Sphinx C--:
http://www.xsorbit2.com/users/csphinx/index.cgi
One guy made some wxWidget libs that can be used.
A minimal example would than look like this.
Code: Select all
#pragma option w32
#includepath "..\wxCmm"
#include "wxCmm.h--"
wxFrame frame;
void wxMain()
{
frame.wxFrame(NULL, -1, "A minimal wxCmm example");
frame.Show();
}
BTW: PureBasic's minimal Window boils down nowadays to 10kb.
Have fun


I managed to get an OpenGL window (plus numerous unused functions, custom callback & message loop etc) in 6.5k.fsw wrote:BTW: PureBasic's minimal Window boils down nowadays to 10kb.
Im quite proud of my window functions, they work nicely

Mark my words, when you least expect it, your uppance will come...