C++: [cpptasks:cc] s.obj : error LNK2001: unresolved external symbol "public: static void __cdecl CA::Start(struct CRC *)" (?Start@CA@@SAXPAUCRC@@@Z)

Hey there,

I have a Crash Reporter that works in new VC2008, but I wanted to use it in ANT which is using the older VC++ compiler  (VS1998?) But I'm left with this issue:

[cpptasks:cc] s.obj : error LNK2001: unresolved external symbol "public: static
 void __cdecl CA::Start(struct CRC *)" (?Start@CA@@SAXPAUCRC@@@Z)


IN CR.cpp
CRC CA::controls;
.
.
.
.

static void CA::Start(CRC *input)
{
      memcpy(&controls, input, sizeof(CRC));
}

IN CR.h

class CA
{
public:
      static void Start(CRC *input);
      static CRC controls;
};

struct CRC
{
.
.
.
. (Don't think you need this just that its there.)
}

Where it is being called:

      CRC crashRc;
      crashRc.actionToTake= AOC_SILENT_MODE; /* Just write the file. Don't prompt */
      strncpy(crashRc.appName, "S TEST", sizeof(crashRc.appName)-1);
      strncpy(crashRc.appVersion, S_VERSION_STRING, sizeof(crashRc.appVersion)-1);
      crashRc.pathToMinidump[0]= 0; /* Write to current directory */
      crashRc.minidumpType= MiniDumpWithDataSegs;
      CA::Start(&crashRc);


... Gives me the error. I think its a basic error somewhere but I am not sure whats going on as it works fine in the new compiler in VC2008

Any suggestions?
LVL 7
VallerianiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

evilrixSenior Software Engineer (Avast)Commented:
>> I wanted to use it in ANT which is using the older VC++ compiler  (VS1998?)
That is like 5 years before the current C++ standard! My advice is to upgrade that compiler don't worry about trying to fix this issue!
0
evilrixSenior Software Engineer (Avast)Commented:
Just a guess, but if you want to fix it try changing as follows...



class CA
{
public:
      static void Start(struct CRC *input);
      static CRC controls;
};

void CA::Start(struct CRC *input)
{
      memcpy(&controls, input, sizeof(CRC));
}

Open in new window

0
VallerianiAuthor Commented:
I need to get it solved becuase theres a few bugs in the old version (working on a new version right now with the new VS2008+) but it wont be released for a few months. Theres only one or two 'crashes' left that are experienced on random computers, this crash system lets me know everything.

I don't really want to do this overall but I wanted to give the clients who are getting issues on the client fixed up even if its just a temp solution for now :) Kinda crappy though!

I will give this a test, thank you.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

evilrixSenior Software Engineer (Avast)Commented:
>> I will give this a test, thank you.
Ok, like I said it was only a guess -- I have no way to recreate your problem I'm afraid :(
0
VallerianiAuthor Commented:
No worries, unfort didn't work but I will keep trying at it.

It's a odd one though. I really dislike the old compiler for sure now :P Very happy I moved to the new standards. I hate going down in standards just to fix a bug, but I suppose I should do it to help out. Just wish I got the error there getting. Rats :P

0
evilrixSenior Software Engineer (Avast)Commented:
Silly Q but you are linking in the object file, right? >:)

What might help is if you can refine it down to a small section of code. In other words copy that small bit of code into something that can be built stand alone and remove all code that works until you get to an example that doesn't. If it's still not clear what the issue is post that example here and we can look at it for you.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
VallerianiAuthor Commented:
Hehe yeah it is linked :)

I will give that a try and post how it goes, thanks!
0
VallerianiAuthor Commented:
God damit, you know what it was?

even t hough the .h was being included, .cpp was not.  I have it set to get any files that start with S_ for cpp files. and this file was s_ .. undercased. So it never linked. I checked all the obj files and realized it wasn't there. Ugh :P


Complete brain fart on my end for sure, thanks for the help, made me think about it a second time :P
0
VallerianiAuthor Commented:
500 for me being an idiot ;)
0
evilrixSenior Software Engineer (Avast)Commented:
Heh. Absolutely no worries... just glad we solved it :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.