Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: win32 prog Pin
«_Superman_»7-Nov-09 18:38
professional«_Superman_»7-Nov-09 18:38 
AnswerRe: win32 prog Pin
himmi20098-Nov-09 4:17
himmi20098-Nov-09 4:17 
GeneralRe: win32 prog Pin
«_Superman_»8-Nov-09 6:13
professional«_Superman_»8-Nov-09 6:13 
QuestionRe: win32 prog Pin
David Crow9-Nov-09 3:23
David Crow9-Nov-09 3:23 
QuestionSerialization from a CPropertypage class behaves differently [modified] Pin
al25007-Nov-09 14:18
al25007-Nov-09 14:18 
AnswerRe: Serialization from a CPropertypage class behaves differently Pin
«_Superman_»7-Nov-09 18:41
professional«_Superman_»7-Nov-09 18:41 
GeneralRe: Serialization from a CPropertypage class behaves differently [modified] Pin
al25008-Nov-09 8:04
al25008-Nov-09 8:04 
QuestionBeginner question using headers Pin
Jacob Dixon7-Nov-09 10:49
Jacob Dixon7-Nov-09 10:49 
Hello! I acutally program in C# and chose to start learning C++. I have two questions. One would be if I develop a C++ application using visual c++ 2008, is there a way for it to be converted to run on Mac OS X? Or do you have to write it over in a different IDE?

The main question I have is I was trying to learn from this tutorial I found on www.learncpp.com.
It seems the tutorials were geared more towards Visual C++ 2005 and not 2008 (I am using 2008).

I ran into trouble with the headers. The code I am using is from the tutorial so I am confused as to why it is not working?

I noticed a few things different. In the tutorial it doesn't include "stdafx.h" which it needs to compile. Also when trying to use a header file i get these errors:

Error 1 error LNK2019: unresolved external symbol "int __cdecl add(int,int)" (?add@@YAHHH@Z) referenced in function _main HelloWorld.obj HelloWorld
Error 2 fatal error LNK1120: 1 unresolved externals C:\C++\HelloWorld\Debug\HelloWorld.exe HelloWorld

Now I understand it is having trouble reading the add.h file but I am not sure why?
Here is my code:

HelloWorld.cpp:

// HelloWorld.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include "add.h"		// bring in the declaration for add()

int main() 
{ 
	using namespace std; 
	cout << "The sum of 3 and 4 is " << add(3, 4) << endl; 
	return 0; 
}



and here is my add.h:

#ifndef ADD_H
#define ADD_H

int add(int x, int y);

#endif


Any help would be great! Thanks!
AnswerRe: Beginner question using headers Pin
Jacob Dixon7-Nov-09 10:53
Jacob Dixon7-Nov-09 10:53 
GeneralRe: Beginner question using headers Pin
«_Superman_»7-Nov-09 10:57
professional«_Superman_»7-Nov-09 10:57 
AnswerRe: Beginner question using headers Pin
«_Superman_»7-Nov-09 10:56
professional«_Superman_»7-Nov-09 10:56 
GeneralRe: Beginner question using headers Pin
Jacob Dixon7-Nov-09 11:30
Jacob Dixon7-Nov-09 11:30 
GeneralRe: Beginner question using headers Pin
Chris Losinger7-Nov-09 14:37
professionalChris Losinger7-Nov-09 14:37 
GeneralRe: Beginner question using headers Pin
Jacob Dixon7-Nov-09 14:41
Jacob Dixon7-Nov-09 14:41 
GeneralRe: Beginner question using headers Pin
Tim Craig7-Nov-09 21:07
Tim Craig7-Nov-09 21:07 
GeneralRe: Beginner question using headers [modified] Pin
LunaticFringe8-Nov-09 8:49
LunaticFringe8-Nov-09 8:49 
GeneralRe: Beginner question using headers Pin
Chris Losinger8-Nov-09 10:13
professionalChris Losinger8-Nov-09 10:13 
GeneralRe: Beginner question using headers Pin
LunaticFringe8-Nov-09 10:26
LunaticFringe8-Nov-09 10:26 
QuestionGet IExplorerBrowser from a Windows Explorer (Vista) Pin
Ivo Beltchev7-Nov-09 7:35
Ivo Beltchev7-Nov-09 7:35 
QuestionImage in word document Pin
arpanmukherjee17-Nov-09 4:28
arpanmukherjee17-Nov-09 4:28 
AnswerRe: Image in word document Pin
Maximilien7-Nov-09 5:24
Maximilien7-Nov-09 5:24 
GeneralRe: Image in word document Pin
arpanmukherjee17-Nov-09 23:35
arpanmukherjee17-Nov-09 23:35 
GeneralRe: Image in word document Pin
Rajesh R Subramanian8-Nov-09 19:57
professionalRajesh R Subramanian8-Nov-09 19:57 
QuestionHow to join two programes? Pin
Waldemar Ork7-Nov-09 3:33
Waldemar Ork7-Nov-09 3:33 
AnswerRe: How to join two programes? Pin
LunaticFringe7-Nov-09 7:19
LunaticFringe7-Nov-09 7:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.