Du bist nicht angemeldet.

Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!

Werbeanzeige

moritz31

Treue Seele

  • »moritz31« ist der Autor dieses Themas

Beiträge: 259

Wohnort: Hessen

Beruf: Student

  • Private Nachricht senden

1

09.11.2011, 21:55

Problem mit Directx und dem SDK

Hey,

ich hab so meine Porbleme mit Directx!
Neulich versucht das SDK Build June 2010 herunterzuladen, und zu installieren.
Bei der Installation wurde am Ende immer der Fehlercode S1023 angezeigt,
jedoch hat mir nichts geholfen was ich im Internet gefunden habe.
Da im Log nichts stand, dache ich mir ich versuch es einfach mal, also Includepfad in Include und libpfad in lib/x64.

Zu zusätzlichen Abhängigkeiten meine 3 libs die ich benötige hinzugefügt und den Code von Directx Tutorial.com ausgeführt

C-/C++-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
// include the basic windows header files and the Direct3D header files
#include <windows.h>
#include <windowsx.h>
#include <d3d11.h>
#include <d3dx11.h>
#include <d3dx10.h>

// include the Direct3D Library file
#pragma comment (lib, "d3d11.lib")
#pragma comment (lib, "d3dx11.lib")
#pragma comment (lib, "d3dx10.lib")

// global declarations
IDXGISwapChain *swapchain;             // the pointer to the swap chain interface
ID3D11Device *dev;                     // the pointer to our Direct3D device interface
ID3D11DeviceContext *devcon;           // the pointer to our Direct3D device context

// function prototypes
void InitD3D(HWND hWnd);    // sets up and initializes Direct3D
void CleanD3D(void);        // closes Direct3D and releases memory

// the WindowProc function prototype
LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);


// the entry point for any Windows program
int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine,
                   int nCmdShow)
{
    HWND hWnd;
    WNDCLASSEX wc;

    ZeroMemory(&wc, sizeof(WNDCLASSEX));

    wc.cbSize = sizeof(WNDCLASSEX);
    wc.style = CS_HREDRAW | CS_VREDRAW;
    wc.lpfnWndProc = WindowProc;
    wc.hInstance = hInstance;
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
    wc.lpszClassName = L"WindowClass";

    RegisterClassEx(&wc);

    RECT wr = {0, 0, 800, 600};
    AdjustWindowRect(&wr, WS_OVERLAPPEDWINDOW, FALSE);

    hWnd = CreateWindowEx(NULL,
                          L"WindowClass",
                          L"Our First Direct3D Program",
                          WS_OVERLAPPEDWINDOW,
                          300,
                          300,
                          wr.right - wr.left,
                          wr.bottom - wr.top,
                          NULL,
                          NULL,
                          hInstance,
                          NULL);

    ShowWindow(hWnd, nCmdShow);

    // set up and initialize Direct3D
    InitD3D(hWnd);

    // enter the main loop:

    MSG msg;

    while(TRUE)
    {
        if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
        {
            TranslateMessage(&msg);
            DispatchMessage(&msg);

            if(msg.message == WM_QUIT)
                break;
        }
        else
        {
            // Run game code here
            // ...
            // ...
        }
    }

    // clean up DirectX and COM
    CleanD3D();

    return msg.wParam;
}


// this is the main message handler for the program
LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch(message)
    {
        case WM_DESTROY:
            {
                PostQuitMessage(0);
                return 0;
            } break;
    }

    return DefWindowProc (hWnd, message, wParam, lParam);
}


// this function initializes and prepares Direct3D for use
void InitD3D(HWND hWnd)
{
    // create a struct to hold information about the swap chain
    DXGI_SWAP_CHAIN_DESC scd;

    // clear out the struct for use
    ZeroMemory(&scd, sizeof(DXGI_SWAP_CHAIN_DESC));

    // fill the swap chain description struct
    scd.BufferCount = 1;                                    // one back buffer
    scd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;     // use 32-bit color
    scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;      // how swap chain is to be used
    scd.OutputWindow = hWnd;                                // the window to be used
    scd.SampleDesc.Count = 4;                               // how many multisamples
    scd.Windowed = TRUE;                                    // windowed/full-screen mode

    // create a device, device context and swap chain using the information in the scd struct
    D3D11CreateDeviceAndSwapChain(NULL,
                                  D3D_DRIVER_TYPE_HARDWARE,
                                  NULL,
                                  NULL,
                                  NULL,
                                  NULL,
                                  D3D11_SDK_VERSION,
                                  &scd,
                                  &swapchain,
                                  &dev,
                                  NULL,
                                  &devcon);
}


