Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Programming Talk / C++ / C# - Trying to use vectors gives linking errors

Author
Message
tneva82
18
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 15th May 2008 15:40 Edited at: 15th May 2008 15:42
Basicly: I add vector to program and try to compile and following linker errors come. Anybody ideas how I could get them working? VS2008 express edition is the programming software I'm using for this C++ code.



Hopefully somebody has some idea what these messages are for. Shouldn't vectors being easy to add to program? What with them being STL and all?
jinzai
19
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 15th May 2008 16:34
1. It is because are mixing debug and release libraries. Libraries that end with the letter d are debug libraries.

2. vectors use templates because they are essentially dimensionless arrays of an undetermined type as they exist in the library. When you declare them, STL can then mock-up the standard access to them, since they will have a size in the template, along with a definition of them.

3. STL is the C++ mechanism for using templated code. It exists for all C++ that supports STL so that different systems can use the same type of code, making the source capable of being written to the standard, and not the particular hardware it is written on. That makes cross-platform code much easier to write.
tneva82
18
Years of Service
User Offline
Joined: 7th May 2008
Location:
Posted: 15th May 2008 20:14
Quote: "1. It is because are mixing debug and release libraries. Libraries that end with the letter d are debug libraries."


Ok. So how does one go fixing it? Preferably so that VS2008 rookie(or IDE rookie in general) understands

One of them out but how?
Echooff3
18
Years of Service
User Offline
Joined: 3rd Jun 2008
Location:
Posted: 9th Jun 2008 02:12
I was able to get it to compile by changing the compile from Debug to Release.

Login to post a reply

Server time is: 2026-06-10 09:31:54
Your offset time is: 2026-06-10 09:31:54