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
Quellcode |
|
1 2 3 4 5 6 7 |
//basis_include.h //windows und andren std includes #ifdef TEST_EXPORTS #define DLL __declspec(dllexport) #else #define DLL __declspec(dllimport) #endif |
Quellcode |
|
1 2 3 4 |
//all_include.h #include "basis_include.h" #include "ClassA.h" #include "ClassB.h" |
Quellcode |
|
1 2 3 4 5 6 7 |
//ClassA.h #include "all_include.h" class DLL ClassA{ public: int x; int y; }; |
Quellcode |
|
1 2 3 4 5 6 |
//ClassB.h #include "all_include.h" class DLL ClassB{ public: void funktion(ClassA &a); //<-- hier is der fehler }; |
Quellcode |
|
1 2 |
#include "all_include.h" //winmain DLL |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 |
//all_include.h #ifndef DLL #include "basis_include.h" #endif #ifndef ClassA #include "ClassA.h" #endif #ifndef ClassB #include "ClassB.h" #endif |
Quellcode |
|
1 2 3 4 5 6 7 8 9 10 11 |
#ifndef __CLASSA_H #define __CLASSA_H #include "all_include.h" class DLL ClassA{ public: int x; int y; }; #endif |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
#if !defined (FOO_HPP__INCLUDED) #define FOO_HPP__INCLUDED #pragma once namespace mydll { struct foo {}; }; #endif // FOO_HPP__INCLUDED |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
#if !defined (BAR_HPP__INCLUDED) #define BAR_HPP__INCLUDED #pragma once namespace mydll { class bar { foo m_foo; }; }; #endif // BAR_HPP__INCLUDED |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 |
#if !defined(MYDLL_HPP__INCLUDED) #define MYDLL_HPP__INCLUDED #pragma once #include "Foo.hpp" #include "Bar.hpp" #endif // MYDLL_HPP__INCLUDED |
Offiziell nur solche, die entweder mit mehreren Unterstrichen oder mit Unterstrich und Grossbuchstaben beginnen.Zitat von »"Steef"«
btw wenn ich mich recht erinnere waren Makros, die mit _ beginnen, dem Compiler vorbehalten...
Werbeanzeige