?
Solved

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

Posted on 2010-03-25
10
Medium Priority
?
674 Views
Last Modified: 2012-05-09
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?
0
Comment
Question by:Valleriani
  • 5
  • 5
10 Comments
 
LVL 40

Expert Comment

by:evilrix
ID: 28564548
>> 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
 
LVL 40

Expert Comment

by:evilrix
ID: 28564835
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
 
LVL 7

Author Comment

by:Valleriani
ID: 28565306
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 new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 40

Expert Comment

by:evilrix
ID: 28565526
>> 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
 
LVL 7

Author Comment

by:Valleriani
ID: 28565835
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
 
LVL 40

Accepted Solution

by:
evilrix earned 2000 total points
ID: 28566148
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
 
LVL 7

Author Comment

by:Valleriani
ID: 28566513
Hehe yeah it is linked :)

I will give that a try and post how it goes, thanks!
0
 
LVL 7

Author Comment

by:Valleriani
ID: 28567017
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
 
LVL 7

Author Closing Comment

by:Valleriani
ID: 31707098
500 for me being an idiot ;)
0
 
LVL 40

Expert Comment

by:evilrix
ID: 28567189
Heh. Absolutely no worries... just glad we solved it :)
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Today, unlike web development, the mobile landscape is complex enough for a software engineer and Android is posing more challenging environment thanks to its fragmentation issues on hardware and software fronts.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

592 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question