Building LWJGL win32 with the MS free cmd line compiler

Started by elias, May 10, 2004, 13:21:35

Previous topic - Next topic

elias

Hi,

I managed to compile the LWJGL win32 part with the free MS command line compiler/linker. Here's what I did:

1. Fetched the tools from

http://msdn.microsoft.com/visualc/vctoolkit2003/

2. Fetched the Platform SDK update from

http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

3. Fetched the DirectX SDK from

http://www.microsoft.com/downloads/details.aspx?FamilyID=1d97f320-9dfd-4e7a-b947-3a037ccf84af&displaylang=en

4. Installed everything
5. Put this batch file into src/native/win32:

@echo off

set JAVAHOME=f:\j2sdk1.4.2_02
set ALHOME="F:\Program Files\OpenAL 1.0 Software Development Kit"
set EAXHOME="F:\Program Files\Creative Labs\EAX 2.0 Extensions SDK"
set DXHOME=f:\DXSDK
set COPTIONS=/I%DXHOME%\Include /I%JAVAHOME%\include /I%JAVAHOME%\include\win32 /I%ALHOME%\Include /I%EAXHOME%\Include /I..\common /O2 /nologo /c
set LINKEROPTS=/link /LIBPATH:%ALHOME%\libs /LIBPATH:%EAXHOME%\Libs /LIBPATH:%DXHOME%\Lib
set LIBS=dinput.lib dxguid.lib OpenAL32.lib alut.lib eaxguid.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib

for %%x in (*.cpp) do cl %COPTIONS% %%x
for %%x in (..\common\*.cpp) do cl %COPTIONS% %%x
for %%x in (..\common\arb\*.cpp) do cl %COPTIONS% %%x
for %%x in (..\common\nv\*.cpp) do cl %COPTIONS% %%x
for %%x in (..\common\ext\*.cpp) do cl %COPTIONS% %%x
for %%x in (..\common\ati\*.cpp) do cl %COPTIONS% %%x

cl /LD /Felwjgl.dll *.obj %LINKEROPTS% %LIBS%


6. Run it

- elias

princec

Nice one. Perhaps you can commit it into platform_build and add a comment to the Wiki?

Cas :)

Matzon

speaking of platform build - is there anyway we could get the makefile stuff out of src/native and into platform_build? Sure I know I am being anal about it, I just have this weird obsession about a clean directory structure  :twisted:


Morgrog

Sticky?

or maybe link it in the wiki?

so, uh sticky/wiki  :oops:


(cuz this is fun information for those CVS, latest release guys) :D

CaptainJester

Been trying to get this to work.  I am sure I have it set up right, but I am still getting errors.

Here is a sample from the commands that are being performed:
F:\Apps\Java\eclipse\workspace\LWJGL\platform_build\win32_ms_cmdline>cl "/IF:\Apps\DXSDK\include /IF:\Apps\Microsoft Visual C++ Toolkit 2003\include /IF:\Apps\Microsoft SDK\include /IF:\Apps\Java\j2sdk1.4.2_04\include /IF:\Apps\Java\j2sdk1.4.2_04\include\win32 /IF:\Apps\Creative Labs\OpenAL 1.0 SDK\include /IF:\Apps\Creative Labs\EAX 2.0 Extensions SDK\include /I..\..\src\native\common /O2 /nologo /c" ..\..\src\native\win32\org_lwjgl_Sys.cpp


and here is the error:

org_lwjgl_Sys.cpp
f:\Apps\Java\eclipse\workspace\LWJGL\src\native\win32\Window.h(51) : fatal error
 C1083: Cannot open include file: 'windows.h': No such file or directory


I don't know why it can't find it, because /IF:\Apps\Microsoft SDK\include points to it.

Any suggestions?
The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities.  We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)
8)

Matzon

that should probably be:
/I"F:\Apps\Microsoft SDK\include"
you have spaces in the path.

CaptainJester

I had put quotes around the whole thing.  I will try putting quotes around the individual entries to see if that works.

Thanks.
The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities.  We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)
8)

Matzon

you should only put it on the items so that it becomes:
F:\Apps\Java\eclipse\workspace\LWJGL\platform_build\win32_ms_cmdline>cl /I"F:\Apps\DXSDK\include" /I"F:\Apps\Microsoft Visual C++ Toolkit 2003\include" /I"F:\Apps\Microsoft SDK\include" /I"F:\Apps\Java\j2sdk1.4.2_04\include" /I"F:\Apps\Java\j2sdk1.4.2_04\include\win32" /I"F:\Apps\Creative Labs\OpenAL 1.0 SDK\include" /I"F:\Apps\Creative Labs\EAX 2.0 Extensions SDK\include" /I"..\..\src\native\common" /O2 /nologo /c ..\..\src\native\win32\org_lwjgl_Sys.cpp


but you should be able to just use the buildscript, and set the paths with ""s
this is my script:
@echo off

set JAVAHOME="C:\Java\jdk1.5.0"
set ALHOME="c:\Program Files\OpenAL 1.0 Software Development Kit"
set EAXHOME="c:\Program Files\Creative Labs\EAX 2.0 Extensions SDK"
set DXHOME="C:\Program Files\DX90SDK"
set PLTSDKHOME="C:\Program Files\Microsoft SDK"
set COPTIONS=/I%DXHOME%\Include /I%PLTSDKHOME%\include /I%JAVAHOME%\include /I%JAVAHOME%\include\win32 /I%ALHOME%\Include /I%EAXHOME%\Include /I..\..\src\native\common /O2 /nologo /c
set LINKEROPTS=/link /LIBPATH:%ALHOME%\libs /LIBPATH:%EAXHOME%\Libs /LIBPATH:%DXHOME%\Lib /LIBPATH:%PLTSDKHOME%\Lib
set LIBS=dinput.lib dxguid.lib OpenAL32.lib alut.lib eaxguid.lib OpenGL32.Lib Version.lib user32.lib Gdi32.lib Advapi32.lib

for %%x in (..\..\src\native\win32\*.cpp) do cl %COPTIONS% %%x
for %%x in (..\..\src\native\common\*.c) do cl %COPTIONS% %%x
for %%x in (..\..\src\native\common\arb\*.c) do cl %COPTIONS% %%x
for %%x in (..\..\src\native\common\nv\*.c) do cl %COPTIONS% %%x
for %%x in (..\..\src\native\common\ext\*.c) do cl %COPTIONS% %%x
for %%x in (..\..\src\native\common\ati\*.c) do cl %COPTIONS% %%x

cl /LD /Felwjgl.dll *.obj %LINKEROPTS% %LIBS%

del *.obj *.exp *.lib
copy lwjgl.dll ..\..\libs\

Matzon


CaptainJester

Quote from: "Matzon"you could also try to use
http://lab.msdn.microsoft.com/express/visualc/default.aspx
but it has a even more complex setup :/

No the other thing was the problem.  You would think Microsoft's own compiler could handle long file names without quotes.  I guess that is just the nature of the legacy of DOS.

Thanks.
The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities.  We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)
8)

CaptainJester

The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities.  We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)
8)

Matzon

should only need fmod if you build the fmod binding?