Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › error LNK2001 in Hello World
New Posts  All Forums:Forum Nav:

error LNK2001 in Hello World

post #1 of 11
Thread Starter 
Hey guys
I really don't know what to do, I tried everything that google told me but none of it worked to resolve my issue.

I'm trying to make a start at learning C++ but I keep getting errors.
Code:
#include <iostream>
#include <conio.h>

void main()

{
std::cout << "Hello World!" << std::endl;
getch();
}

When I try to build it, I get:
Code:
1>------ Build started: Project: first, Configuration: Debug Win32 ------
1>Build started 08/11/2011 21:10:50.
1>InitializeBuildStatus:
1>  Touching "Debug\\first.unsuccessfulbuild".
1>ManifestResourceCompile:
1>  All outputs are up-to-date.
1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>D:\\doc pic vid etc\\documents\\Visual Studio 2010\\Projects\\first\\Debug\\first.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.35
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Any ideas? please
firstborn
(16 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k @4.5GHz ASUS P8P67 Pro Gigabyte GeForce GTX460 1GB G-Skill Ripjaws DDR3 1600MHz 4x2GB 
Hard DriveHard DriveCoolingOS
Crucial M4 Samsung Spinpoint F3 Cooler Master Hyper 212+ Windows 7 Ultimate 64bit 
MonitorPowerCaseAudio
Phillips E-line [23.6" LED] & Dell [19" LCD] XFX XXX Edition 650W CM690 II NE Logitech X-530 5.1 
  hide details  
Reply
firstborn
(16 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k @4.5GHz ASUS P8P67 Pro Gigabyte GeForce GTX460 1GB G-Skill Ripjaws DDR3 1600MHz 4x2GB 
Hard DriveHard DriveCoolingOS
Crucial M4 Samsung Spinpoint F3 Cooler Master Hyper 212+ Windows 7 Ultimate 64bit 
MonitorPowerCaseAudio
Phillips E-line [23.6" LED] & Dell [19" LCD] XFX XXX Edition 650W CM690 II NE Logitech X-530 5.1 
  hide details  
Reply
post #2 of 11
Did you create a new project using the wizard? Make sure "precompiled header" is unchecked when you create a project using the wizard.
Daily
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K @ 4.8GHz, 1.4V Maximus IV Extreme GTX 560 DCII TOP 4x4GB Kingston HyperX 1866MHz CL11 
Hard DriveHard DriveCoolingCooling
Kingston HyperX 3K 120GB Samsung 640GB Thermochill PA120.2 Jingway DB-1 Pump 
CoolingCoolingOSMonitor
2x Kaze Jyuni 1900RPM EK Supreme HF Copper plexi Arch Linux x64 Acer X223HQ 1920x1080 
KeyboardPowerCaseMouse
Microsoft Sidewinder X4 Corsair HX750 Modded Corsair Carbide 500R Logitech M500 
  hide details  
Reply
Daily
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K @ 4.8GHz, 1.4V Maximus IV Extreme GTX 560 DCII TOP 4x4GB Kingston HyperX 1866MHz CL11 
Hard DriveHard DriveCoolingCooling
Kingston HyperX 3K 120GB Samsung 640GB Thermochill PA120.2 Jingway DB-1 Pump 
CoolingCoolingOSMonitor
2x Kaze Jyuni 1900RPM EK Supreme HF Copper plexi Arch Linux x64 Acer X223HQ 1920x1080 
KeyboardPowerCaseMouse
Microsoft Sidewinder X4 Corsair HX750 Modded Corsair Carbide 500R Logitech M500 
  hide details  
Reply
post #3 of 11
Thread Starter 
Yeah, this is what I select when I create it.
It's Win32 Console Application, right?

Oh and I use Virtual Studio 2010
firstborn
(16 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k @4.5GHz ASUS P8P67 Pro Gigabyte GeForce GTX460 1GB G-Skill Ripjaws DDR3 1600MHz 4x2GB 
Hard DriveHard DriveCoolingOS
Crucial M4 Samsung Spinpoint F3 Cooler Master Hyper 212+ Windows 7 Ultimate 64bit 
MonitorPowerCaseAudio
Phillips E-line [23.6" LED] & Dell [19" LCD] XFX XXX Edition 650W CM690 II NE Logitech X-530 5.1 
  hide details  
Reply
firstborn
(16 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k @4.5GHz ASUS P8P67 Pro Gigabyte GeForce GTX460 1GB G-Skill Ripjaws DDR3 1600MHz 4x2GB 
Hard DriveHard DriveCoolingOS
Crucial M4 Samsung Spinpoint F3 Cooler Master Hyper 212+ Windows 7 Ultimate 64bit 
MonitorPowerCaseAudio
Phillips E-line [23.6" LED] & Dell [19" LCD] XFX XXX Edition 650W CM690 II NE Logitech X-530 5.1 
  hide details  
Reply
post #4 of 11
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II x4 955 ASUS Crosshair 3 EVGA 465GTX 1GB 8GB DDR3 1600mhz GSkill/ADATA 
Hard DriveOSMonitorKeyboard
40GB Intel SSD 1TB Western Digital Black Edition Windows 7 x64 Pro Dual 21.5 Sceptre Saitek Eclipse 
PowerCaseMouseMouse Pad
850watt Silverstone Element Coolermaster Haf 932 Razer Lachesis Razer Vespula 
  hide details  
Reply
My System
(13 items)
 
  
CPUMotherboardGraphicsRAM
AMD Phenom II x4 955 ASUS Crosshair 3 EVGA 465GTX 1GB 8GB DDR3 1600mhz GSkill/ADATA 
Hard DriveOSMonitorKeyboard
40GB Intel SSD 1TB Western Digital Black Edition Windows 7 x64 Pro Dual 21.5 Sceptre Saitek Eclipse 
PowerCaseMouseMouse Pad
850watt Silverstone Element Coolermaster Haf 932 Razer Lachesis Razer Vespula 
  hide details  
Reply
post #5 of 11
Quote:
Originally Posted by dajposkakac View Post
Yeah, this is what I select when I create it.
It's Win32 Console Application, right?

Oh and I use Virtual Studio 2010
Uncheck "empty project" too. It should give you a template file, delete the contents and paste in your code from the OP.
Daily
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K @ 4.8GHz, 1.4V Maximus IV Extreme GTX 560 DCII TOP 4x4GB Kingston HyperX 1866MHz CL11 
Hard DriveHard DriveCoolingCooling
Kingston HyperX 3K 120GB Samsung 640GB Thermochill PA120.2 Jingway DB-1 Pump 
CoolingCoolingOSMonitor
2x Kaze Jyuni 1900RPM EK Supreme HF Copper plexi Arch Linux x64 Acer X223HQ 1920x1080 
KeyboardPowerCaseMouse
Microsoft Sidewinder X4 Corsair HX750 Modded Corsair Carbide 500R Logitech M500 
  hide details  
Reply
Daily
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K @ 4.8GHz, 1.4V Maximus IV Extreme GTX 560 DCII TOP 4x4GB Kingston HyperX 1866MHz CL11 
Hard DriveHard DriveCoolingCooling
Kingston HyperX 3K 120GB Samsung 640GB Thermochill PA120.2 Jingway DB-1 Pump 
CoolingCoolingOSMonitor
2x Kaze Jyuni 1900RPM EK Supreme HF Copper plexi Arch Linux x64 Acer X223HQ 1920x1080 
KeyboardPowerCaseMouse
Microsoft Sidewinder X4 Corsair HX750 Modded Corsair Carbide 500R Logitech M500 
  hide details  
Reply
post #6 of 11
Thread Starter 
Quote:
Originally Posted by ByteMyASCII View Post
I read that but I couldn't find a solution that I could understand in there.

Quote:
Originally Posted by ARandomOWl
Uncheck "empty project" too. It should give you a template file, delete the contents and paste in your code from the OP.
wow, thanks! So I guess I need more stuff to make this work, now it works
firstborn
(16 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k @4.5GHz ASUS P8P67 Pro Gigabyte GeForce GTX460 1GB G-Skill Ripjaws DDR3 1600MHz 4x2GB 
Hard DriveHard DriveCoolingOS
Crucial M4 Samsung Spinpoint F3 Cooler Master Hyper 212+ Windows 7 Ultimate 64bit 
MonitorPowerCaseAudio
Phillips E-line [23.6" LED] & Dell [19" LCD] XFX XXX Edition 650W CM690 II NE Logitech X-530 5.1 
  hide details  
Reply
firstborn
(16 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k @4.5GHz ASUS P8P67 Pro Gigabyte GeForce GTX460 1GB G-Skill Ripjaws DDR3 1600MHz 4x2GB 
Hard DriveHard DriveCoolingOS
Crucial M4 Samsung Spinpoint F3 Cooler Master Hyper 212+ Windows 7 Ultimate 64bit 
MonitorPowerCaseAudio
Phillips E-line [23.6" LED] & Dell [19" LCD] XFX XXX Edition 650W CM690 II NE Logitech X-530 5.1 
  hide details  
Reply
post #7 of 11
Awesome Have fun
Daily
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K @ 4.8GHz, 1.4V Maximus IV Extreme GTX 560 DCII TOP 4x4GB Kingston HyperX 1866MHz CL11 
Hard DriveHard DriveCoolingCooling
Kingston HyperX 3K 120GB Samsung 640GB Thermochill PA120.2 Jingway DB-1 Pump 
CoolingCoolingOSMonitor
2x Kaze Jyuni 1900RPM EK Supreme HF Copper plexi Arch Linux x64 Acer X223HQ 1920x1080 
KeyboardPowerCaseMouse
Microsoft Sidewinder X4 Corsair HX750 Modded Corsair Carbide 500R Logitech M500 
  hide details  
Reply
Daily
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K @ 4.8GHz, 1.4V Maximus IV Extreme GTX 560 DCII TOP 4x4GB Kingston HyperX 1866MHz CL11 
Hard DriveHard DriveCoolingCooling
Kingston HyperX 3K 120GB Samsung 640GB Thermochill PA120.2 Jingway DB-1 Pump 
CoolingCoolingOSMonitor
2x Kaze Jyuni 1900RPM EK Supreme HF Copper plexi Arch Linux x64 Acer X223HQ 1920x1080 
KeyboardPowerCaseMouse
Microsoft Sidewinder X4 Corsair HX750 Modded Corsair Carbide 500R Logitech M500 
  hide details  
Reply
post #8 of 11
Thread Starter 
though now when I try to Debug I get this.

When I change configuration from Debug to Release it goes away, but still, it should allow me to debug.
I have the latest Microsoft Visual C++ Redistrutable installed
firstborn
(16 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k @4.5GHz ASUS P8P67 Pro Gigabyte GeForce GTX460 1GB G-Skill Ripjaws DDR3 1600MHz 4x2GB 
Hard DriveHard DriveCoolingOS
Crucial M4 Samsung Spinpoint F3 Cooler Master Hyper 212+ Windows 7 Ultimate 64bit 
MonitorPowerCaseAudio
Phillips E-line [23.6" LED] & Dell [19" LCD] XFX XXX Edition 650W CM690 II NE Logitech X-530 5.1 
  hide details  
Reply
firstborn
(16 items)
 
  
CPUMotherboardGraphicsRAM
i5 2500k @4.5GHz ASUS P8P67 Pro Gigabyte GeForce GTX460 1GB G-Skill Ripjaws DDR3 1600MHz 4x2GB 
Hard DriveHard DriveCoolingOS
Crucial M4 Samsung Spinpoint F3 Cooler Master Hyper 212+ Windows 7 Ultimate 64bit 
MonitorPowerCaseAudio
Phillips E-line [23.6" LED] & Dell [19" LCD] XFX XXX Edition 650W CM690 II NE Logitech X-530 5.1 
  hide details  
Reply
post #9 of 11
Quote:
Originally Posted by dajposkakac View Post
though now when I try to Debug I get this.

When I change configuration from Debug to Release it goes away, but still, it should allow me to debug.
I have the latest Microsoft Visual C++ Redistrutable installed
Sorry, can't help you with that one. I hope google can come to the rescue
Daily
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K @ 4.8GHz, 1.4V Maximus IV Extreme GTX 560 DCII TOP 4x4GB Kingston HyperX 1866MHz CL11 
Hard DriveHard DriveCoolingCooling
Kingston HyperX 3K 120GB Samsung 640GB Thermochill PA120.2 Jingway DB-1 Pump 
CoolingCoolingOSMonitor
2x Kaze Jyuni 1900RPM EK Supreme HF Copper plexi Arch Linux x64 Acer X223HQ 1920x1080 
KeyboardPowerCaseMouse
Microsoft Sidewinder X4 Corsair HX750 Modded Corsair Carbide 500R Logitech M500 
  hide details  
Reply
Daily
(16 items)
 
  
CPUMotherboardGraphicsRAM
i7 2600K @ 4.8GHz, 1.4V Maximus IV Extreme GTX 560 DCII TOP 4x4GB Kingston HyperX 1866MHz CL11 
Hard DriveHard DriveCoolingCooling
Kingston HyperX 3K 120GB Samsung 640GB Thermochill PA120.2 Jingway DB-1 Pump 
CoolingCoolingOSMonitor
2x Kaze Jyuni 1900RPM EK Supreme HF Copper plexi Arch Linux x64 Acer X223HQ 1920x1080 
KeyboardPowerCaseMouse
Microsoft Sidewinder X4 Corsair HX750 Modded Corsair Carbide 500R Logitech M500 
  hide details  
Reply
post #10 of 11
Quote:
Originally Posted by dajposkakac View Post
though now when I try to Debug I get this.

When I change configuration from Debug to Release it goes away, but still, it should allow me to debug.
I have the latest Microsoft Visual C++ Redistrutable installed
It shouldn't debug because you have a missing C++ runtime lib dll (which is what it says in the dialog box) which is used for debugging... The reason why it works on release is because release uses a different lib file which is just essentially a similarly named-file (MSVCP100.dll)

edit: here - http://www.buggymind.com/305 (yes the ss is in korean apparently, but it stems from this article which has your problem: http://stackoverflow.com/questions/4...nd-reinstallin ).

I think you can just install the runtime yourself. Here's more data about it: http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx
Edited by 0x62 0x70 - 11/8/11 at 2:15pm
Mr Jiggawatts
(13 items)
 
  
CPUMotherboardGraphicsRAM
1090T@4GHz@1.46V Ultra LLC/3GHz CPU-NB@1.33V Asus Crosshair V Formula MSI GTX560-TI 1GB TF II Patriot Viper Xtreme 1600 8GB (2x4GB) 8-9-8-24 
Hard DriveOSMonitorKeyboard
Intel X25-V 40GB, Kingston SSDNow 64GB Windows 7 Ultimate LG Flatron W2353V Razer Arctosa 
PowerCaseMouse
Antec HCG-900W Antec Lanboy Air Yellow Razer Abbysus 
  hide details  
Reply
Mr Jiggawatts
(13 items)
 
  
CPUMotherboardGraphicsRAM
1090T@4GHz@1.46V Ultra LLC/3GHz CPU-NB@1.33V Asus Crosshair V Formula MSI GTX560-TI 1GB TF II Patriot Viper Xtreme 1600 8GB (2x4GB) 8-9-8-24 
Hard DriveOSMonitorKeyboard
Intel X25-V 40GB, Kingston SSDNow 64GB Windows 7 Ultimate LG Flatron W2353V Razer Arctosa 
PowerCaseMouse
Antec HCG-900W Antec Lanboy Air Yellow Razer Abbysus 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › error LNK2001 in Hello World