Forum: PC-Programmierung C++: SGI STL in Visual Studio 2008 einbinden


von Peter (Gast)


Lesenswert?

Hi,

ich weiss es handelt sich um alte SW. Jedoch benötige ich diese, um 
ältere HW zu bespielen.

Hat jemande eine Idee wie man die SGI STL in die IDE des VC++ 2008 
einbindet und im Quellcode verfügbar macht.

Gruß,
Peter

von Halbfliegengewichtler (Gast)


Lesenswert?

Den Pfad in den Einstellungen eintragen (bei VS 2008 waren die 
C++-Pfadangaben noch global, glaube ich) und die entsprechenden 
STL-Header inkludieren, würde ich sagen.

von Peter (Gast)


Lesenswert?

Also was ich gemacht habe.

Unter Projekt-Eigenschaften:
1. Configuration Properties->C/C++/Gerneral->Additional Include 
Directories-> "Pfad zur SGI STL" eingetragen
2. Configuration Properties->Linker/Gerneral->Additional Library 
Directories-> "Pfad zur SGI STL" eingetragen

3.Im Quell-Code ein Header der SGI STL eingebunden
1
#include <vector.h>
4. Versuchst einen Vector zu deklarieren der Ints aufnimmt
1
vector<int> v;    // declares a vector of integers




