Problem to compiling C++ prj

Hello
I'm new to C++ and i just started with Intel C++ on .net 2003.
I have used C symbol in C++ and according to this ref :
http://msdn.microsoft.com/en-us/library/799kze2z%28v=vs.80%29.aspx
I have used extern "C" in the definition.
But still get error for unresolved external symbols:

1
2
3
4
5
error LNK2019: unresolved external symbol _wurschtsalod4 referenced in function "unsigned long __cdecl calVarCRC(unsigned char *,unsigned char *,unsigned char *,int)" (?calVarCRC@@YAKPAE00H@Z)
error LNK2019: unresolved external symbol _schweizerwurschtsalod3 referenced in function "unsigned long __cdecl calVarCRC(unsigned char *,unsigned char *,unsigned char *,int)" (?calVarCRC@@YAKPAE00H@Z)
error LNK2019: unresolved external symbol _schweizerwurschtsalod4 referenced in function "unsigned long __cdecl calVarCRC(unsigned char *,unsigned char *,unsigned char *,int)" (?calVarCRC@@YAKPAE00H@Z)
error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
fatal error LNK1120: 4 unresolved externals


there is main code:

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
// erwer.cpp : Defines the entry point for the application.
//
#include "stdio.h"

extern "C"
 {
 int wurschtsalod4(BYTE *seed, BYTE *arg_Ram52, BYTE *buff348);
 int schweizerwurschtsalod3(BYTE *buff348, BYTE *arg_Rom, int arg_len);
 int schweizerwurschtsalod4(BYTE *buff20, BYTE *buff348);
 }

 DWORD calVarCRC(BYTE * seed, BYTE * arg_Ram52, BYTE * arg_Rom, int arg_len)
 {
 BYTE buff348[348];
 BYTE buff20[20];

 int res = wurschtsalod4(seed, arg_Ram52, buff348);
 res = schweizerwurschtsalod3(buff348, arg_Rom, arg_len - 4);

 res = schweizerwurschtsalod4(buff20, buff348);

 DWORD v = 0;
 int k = 0;
 do
 {
 BYTE idx = buff20[k++];
 v |= (buff348[idx + 92] & 3) << (2 * k - 2);
 }
 while ( k < 16 );

 DWORD crc = v;
 char i = 0;
 do
 {
 BYTE b = buff20[i + 16];
 *((BYTE*)&crc + i++) ^= b; 
 }
 while ( i < 4 );
 return crc;
 }

 DWORD calFixCRC(BYTE * seed, BYTE * arg_Ram52, BYTE * arg_Rom, int arg_len)
 {
 BYTE buff348[348];
 BYTE buff20[20];

 int res = wurschtsalod4(seed, arg_Ram52, buff348);
 res = schweizerwurschtsalod3(buff348, arg_Rom, arg_len - 4);

 res = schweizerwurschtsalod4(buff20, buff348);

 int j = 0;
 DWORD v = 0;
 do
 {
 BYTE idx = buff20[j++];
 v |= ((buff348[idx + 92] & 0x18) >> 3) << (2 * j - 2);
 }
 while ( j < 16 );

 char i = 0;
 DWORD crc = v;
 do
 {
 BYTE b = buff20[i + 16];
 BYTE * pCrc = (BYTE *)&crc + -i++ + 3; 
 *pCrc ^= b;
 }
 while ( i < 4 );

 return crc;
 }

 BYTE seed[] = 
 {
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
 };

 BYTE ram_rom[] = 
 {
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0x0C,0xBE,0x2E,0x0D,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0xB8,0x12,0x10,0x27,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
 0x00,0x00,0xD4,0xE3,0x61,0x5A,0x4E,0x16,0x00,0x00,0x00,0x00,0xD5,0x8D,0x13,0xEE
 };

any advise pls.
thanks in advance.
Last edited on
Intel C++ on .net 2003

What?

I have used extern "C" in the definition.

And where is the definition?
Using integrated intel C++ on .net 2003
From project menu using intell C++ compiler engine instead of .net C++ engine
About definition as i see in MSDN ref :
Symbol definitions are in a file that was compiled as a C program and symbols are declared in a C++ file without an extern "C" modifier. In that case, modify the declaration, for example, instead of:
1
2
extern int i;
extern void g();

use:
1
2
extern "C" int i;
extern "C" void g();


So i have used :
1
2
3
4
5
6
extern "C"
 {
 int wurschtsalod4(BYTE *seed, BYTE *arg_Ram52, BYTE *buff348);
 int schweizerwurschtsalod3(BYTE *buff348, BYTE *arg_Rom, int arg_len);
 int schweizerwurschtsalod4(BYTE *buff20, BYTE *buff348);
 }


adding #include <windows.h>
Have solved some definition problem but still getting definition error for :
wurschtsalod4
schweizerwurschtsalod3
schweizerwurschtsalod4
You know its my first time compiling code in C++




The compiler is complaining that you do not have the functions defined.
Do you have them defined in another hpp/cpp file?
If so, are those files included in your project?
Thanks for replay
I have found the mentioned function in Microsoft C ".lib" file.
and solved 3 LNK2019 error now just have 1 error:
error LNK2019: unresolved external symbol _WinMain@16 referenced in function _WinMainCRTStartup
Last edited on
Topic archived. No new replies allowed.