473,394 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

iostream,cons. app.,int main(){return 0;}, Won't link!


Anybody know why this does not link?

I have tried google 50 odd ways and nobody else seems to have this
problem
quite. It is meant to be a console application...

#include <iostream>
int main(){return 0;}

------ Build started: Project: HelloWorld, Configuration: Debug Win32
------
Compiling...
HelloWorld.cpp
Linking...
HelloWorld.obj : error LNK2019: unresolved external symbol "public:
__thiscall std::ios_base::Init::Init(void)"
(??0Init@ios_base@std@@QAE@XZ)
referenced in function "void __cdecl std::`dynamic initializer for
'_Ios_init''(void)" (??__E_Ios_init@std@@YAXXZ)
HelloWorld.obj : error LNK2019: unresolved external symbol "public:
__thiscall std::ios_base::Init::~Init(void)"
(??1Init@ios_base@std@@QAE@XZ)
referenced in function "void __cdecl std::`dynamic atexit destructor
for
'_Ios_init''(void)" (??__F_Ios_init@std@@YAXXZ)
C:\Documents and Settings\Kerewin\My Documents\Visual Studio
2005\Projects\HelloWorld\Debug\HelloWorld.exe : fatal error LNK1120: 2
unresolved externals
Build log was saved at "file://c:\Documents and Settings\KKere\My
Documents\Visual Studio
2005\Projects\HelloWorld\HelloWorld\Debug\BuildLog .htm"
HelloWorld - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped
==========

Points to note:
1. Strictly .NET 2005 C++ unmanaged.
2. Statically linking in LIBCPMTD.lib
3. Compiling with C++ exceptions enabled, /EHsc
4. XP Pro dev. environment.

Any ideas?

Oh, BTW http://comsc.dvc.edu/UsingVisualStudioNET05.pdf has a demo
which
apparently works... But not for me!

Apr 8 '06 #1
3 1329
<py*******@tiscali.co.uk> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...

Anybody know why this does not link?


Best guess - your VS2005 installation is messed up somehow. Have you tried
doing a repair install? What edition of VC++ 2005 are you using?

-cd
Apr 8 '06 #2
Hi Carl Daniel,

I know you are highly likely to be right because I did a complete
uninstall of all .NET material and MS applications that rely upon it -
about 9Gb.

Then I ran some registry checks, and EasyCleaner which found around
slight less than 2500 registry debris, mostly left by VS .NET 2005. eg
InProcServer CLSIDs, MRUs.

Finally, I reinstalled VS 2005 and tried out:

#include <iostream>
using namespace std;
int main()
{
cout<<"Hello World"<<endl;
cin.get();
return 0;
}

This works along with the tiny snippet I have already put out into the
newsgroup. Unfortunately, ultimately, this has cost me >>40 hours and I
have in sequence conducted a 2K5 repair, a remove&reinstall, and now
finally what I stated above. Hum ho.

I am using final 2K5 Professional - Enterprise Architect is out of my
price range...

Thank you for your contribution.
kkere.

Apr 9 '06 #3
Hi Carl,
I m also having similar issue , but not in any simple console application.

What i m doing is , that i m migrationg my whole product from VC6 to VC8.
Even I have done it succesfully , but i have got stuck in one place where i
m using some third party LIB , to link with my projects.

I was using same Libraries with VC6.0.
But when I have used these libraries to link with me VC8 code it starts
giving me some issue.
Please help if there is nay solution.
regards , pardeep Kadian
"Carl Daniel [VC++ MVP]" wrote:
<py*******@tiscali.co.uk> wrote in message
news:11**********************@z34g2000cwc.googlegr oups.com...

Anybody know why this does not link?


Best guess - your VS2005 installation is messed up somehow. Have you tried
doing a repair install? What edition of VC++ 2005 are you using?

-cd

May 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Suzanne | last post by:
Hi++, I get a link error when I try to call a template function that is declared in a header file and defined in a non-header file. I do *not* get this link error if I define the template...
11
by: penguinman | last post by:
I type ./a.out and the shell just sits there. It doesnt hang it just sits there looking pretty. I run the program with the ddd option and executed it from ddd...execution window comes up and...
7
by: Shawn Windle | last post by:
----begin node.h-------- #ifndef NODE_H #define NODE_H #include <iostream> //NULL using namespace std; class node {
1
by: Pradyot Dhulipala | last post by:
Hi, I am using ns2.26 with the Makefile using C++ compiler version c++ (GCC) 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk). When I use iostream.h in a simple program and compile with c++ everything works...
1
by: andrew | last post by:
Hi, I'm a C++ newbie, so apologies for this rather basic question. I've searched for help and, while I understand the problem (that the outer class is not yet defined), I don't understand what...
6
by: juglesh | last post by:
hello, I just want to be able to use a keypress to do the same as clicking a link. such as will 'click' a certain link, while will 'click' a different link. thanks for your time, juglesh ...
21
by: EmJayEm | last post by:
Can someone tell me the Disadvantages/Cons of web services? Thanks, EmJ.
42
by: kenneth.m.mcdonald | last post by:
First, I don't intend this to be a flame war, please. Python and Ruby are the only two languages I'd willingly work in (at least amongst common languages), and TurboGears and Rails seem roughly...
1
by: Ajb181 | last post by:
hi all. i have a template class that i can not link. there is no problem when i add the method def's inside the header file but as soon as i move them out i get a link error where i define the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.