www.digitalmars.com         C & C++   DMDScript  

c++.windows.32-bits - stopping inclusion of windows' libs

reply "Alan" <alan surfbest.net> writes:
c:\dm\bin\dmc union1.cpp -Ic:\dm\stlport\stlport c:\dm\lib\stlp45dm_static.lib
link union1,,,c:\dm\lib\stlp45dm_static+user32+kernel32/noi;

I don't want user32 and kernel32 linked in for this Dos-Box program (system:
Win2k Pro SP4)

#include <iostream>
using namespace std;

typedef unsigned char byte;
typedef unsigned long int32;

union converter {
 byte  b[4];
 int32 i;
};

int main() {

   converter c;

   c.b[3] = (byte) 0x12;
   c.b[2] = (byte) 0x34;
   c.b[1] = (byte) 0x56;
   c.b[0] = (byte) 0x78;

   int32 r = c.i;
   cout << "r = " << hex << r << endl;
}

// results
// r = 0x12345678
Dec 24 2004
parent reply "Alan" <alan surfbest.net> writes:
"Alan" <alan surfbest.net> wrote in message
news:cqhb2l$314f$1 digitaldaemon.com...
 c:\dm\bin\dmc union1.cpp -Ic:\dm\stlport\stlport c:\dm\lib\stlp45dm_static.lib
 link union1,,,c:\dm\lib\stlp45dm_static+user32+kernel32/noi;

 I don't want user32 and kernel32 linked in for this Dos-Box program (system:
 Win2k Pro SP4)
[snip] Problem solved.
Dec 26 2004
parent Anuj Goyal <Anuj_member pathlink.com> writes:
how? 

"Alan" <alan surfbest.net> wrote in message
news:cqhb2l$314f$1 digitaldaemon.com...
 c:\dm\bin\dmc union1.cpp -Ic:\dm\stlport\stlport c:\dm\lib\stlp45dm_static.lib
 link union1,,,c:\dm\lib\stlp45dm_static+user32+kernel32/noi;

 I don't want user32 and kernel32 linked in for this Dos-Box program (system:
 Win2k Pro SP4)
[snip] Problem solved.
Dec 30 2004