473,386 Members | 1,908 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,386 software developers and data experts.

Visual C++ 6 Compilation Problem

Hi,
I am having problems compiling a small project in VC++ 6. I have
included the error below and the full project (including workspace) can
be downloaded here:
http://www.freebreakfast.co.uk/Example1.zip
I am new to C++ (esp. using multiple files) and I am not sure I have
structured the files right (with the correct includes etc). Any other
suggestions about the code would be greatly appreciated.
Also, how do I implement threading in C++. I have used threading in Java
before and so am familiar with the way in which they operate. Any
tutorials on the matter would be great. (I'm preferably looking for a
platform-independent solution but a Win32 method of doing this would
also be great)

Sorry for all the questions...

Thanks in advance,
Connell

Error Message which "Rebuilding All":
-------------------------------------

Compiling...
HeadNode.cpp
InternalNode.cpp
LinkedList.cpp
main.cpp
Node.cpp
ship.cpp
TailNode.cpp
Linking...
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
LinkedList<class Ship>::LinkedList<class Ship>(void)"
(??0?$LinkedList@VShip@@@@QAE@XZ)
main.obj : error LNK2001: unresolved external symbol "public: class Ship
* __thiscall LinkedList<class Ship>::GetNextObject(class Ship *)"
(?GetNextObject@?$LinkedList@VShip@@@@QAEPAVShip@@ PAV2@@Z)
main.obj : error LNK2001: unresolved external symbol "public: class Ship
* __thiscall LinkedList<class Ship>::GetFirstObject(void)"
(?GetFirstObject@?$LinkedList@VShip@@@@QAEPAVShip@ @XZ)
main.obj : error LNK2001: unresolved external symbol "public: void
__thiscall LinkedList<class Ship>::Insert(class Ship *)"
(?Insert@?$LinkedList@VShip@@@@QAEXPAVShip@@@Z)
Debug/Example1.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

Example1.exe - 5 error(s), 0 warning(s)
Jul 22 '05 #1
2 1490
On Wed, 21 Jul 2004 19:45:09 +0100, Connell Gauld
<co*****@freebreakfast.co.uk> wrote:
Hi,
I am having problems compiling a small project in VC++ 6. I have
included the error below and the full project (including workspace) can
be downloaded here:
http://www.freebreakfast.co.uk/Example1.zip
I am new to C++ (esp. using multiple files) and I am not sure I have
structured the files right (with the correct includes etc). Any other
suggestions about the code would be greatly appreciated.


Given that all your linker errors are template code this looks like the
classic template link error question. Probably the most commonly asked
question on this group.

You can find the answer in the FAQ

http://www.parashift.com/c++-faq-lit...html#faq-34.12

but the short answer is put all template code into header files.

john
Jul 22 '05 #2
On Wed, 21 Jul 2004 19:45:09 +0100, Connell Gauld wrote:
Also, how do I implement threading in C++. I have used threading in Java
before and so am familiar with the way in which they operate. Any
tutorials on the matter would be great. (I'm preferably looking for a
platform-independent solution but a Win32 method of doing this would
also be great)
The closest you're likely to get to platform-independent threads may be the
Boost libraries. See http://www.boost.org/ for details. I've also heard
some mention of ACE, but am not sure where to find it. For Win32 specific
methods, there are MS public newsgroups that would be better to ask in.
main.obj : error LNK2001: unresolved external symbol "public: __thiscall
LinkedList<class Ship>::LinkedList<class Ship>(void)"
(??0?$LinkedList@VShip@@@@QAE@XZ)


This isn't a compilation error, but a linking error. The problem is a very
common one involving templates. This is covered in the C++ FAQ found at
http://www.parashift.com/c++-faq-lite/ sections 34.12-34.15.

--
Greg Schmidt gr***@trawna.com
Trawna Publications http://www.trawna.com/
Jul 22 '05 #3

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

Similar topics

5
by: K. Shier | last post by:
when attempting to edit code in a class file, i see the bug "Visual Basic ..NET compiler is unable to recover from the following error: System Error &Hc0000005&(Visual Basic internal compiler...
1
by: Novice | last post by:
Hi all, I'm afraid this is the second posting of this information as I didn't get a response on the previous post. I will try to shorten my message (i.e. be more concise) in the hopes that it will...
26
by: Bruno Jouhier [MVP] | last post by:
I'm currently experiencing a strange phenomenon: At my Office, Visual Studio takes a very long time to compile our solution (more than 1 minute for the first project). At home, Visual Studio...
0
by: Bruno Jouhier [MVP] | last post by:
Last september, I posted a message about abnormal compilation times in Visual Studio .NET. I got some help from a nice guy from Sweden, who had the same problem and saw my post on the newsgroup....
15
by: Ken Allen | last post by:
I have been developing a suite of assemblies over the past couple of weeks, and this afternoon somethign started misbehaving. If I do not run the IDE and compiler the code from the command line,...
7
by: hihaho | last post by:
I had a template library, the library was successfully compiled on versrion 6.0 but when I tried to upgrade it in .NET version, compilation had failed with the message like: error C2248...
2
by: David++ | last post by:
Hi, I'm trying to compile a project in C++.Net which was built using Visual C++ 6. I'm getting some major compile errors and need to find a solution soon. I can either try and convert the...
13
by: jc | last post by:
I have written a parser using bison and flex to read ASAP2 file for CAN communications. entire development was done in an unix environment and now the code is ready to be integrated to an existing...
2
by: BobLaughland | last post by:
Hi All, I am using visual studio 2003 on a website I am developing on. I have it running inside a VM, and use IIS to host the website when I am viewing and debugging it. The problem is that...
4
by: Goran Djuranovic | last post by:
Hi all, I am experiencing a strange thing happening with a "designer.vb" page. Controls I manually declare in this page are automatically deleted after I drop another control on a ".aspx" page. -...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...

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.