fatal error LNK1120: 2 unresolved externals

Hello , Ive made a litle program with the process class but can't solve the following erros :


Error 1 error LNK2028: unresolved token (0A000007) "int __cdecl xx(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?xx@@$$FYAHV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ) Main.obj


Error 2 error LNK2019: unresolved external symbol "int __cdecl xx(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?xx@@$$FYAHV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ) Main.obj


Error 3 fatal error LNK1120: 2 unresolved externals C:\Users\Svexo\Documents\Visual Studio 2008\Projects\Ad spam\Debug\Ad spam.exe


This Is My 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
#include <iostream>
#include <string>
#include <sstream>
#using <System.dll>
using namespace std;
using namespace System;
using namespace System::Diagnostics;
using namespace System::ComponentModel;

int main ()
{
	int xx(string Website);
	int Timer = 0;
	string Website ;
	int Time = 0;
	string TimeString ;

	cout << "Enter the url of the website" << endl;
	cin >> Website;
	cout << endl; 
	cout << "Enter how many times "<< endl;
	cin >> TimeString ;
	cout << endl;
	cout << "Starting to Spamm " << Website << "For " << TimeString << " Time(s)" << endl;	
	Time = atoi(TimeString.c_str());
	while (Timer != Time)
	{
		Timer++;
	

		System::Threading::Thread::Sleep (1000);
		xx(Website);

	}
	
return (0);
}
void xx(string Website)
{
	String^ web = gcnew String (Website.c_str());



 ProcessStartInfo^ myProcess = gcnew ProcessStartInfo("iexplore.exe");
//myProcess->StartInfo->FileName = "iexplore.exe";
 myProcess->Arguments = web;
myProcess->WindowStyle = ProcessWindowStyle::Hidden ;
Process::Start(myProcess);

	

}


Last edited on
So you're mixing managed and native code? Ummmm...I've never seen code like this...can you even do that? I was thinking that one couldn't do that without the #managed #unmanaged pragmas etc., but I might be wrong...

Anyway, if it was all C++, you'd need to declare your xx function before your main. That should solve the unresolved symbols problem.

 
void xx(string Website);


Sorry I couldn't be of more help...

So you're mixing managed and native code? Ummmm...I've never seen code like this...can you even do that? I was thinking that one couldn't do that without the #managed #unmanaged pragmas etc., but I might be wrong...

Anyway, if it was all C++, you'd need to declare your xx function before your main. That should solve the unresolved symbols problem.


void xx(string Website);


Sorry I couldn't be of more help...


Hmm, Ive Cleaned evey error but cant Debug the App because its configuration is incorrectly
but doesnt mather cause i have the code working in c#
Topic archived. No new replies allowed.