// this is the function that cleans up Direct3D and COM
void CleanD3D(void)
{
    // close and release all existing COM objects
    swapchain->Release();
    dev->Release();
    devcon->Release();
} 



jedoch bekomme ich immer zwei fehler

Zitat

1>main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_D3D11CreateDeviceAndSwapChain@48" in Funktion ""void __cdecl InitD3D(struct HWND__ *)" (?InitD3D@@YAXPAUHWND__@@@Z)".
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_main" in Funktion "___tmainCRTStartup".
1>B:\Programmieren\VS2010\DXL\direct x\Debug\direct x.exe : fatal error LNK1120: 2 nicht aufgelöste externe Verweise.


Hoffe ihr habt ne idee bin echt ratlos :/

gruß
moritz31

moritz31

Treue Seele

  • »moritz31« ist der Autor dieses Themas

Beiträge: 259

Wohnort: Hessen

Beruf: Student

  • Private Nachricht senden

2

11.11.2011, 14:18

Keiner ne Idee?

Saik0

Treue Seele

Beiträge: 171

Beruf: Anwendungsentwickler

  • Private Nachricht senden

3

11.11.2011, 14:25

Sieht für mich danach aus, dass irgendwelche Includes bei dir fehlen oder eine Implementierung einer Methode fehlt.

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Saik0« (11.11.2011, 14:35)


dot

Supermoderator

Beiträge: 9 757

Wohnort: Graz

  • Private Nachricht senden

4

11.11.2011, 14:39

Du hast ein Konsolenprojekt statt einer normalen Win32 Anwendung gemacht. Der Fehler wegen D3D11CreateDeviceAndSwapChain() ist allerdings sehr merkwürdig, sicher dass er die d3d11.lib findet?

moritz31

Treue Seele

  • »moritz31« ist der Autor dieses Themas

Beiträge: 259

Wohnort: Hessen

Beruf: Student

  • Private Nachricht senden

5

11.11.2011, 15:24

also hab mal nachgeschaut die d3d11.lib ist vorhanden , kann natürlch auch an dem fehler liegen, dass teile der lib nicht mit kopiert wurden :/

moritz31

Treue Seele

  • »moritz31« ist der Autor dieses Themas

Beiträge: 259

Wohnort: Hessen

Beruf: Student

  • Private Nachricht senden

6

12.11.2011, 17:13

wollte nun mal versuchen das sdk zu deinstallieren und auf einen anderen Pfad zu schmeißen,
jedoch finde ich nichts hilfreiches im Internet. Kann höchstens denn Ordner löschen :/
glaube aber nicht das dies sinn der sache ist

hat jemand ne idee?

7

12.11.2011, 21:19

Also bei mir (Windows 7 Prof.) kann ich es einfach unter Systemsteuerung -> Programme und Funktionen deinstallieren.

moritz31

Treue Seele

  • »moritz31« ist der Autor dieses Themas

Beiträge: 259

Wohnort: Hessen

Beruf: Student

  • Private Nachricht senden

8

12.11.2011, 21:37

hab auch win7 aber des wird da net angezeigt :/ was kann ich tun?


edit: so hab es mal neuinstalliert!
mit dem selben ergebnis :/

hänge ma den log an,
nur die unterste installation ist gültig
»moritz31« hat folgende Datei angehängt:
  • Log.rar (1,72 kB - 88 mal heruntergeladen - zuletzt: 08.03.2024, 06:00)

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »moritz31« (12.11.2011, 22:30)


9

13.11.2011, 11:59

1>MSVCRTD.lib(crtexe.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "_main" in Funktion "___tmainCRTStartup".

Den Fehler hat' ich auch mal, da fehlt deine Main-Funktion in der .cpp datei.
Mein Spieleprojekt:War of future
Mein Blog: War of future
Ich kenne mich mit Blender aus.

10

13.11.2011, 12:09

Du hast da ein Konsolen-Projekt erstellt, wie dot schon weiter oben erwähnt hat ;)

Werbeanzeige