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

n0_0ne

1x Contest-Sieger

  • »n0_0ne« ist der Autor dieses Themas
  • Private Nachricht senden

1

01.04.2009, 10:18

C::B, TB, DX etc.

Hallo,
ich habe gestern nach Davids Anleitung die Tribase neu kompiliert... soweit ging das auch alles gut (mit VS 2008). Allerdings würde ich eben lieber mit Code::Blocks arbeiten, weil ich damit schon die ganze Zeit programmiere. Hab also Platform SDK, und DirectX SDK in den neuesten Versionen runtergeladen, installiert und die Directories in C::B angegeben. Wenn ich jetzt ein einfaches

C-/C++-Quelltext

1
2
3
4
5
6
7
#include "TriBase.h"

int main()
{
    tbInit();
    tbExit();
}

kompilieren will, dann bekomme ich überall (zuerst in den DX sdk files, jetzt in den platform sdk files) Fehler.

Zitat


D:\Development\PlatformSDK\VC\INCLUDE\crtdefs.h|522|error: redeclaration of C++ built-in type `short'|
D:\Development\PlatformSDK\Include\basetsd.h|79|error: `__int64' does not name a type|
D:\Development\PlatformSDK\Include\basetsd.h|83|error: `__int64' does not name a type|
D:\Development\PlatformSDK\Include\basetsd.h||In function `void* PtrToPtr64(const void*)':|
D:\Development\PlatformSDK\Include\basetsd.h|361|error: expected primary-expression before "void"|
D:\Development\PlatformSDK\Include\basetsd.h|361|error: expected `)' before "void"|
D:\Development\PlatformSDK\Include\basetsd.h|361|error: expected `)' before ';' token|
D:\Development\PlatformSDK\Include\basetsd.h||In function `void* Ptr64ToPtr(const void*)':|
D:\Development\PlatformSDK\Include\basetsd.h|370|error: expected primary-expression before "void"|
D:\Development\PlatformSDK\Include\basetsd.h|370|error: expected `)' before "void"|
D:\Development\PlatformSDK\Include\basetsd.h|370|error: expected `)' before ';' token|
D:\Development\PlatformSDK\Include\basetsd.h||In function `void* HandleToHandle64(const void*)':|
D:\Development\PlatformSDK\Include\basetsd.h|379|error: `__int64' was not declared in this scope|
D:\Development\PlatformSDK\Include\basetsd.h|379|error: expected primary-expression before "void"|
D:\Development\PlatformSDK\Include\basetsd.h|379|error: expected `)' before "void"|
D:\Development\PlatformSDK\Include\basetsd.h|379|error: expected `)' before ';' token|
D:\Development\PlatformSDK\Include\basetsd.h|379|warning: unused variable '__int64'|
D:\Development\PlatformSDK\Include\basetsd.h||In function `void* Handle64ToHandle(const void*)':|
D:\Development\PlatformSDK\Include\basetsd.h|388|error: expected primary-expression before "void"|
D:\Development\PlatformSDK\Include\basetsd.h|388|error: expected `)' before "void"|
D:\Development\PlatformSDK\Include\basetsd.h|388|error: expected `)' before ';' token|
D:\Development\PlatformSDK\Include\basetsd.h|476|error: `__int64' does not name a type|
D:\Development\PlatformSDK\Include\basetsd.h|483|error: `__int64' does not name a type|
D:\Development\PlatformSDK\Include\basetsd.h|484|error: `__int64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|242|warning: "_cdecl" redefined|
:83|1|warning: this is the location of the previous definition|
D:\Development\PlatformSDK\Include\winnt.h|514|error: `__int64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|515|error: `__int64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|528|error: `__int64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|529|error: `__int64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|550|error: expected initializer before '*' token|
D:\Development\PlatformSDK\Include\winnt.h|551|error: expected initializer before '*' token|
D:\Development\PlatformSDK\Include\winnt.h|555|error: `LONGLONG' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|570|error: `LONGLONG' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|588|error: `ULONGLONG' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|606|error: `ULONGLONG' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|607|error: expected initializer before '*' token|
D:\Development\PlatformSDK\Include\winnt.h|734|#error Must define a target architecture.|
D:\Development\PlatformSDK\Include\winnt.h|872|error: `ULONGLONG' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|873|error: `ULONGLONG' does not name a type|
D:\Development\PlatformSDK\VC\INCLUDE\string.h|141|warning: ignoring #pragma warning |
D:\Development\PlatformSDK\VC\INCLUDE\string.h|142|warning: ignoring #pragma warning |
D:\Development\PlatformSDK\VC\INCLUDE\string.h|145|warning: ignoring #pragma warning |
D:\Development\PlatformSDK\Include\winnt.h|3043|warning: ignoring #pragma warning |
D:\Development\PlatformSDK\Include\winnt.h|3053|warning: ignoring #pragma warning |
D:\Development\PlatformSDK\Include\winnt.h|5532|error: `DWORD64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|5533|error: `DWORD64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|5536|error: `DWORD64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7240|error: `DWORD64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7241|error: `DWORD64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7242|error: `DWORD64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7243|error: `DWORD64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7245|error: `DWORD64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7248|error: `DWORD64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7249|error: `DWORD64' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7313|error: `ULONGLONG' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7314|error: `ULONGLONG' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7315|error: `ULONGLONG' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7316|error: `ULONGLONG' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7317|error: `ULONGLONG' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7318|error: `ULONGLONG' does not name a type|
D:\Development\PlatformSDK\Include\winnt.h|7544|error: `ULONGLONG' does not name a type|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 8 warnings ===|

Kann ich mit Code::Blocks (MinGW) das überhaupt machen, oder bin ich gezwungen VS zu benutzen? oder mache ich irgendwas einfach nur falsch?

EDIT: OK, ich habe mir meine Frage doch selbst beantworten können... mit dem GNU GCC Compiler hat es sich nicht kompilieren lassen, als ich das ganze auf MS VC++ 2008 Compiler umgestellt gab es auf einmal nur noch 10^99999..... Warnings, aber es lief auf Anhieb xD

TrommlBomml

Community-Fossil

Beiträge: 2 117

Wohnort: Berlin

Beruf: Software-Entwickler

  • Private Nachricht senden

2

01.04.2009, 10:28

afaik nein allein wegen pragma once

n0_0ne

1x Contest-Sieger

  • »n0_0ne« ist der Autor dieses Themas
  • Private Nachricht senden

3

01.04.2009, 10:34

Wieso, was ist denn mit pragma once? Und was sind denn so die Unterschiede der Compiler, und warum gibt es ÜBERHAUPT diese Unterschiede? Ich dachte C++ wäre C++, wie kann es da sein, dass ich mit dem einen Compiler X Fehler bekomme, und es mit dem anderen einfach durchläuft... oder ist das hier einfach nur der Fehler vom GCC und der Compiler von MS ist einfach besser und compiliert alles richtig?

TrommlBomml

Community-Fossil

Beiträge: 2 117

Wohnort: Berlin

Beruf: Software-Entwickler

  • Private Nachricht senden

4

01.04.2009, 10:49

pragma once ist der ms compiler spezifische includegard.

unterschiede gibt es nunmal, weil es einen standard gibt für c++, wer sich aber wie dran hält ist so eine sache. manche sind der meinung sie müssen eigene spezifische dinge einbauen, weils "praktischer" ist. so meine erfahrung.

n0_0ne

1x Contest-Sieger

  • »n0_0ne« ist der Autor dieses Themas
  • Private Nachricht senden

5

01.04.2009, 11:17

Hhmmm, ist es dann garnicht möglich zwei verschiedene Libs, die einmal für den GCC, einmal für VCC geschrieben wurden, gleichzeitig in einem Projekt zu benutzen?

TrommlBomml

Community-Fossil

Beiträge: 2 117

Wohnort: Berlin

Beruf: Software-Entwickler

  • Private Nachricht senden

6

01.04.2009, 11:19

doch, dazu kannst du mit ifdefs nach compiler fragen. viele bieten auch kompilate für entsprechende compiler, z.B. HGE.

http://hge.relishgames.com/index.html

EDIT: sry nich richtig gelesen...

n0_0ne

1x Contest-Sieger

  • »n0_0ne« ist der Autor dieses Themas
  • Private Nachricht senden

7

01.04.2009, 17:46

Also heute Mittag hatte das Ganze wunderbar funktioniert... Ich habe die ersten drei Übungsaufgaben geschrieben, alles lief, wie es sollte und dann hab ich erstmal eine Pause gemacht.
Jetzt wollte ich weitermachen, die nächsten paar Seiten gelesen und bin dann bei den Vektoren auf etwas gestoßen, was ich nicht verstanden habe, nämlich tbVector3(10.0f), was meiner Meinung nach irgendwie keinen Sinn macht, einem 3D-Vektor nur einen Float-Wert zu übergeben (dafür gab es auch keinen Konstruktor). Also einfach mal ans Ende des Programms gehängt:

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
#include "TriBase.h"
#include <iostream>

using namespace std;

int main()
{
    tbInit();
    tbWriteToLog("Das ist ein Test");
    int *paRandom1 = (int*)tbMemAlloc(1000 * sizeof(int));
    int *paRandom2 = (int*)tbMemAlloc(1000 * sizeof(int));
    int *paRandom3 = (int*)tbMemAlloc(1000 * sizeof(int));
    for (int i = 0; i < 1000; i++)
    {
        paRandom1[i] = tbIntRandom(0, 1000);
        paRandom2[i] = tbIntRandom(0, 1000);
    }

    // Nach der Pause läufts jetzt noch bis hier <------ (Erklärung unten)


    cout << paRandom1[0] << endl;
    cout << paRandom2[0] << endl;
    cout << paRandom1[999] << endl;
    cout << paRandom2[999] << endl;

    memcpy(paRandom3, paRandom1, 1000 * sizeof(int));
    memcpy(paRandom1, paRandom2, 1000 * sizeof(int));
    memcpy(paRandom2, paRandom3, 1000 * sizeof(int));

    cout << paRandom1[0] << endl;
    cout << paRandom2[0] << endl;
    cout << paRandom1[999] << endl;
    cout << paRandom2[999] << endl;

    tbVFile *pFile = new tbVFile();
    pFile->Init("hci.txt@hci.zip");
    pFile->SaveToFile("hci.txt");
    TB_SAFE_DELETE(pFile);

   tbVector3 a(tbVector3(17.0f, 23.0f, -1.0f)); // Das hier ist neu


    tbExit();
}


Und auf einmal ging es dann los:
Zuerst sagte er mir, dass er in der Datei "xutility" (in PlatformSDK/VC/Include) ganz am Ende ein Zeichen '0x12' gefunden hat, mit dem er nichts anfangen kann. Allerdings war da nichts... also die Zeile gelöscht und nochmal hingeschrieben... Der Fehler war weg, dafür hatte er jetzt ein Problem mit irgendeinem #if bzw. #endif, welches nicht vollständig war...
Als ich nicht weiter wußte, habe ich die Datei mit der "xutility" aus VisualStudio/VC/Include verglichen, und siehe da, das ist eine komplett andere, mit 1500 Zeilen Code mehr... also einfach das Verzeichnis geändert (include aus dem platform sdk raus, dafür visual studio rein)...
Jetzt läuft das Programm bis zu dem Kommentar mit dem Pfeil oben, wenn ich den Rest darunter nicht auskommentiere kommt das:

Zitat

D:\Development\Visual Studio\VC\include\xlocale|342|warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc|

main.obj||error LNK2019: unresolved external symbol "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?_Locinfo_ctor@_Locinfo@std@@SAXPAV12@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@@Z) referenced in function "public: __thiscall std::_Locinfo::_Locinfo(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0_Locinfo@std@@QAE@|

bin\Debug\TriBase.exe||fatal error LNK1120: 1 unresolved externals|
||=== Build finished: 2 errors, 1 warnings ===|


Ich habe alle Libs aus den VS Projekten der CD eingebunden (in CodeBlocks, was ich ja benutze)... Weiß irgendjemand, was ich dagegen machen kann? Und warum es am Anfang funktioniert hat, und dann ganz plötzlich nach einem Reboot garnichts mehr funktioniert wie es soll?

EDIT: OH MAN, ich hab das Problem gefunden, ich hab include von platform sdk auf visual studio geändert, aber vergessen das selbe mit dem lib ordner zu machen.... Trotzdem verstehe ich es nicht:
1. Wie sieht ein tbVector3 aus, wenn er nur 1 float bekommt?! x=y=z? und was hätte das für einen Sinn?
2. Was hat es mit dem Platform SDK VC ordner auf sich, wieso funktioniert das ganze zeug da drin nicht?

Phil239

Frischling

Beiträge: 79

Beruf: Student

  • Private Nachricht senden

8

11.04.2009, 14:06

Wenn man tbVector3 nur einen float übergibt ist x = y = z.
Gibt's dann auch etwas später noch bei Farben mit tbColor.
Beispiel:

C-/C++-Quelltext

1
2
3
4
5
// einfach schwarz festlegen:

tbColor Farbe = tbColor(0.0f);

// umständlich schwarz festlegen

tbColor Farbe = tbColor(0.0f, 0.0f, 0.0f);

Bei Vektoren hätte das den Sinn, einen Punkt auf der x-, y-, und z-Achse gleich zu positionieren (also x=0, y=0, z=0).

Hoffe ich konnte dir weiterhelfen.

Ach übrigens:

Zitat von »"tbVektor3.h"«

C-/C++-Quelltext

1
2
3
// ...

inline tbVector3(const float f) : x(f), y(f), z(f) {}
// ...
Der Computer ist die logische Weiterentwicklung des Menschen: Intelligenz ohne Moral.

Werbeanzeige