Dabei bekomme ich eine Reihe von Fehlermeldungen die direkt aus der SGI 
STL:
1
Error  2  error C2923: 'std::unary_function' : '_Predicate::argument_type' is not a valid template type argument for parameter '_Arg'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  146
2
Error  3  error C2955: 'std::unary_function' : use of class template requires template argument list  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  146
3
Error  5  error C2061: syntax error : identifier 'argument_type'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  151
4
Error  7  error C2923: 'std::binary_function' : '_Predicate::first_argument_type' is not a valid template type argument for parameter '_Arg1'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  167
5
Error  9  error C2923: 'std::binary_function' : '_Predicate::second_argument_type' is not a valid template type argument for parameter '_Arg2'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  167
6
Error  10  error C2955: 'std::binary_function' : use of class template requires template argument list  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  167
7
Error  12  error C2061: syntax error : identifier 'first_argument_type'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  172
8
Error  14  error C2923: 'std::unary_function' : '_Operation::second_argument_type' is not a valid template type argument for parameter '_Arg'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  189
9
Error  16  error C2923: 'std::unary_function' : '_Operation::result_type' is not a valid template type argument for parameter '_Result'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  189
10
Error  17  error C2955: 'std::unary_function' : use of class template requires template argument list  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  189
11
Error  19  error C2146: syntax error : missing ';' before identifier 'value'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  192
12
Error  20  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  192
13
Error  22  error C2061: syntax error : identifier 'first_argument_type'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  194
14
Error  24  error C2143: syntax error : missing ';' before '('  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  198
15
Error  26  error C2061: syntax error : identifier 'second_argument_type'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  198
16
Error  27  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  198
17
Error  29  error C2923: 'std::unary_function' : '_Operation::first_argument_type' is not a valid template type argument for parameter '_Arg'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  214
18
Error  31  error C2923: 'std::unary_function' : '_Operation::result_type' is not a valid template type argument for parameter '_Result'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  214
19
Error  32  error C2955: 'std::unary_function' : use of class template requires template argument list  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  214
20
Error  34  error C2146: syntax error : missing ';' before identifier 'value'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  217
21
Error  35  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  217
22
Error  37  error C2061: syntax error : identifier 'second_argument_type'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  219
23
Error  39  error C2143: syntax error : missing ';' before '('  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  223
24
Error  41  error C2061: syntax error : identifier 'first_argument_type'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  223
25
Error  42  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  223
26
Error  44  error C2923: 'std::unary_function' : '_Operation2::argument_type' is not a valid template type argument for parameter '_Arg'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  241
27
Error  46  error C2923: 'std::unary_function' : '_Operation1::result_type' is not a valid template type argument for parameter '_Result'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  241
28
Error  47  error C2955: 'std::unary_function' : use of class template requires template argument list  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  242
29
Error  49  error C2143: syntax error : missing ';' before '('  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  250
30
Error  51  error C2061: syntax error : identifier 'argument_type'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  250
31
Error  52  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  250
32
Error  54  error C2923: 'std::unary_function' : '_Operation2::argument_type' is not a valid template type argument for parameter '_Arg'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  265
33
Error  56  error C2923: 'std::unary_function' : '_Operation1::result_type' is not a valid template type argument for parameter '_Result'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  265
34
Error  57  error C2955: 'std::unary_function' : use of class template requires template argument list  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  265
35
Error  59  error C2143: syntax error : missing ';' before '('  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  275
36
Error  61  error C2061: syntax error : identifier 'argument_type'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  275
37
Error  62  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  275
38
Error  64  error C2923: 'std::unary_function' : '_Pair::first_type' is not a valid template type argument for parameter '_Result'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  335
39
Error  65  error C2955: 'std::unary_function' : use of class template requires template argument list  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  335
40
Error  67  error C2143: syntax error : missing ';' before '&'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  336
41
Error  68  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  336
42
Error  70  error C2923: 'std::unary_function' : '_Pair::second_type' is not a valid template type argument for parameter '_Result'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  342
43
Error  71  error C2955: 'std::unary_function' : use of class template requires template argument list  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  343
44
Error  73  error C2143: syntax error : missing ';' before '&'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  344
45
Error  74  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_function.h  344
46
Error  75  error C4980: '__value' : use of this keyword requires /clr:oldSyntax command line option  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  51
47
Error  77  error C2061: syntax error : identifier 'value_type'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  51
48
Error  78  error C2805: binary 'operator =' has too few parameters  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  51
49
Error  79  error C2333: 'std::back_insert_iterator<_Container>::operator =' : error in function declaration; skipping function body  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  51
50
Error  81  error C2061: syntax error : identifier 'value_type'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  90
51
Error  82  error C2805: binary 'operator =' has too few parameters  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  90
52
Error  83  error C2333: 'std::front_insert_iterator<_Container>::operator =' : error in function declaration; skipping function body  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  90
53
Error  85  error C2146: syntax error : missing ';' before identifier 'iter'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  119
54
Error  86  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  119
55
Error  88  error C2061: syntax error : identifier 'iterator'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  128
56
Error  90  error C2061: syntax error : identifier 'value_type'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  131
57
Error  91  error C2805: binary 'operator =' has too few parameters  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  131
58
Error  92  error C2333: 'std::insert_iterator<_Container>::operator =' : error in function declaration; skipping function body  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_iterator.h  131
59
Error  93  error C3630: error when processing the token '__value'  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_construct.h  51
60
Error  94  fatal error C1190: managed targeted code requires a '/clr' option  C:\Users\User\Documents\Visual Studio 2008\Projects\Test001\Test001\STL\stl_construct.h  51


Gruss Peter

von Rufus Τ. F. (rufus) Benutzerseite


Lesenswert?

Peter schrieb:
> Error  94  fatal error C1190: managed targeted code requires a '/clr'
> option

Die STL setzt einen C++-Compiler voraus; Du aber scheinst das 
.Net-Geraffel (also "Manged C++" bzw. "C++/CLR") zu verwenden.

Das hat zwar im Namen auch "C++", aber es ist eben kein C++, sondern 
eine Microsoft-Perversion.

Visual Studio enthält auch einen echten C++-Compiler, den musst Du in 
Deinen Projekteinstellungen bzw. beim Einrichten eines neuen Projektes 
auch auswählen.

von Peter (Gast)


Lesenswert?

Beim Compiler handelt es um den Arm4 (/QRarch4) für Smart Devices.

Ohne die SGI STL Einbindung funktioniert es.

von Rufus Τ. F. (rufus) Benutzerseite


Lesenswert?

Peter schrieb:
> Beim Compiler handelt es um den Arm4 (/QRarch4) für Smart Devices.

Schon, aber Du musst trotzdem auf das .Net-Geraffel verzichten. Ob x86 
oder ARM, "Managed C++" bzw. "C++/CLR" ist kein C++.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.