hi guys,
i have installed "VS2008" and later "DX9 SDK Nov2008" because i would like to restart learning C/CPP and trying to code my second 1k intro (DX9 based).
However, i have d/l the "1K_DX9_FrameWork_VC2005.zip" by rbz and tried to open the "vcproj" file which open VS2008... Sadly VS2008 will convert something to be compatible with VS2008 if i understand right... Converting the source without errors/problems seems not to work... and i dont manage it to compile the CPP file in any way...
However i have tried to create a new empty project and pasted the CPP source into the new project CPP file... cant compile... (i have to learn a lot about how to work and use VS IDE instead simple BlitzBasic, PB IDE ^^)
If someone can help me how to get the 1k DX framework work with VS2008, it would be very nice! Thanks in advance!
Hey va!n,
after you converted the project and try to run/debug it (F5) -
what are the exact error messages you got ? Think those might
help to find the error.
Greetz,
benny!
@benny:
sure, here is the build protocol (sorry, i am using german version of VS2008)
Buildprotokoll Erstellen wurde gestartet: Projekt: "Tiny_DX9", Konfiguration: "Debug|Win32"
Befehlszeilen Die temporäre Datei "d:\_Coding_CPP\Debug\RSP0000017961564.rsp" wird erstellt. Inhalt:
[
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_VC80_UPGRADE=0x0600" /D "_MBCS" /Gm /EHsc /RTC1 /MTd /Fp".\Debug/Tiny_DX9.pch" /Fo".\Debug/" /Fd".\Debug/" /W3 /c /ZI /TP .\Main.cpp
]Erstellen der Befehlszeile "cl.exe @d:\_Coding_CPP\Debug\RSP0000017961564.rsp /nologo /errorReport:prompt"Die temporäre Datei "d:\_Coding_CPP\Debug\TMP0000027961564.tmp" wird erstellt. Inhalt:
[
1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ ".\\Debug\\Tiny_DX9.exe.embed.manifest"
]Erstellen der Befehlszeile "rc.exe /fo".\Debug\Tiny_DX9.exe.embed.manifest.res" d:\_Coding_CPP\Debug\TMP0000027961564.tmp"
Die temporäre Datei "d:\_Coding_CPP\Debug\RSP0000037961564.rsp" wird erstellt. Inhalt:
[
/OUT:".\Debug/Tiny_DX9.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:".\Debug\Tiny_DX9.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:".\Debug/Tiny_DX9.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO /MACHINE:X86 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\Debug\Main.obj"
".\Debug\Tiny_DX9.exe.embed.manifest.res"
]Erstellen der Befehlszeile "link.exe @d:\_Coding_CPP\Debug\RSP0000037961564.rsp /NOLOGO /ERRORREPORT:PROMPT" Ausgabefenster Kompilieren...
Main.cpp
Manifest in Ressourcen wird kompiliert...
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
Copyright (C) Microsoft Corporation. All rights reserved.
Verknüpfen...
Main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_Direct3DCreate9@4" in Funktion ""void __cdecl WinMainCRTStartup(void)" (?WinMainCRTStartup@@YAXXZ)".
LIBCMTD.lib(wincrt0.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_WinMain@16" in Funktion "___tmainCRTStartup".
.\Debug/Tiny_DX9.exe : fatal error LNK1120: 2 nicht aufgelöste externe Verweise.
Ergebnisse Das Buildprotokoll wurde unter "file://d:\_Coding_CPP\Debug\BuildLog.htm" gespeichert.
Tiny_DX9 - 3 Fehler, 0 Warnung(en)
Quoteerror Verweis auf nicht aufgelöstes externes Symbol "_Direct3DCreate9@4" in Funktion
Direct3DCreate9 ist part of the d3d9.lib, so add it (and probably d3dx9.lib, too) to your project:
Projekteigenschaften->Konfigurationseigenschaften->Linker->Eingabe->Zusaetzliche Abhaengigkeiten.
Quoteerror LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_WinMain@16"
The default-library internally call your "main" or "WinMain" (depending on having a console- or windows-application) function, but you don't want to use them for size-reasons.
So, again in the linker-settings, set "Standardbibliotheken ignorieren".
Also make sure to select "release"-build.
German compilers are totally gay ;)
@hellfire:
thanks for the help and the good step by step description... i changed all the things but now i have just only 1 error (cant find the d3d9.lib, which is still available on the hd, due fact of DX9 SDK (Nov08) installation...
Btw, adding the D3D9.lib and d3dx9.lib to the project looks like: "d3d9.lib; d3dx9.lib" instead just "d3d9.lib d3d9x.lib" (mit ";" getrennt ja?)
Buildprotokoll Erstellen wurde gestartet: Projekt: "Tiny_DX9", Konfiguration: "Debug|Win32"
Befehlszeilen Die temporäre Datei "d:\_Coding_CPP\Debug\RSP0000042012992.rsp" wird erstellt. Inhalt:
[
/Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_VC80_UPGRADE=0x0600" /D "_MBCS" /Gm /EHsc /RTC1 /MTd /Fp".\Debug/Tiny_DX9.pch" /Fo".\Debug/" /Fd".\Debug/" /W3 /c /ZI /TP .\Main.cpp
]Erstellen der Befehlszeile "cl.exe @d:\_Coding_CPP\Debug\RSP0000042012992.rsp /nologo /errorReport:prompt"Die temporäre Datei "d:\_Coding_CPP\Debug\RSP0000052012992.rsp" wird erstellt. Inhalt:
[
/OUT:".\Debug/Tiny_DX9.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:".\Debug\Tiny_DX9.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB /DEBUG /PDB:".\Debug/Tiny_DX9.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO /MACHINE:X86 d3d9.lib, d3dx9.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\Debug\Main.obj"
".\Debug\Tiny_DX9.exe.embed.manifest.res"
]Erstellen der Befehlszeile "link.exe @d:\_Coding_CPP\Debug\RSP0000052012992.rsp /NOLOGO /ERRORREPORT:PROMPT" Ausgabefenster Kompilieren...
Main.cpp
Verknüpfen...
LINK : fatal error LNK1104: Datei "d3d9.lib," kann nicht geöffnet werden.
Ergebnisse Das Buildprotokoll wurde unter "file://d:\_Coding_CPP\Debug\BuildLog.htm" gespeichert.
Tiny_DX9 - 1 Fehler, 0 Warnung(en)
QuoteQuotefatal error: Datei "d3d9.lib," kann nicht geöffnet werden.
"d3d9.lib; d3dx9.lib" instead just "d3d9.lib d3d9x.lib" (mit ";" getrennt ja?)
Just use blank as separator for libs.
As you can see the linker interprets "," as part of the library-name.
Include-Directories (in the C++-Settings) are divided by semicolon though ;)
Since the compiler seems to find the dx9-headers, I believe the sdk-installer already added all relevant paths to the vs-settings.
If not you still have to set the dx9-lib-path for the linker.
Either set it for this project only:
In Projekteigenschaften->Konfigurationseigenschaften->Linker->Allgemein: "Zusaetzliche Bibliotheksverzeichnisse" add WhereeverYouInstalledYourSDK\lib\x86
Or globally:
In Extras->Optionen select in the tree on the left "Projekte und Projektmappen->VC++-Verzeichnisse", on the right "Verzeichnisse anzeigen fuer: Bibliotheksdateien" and add the same path.
ah ok... havent noticed it... becuase i tried to use "," and ";" without success..
now i changed to use only spaces and having 5 errros :P
Buildprotokoll Erstellen wurde gestartet: Projekt: "Tiny_DX9", Konfiguration: "Debug|Win32"
Befehlszeilen Die temporäre Datei "d:\_Coding_CPP\Debug\RSP0000072012304.rsp" wird erstellt. Inhalt:
[
/OUT:".\Debug/Tiny_DX9.exe" /INCREMENTAL /MANIFEST /MANIFESTFILE:".\Debug\Tiny_DX9.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB /DEBUG /PDB:".\Debug/Tiny_DX9.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE:NO /MACHINE:X86 d3d9.lib d3dx9.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
".\Debug\Main.obj"
".\Debug\Tiny_DX9.exe.embed.manifest.res"
]Erstellen der Befehlszeile "link.exe @d:\_Coding_CPP\Debug\RSP0000072012304.rsp /NOLOGO /ERRORREPORT:PROMPT" Ausgabefenster Verknüpfen...
Main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "@_RTC_CheckStackVars@8" in Funktion ""void __cdecl WinMainCRTStartup(void)" (?WinMainCRTStartup@@YAXXZ)".
Main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "__RTC_CheckEsp" in Funktion ""void __cdecl WinMainCRTStartup(void)" (?WinMainCRTStartup@@YAXXZ)".
Main.obj : error LNK2001: Nicht aufgelöstes externes Symbol "__RTC_Shutdown".
Main.obj : error LNK2001: Nicht aufgelöstes externes Symbol "__RTC_InitBase".
.\Debug/Tiny_DX9.exe : fatal error LNK1120: 4 nicht aufgelöste externe Verweise.
Ergebnisse Das Buildprotokoll wurde unter "file://d:\_Coding_CPP\Debug\BuildLog.htm" gespeichert.
Tiny_DX9 - 5 Fehler, 0 Warnung(en)
Quoteerror: Verweis auf nicht aufgelöstes externes Symbol:
"@_RTC_CheckStackVars"
"__RTC_CheckEsp"
"__RTC_Shutdown"
"__RTC_InitBase".
Disable runtime-checks (RTC) in "Projekteigenschaften->Konfigurationseigenschaften->C/C++->Codegenerierung->Vollstaendige Laufzeitueberpruefung" because this requires a couple of functions from the default libs (which you don't use).
And also disable everything else that sounds like more work ;)
@hellfire:
thanks a lot for all your tips and help. K++ Now i can compile the empty 1k DX9 framework to an exe around 12 kb...
Now i can try to google the web how to add following things using DX9:
- Drawing 2D Text (load/use specfic font)
- Drawing ColorGradient Background (as texture or what ever is possible and tiny in code ^^)
This is what i want to have for the background gradient: (i think it can be possible by creating a rect and color its edges!? we will see... now i will start searching the web for how to realise this two points. Thanks!
For x = 0 To 640-1
For y = 0 To 480-1
Plot (x,y, RGB(x/3.0, 127, y/2.0))
Next
Next