Jump to content
  • Advertisement
Sign in to follow this  
__ROB_D__

[VC++6] Strange Linker Error! [Done]

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I've got this Strange Error! I'm using VC6, my code compiles but the Linking Fails! Have the feeling this is something simple I've over looked! But I'll explane... Main.cpp
#include <String.h>

void main()
  {
  int Length;
  char Name[] = "Some Stupid Error!"
  Length = Str::Length(Name);
  }



String.h
#ifndef __ROB_STRING_H__
#define __ROB_STRING_H__

namespace Str{
  int Length(char *);
  }

class MyString_c
  {
  .. Class Stuff Here! ..
  }

#endif



String.cpp
#include <String.h>

namespace Str{
  int Length(char *A)
    {
    .. Code Guts ..
    }
  }

int MyString_c::FunctionX()
  {
  return(Str::Length(Something));
  }




So there's the Code snipits, It compiles fine. The MyString_c::FunctionX() call the Str::Length() works can be steped throught with the Debugger... But when I call Str::Length() in Main.cpp, it compilers but get linker error LNK2001 unresolved extern... So basically the Str::Length fails when I call it from anywhere! Except String.cpp IDEA: Bet it's cos I call the file String.h/.cpp Rob:-D [Edited by - __ROB_D__ on August 23, 2005 5:56:14 PM]

Share this post


Link to post
Share on other sites
Advertisement
It was a STUPID Error! [imwithstupid]

Link problem because I called My File, String.h and String.cpp...

But Fixed NOW...

Hum, I should Delete this post try to save face!

Rob:-D

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!