Old 05-02-2008, 04:10 PM   #1
Deric
Human being with feelings
 
Join Date: Mar 2007
Posts: 794
Default Unresolved external symbol (and no .OBJ file)

Hi,

I'm now trying to get my 01X map to appear as a separate map (previously it had been seen as csurf_MCU.cpp, now I want it to be csurf_01X.cpp).

I've edited, and added, entries where I can see they need to be/go but when compiling I get:

Code:
csurf_main.obj: error LNK2001: unresolved external symbol 
"struct reaper_csurf_reg_t csurf_01X_reg" (?csurf_01X_reg@@3Ureaper_csurf_reg_t@@A)
../Debug/Plugins/reaper_csurf.dll : fatal error LNK1120: 1 unresolved externals
I've included the following in csurf.h:
Code:
csurf_01X_reg
and the following in csurf_main.cpp:
Code:
rec->Register("csurf",&csurf_01X_reg);
I've changed the name of the Class (in csurf_01X.cpp) to:
Code:
class CSurf_01X;
as well as :

Code:
reaper_csurf_reg_t csurf_01X_reg = 
{
  "01X",
  "YAMAHA 01X",
  createFunc,
  configFunc,
};
When I look in VS2005 'Solution Explorer' window I do NOT see csurf_01X.cpp in the list of 'csurfs'.

When I look in sdk\jmde\csurf\Debug\ there is NO csurf_01X.obj in the directory.

I appreciate this may be a 'needle in a haystack' kind of question... but can anyone please help by giving me some useful suggestions of where/what I need to check in order to include csurf_01X.cpp in the list?

Any ideas? Please!

Thanks in advance

Deric.

Edit: To add... When running Build, csurf_01x.cpp does NOT show up in the list of .cpps - it only appears under 'Linking' after the compiler has gone through:
'Generating Code...'
Compliling Resources...'
'Compliling Manifest to resources...'
'Linking...'
Creating library .\Debug/reaper_csurf.lib and object .\Debug/reaper_csurf.exp
(then I get the above errors)
__________________
REAPER? Oh yes...

Last edited by Deric; 05-02-2008 at 04:44 PM. Reason: Added, possibly relevant, info.
Deric is offline   Reply With Quote
Old 05-02-2008, 05:16 PM   #2
Deric
Human being with feelings
 
Join Date: Mar 2007
Posts: 794
Default

Perhaps(?) my question should be:

How do I correctly register a new .cpp into an existing project?

(I've tried a few online searches etc as well as looking through a book).
__________________
REAPER? Oh yes...
Deric is offline   Reply With Quote
Old 05-02-2008, 05:39 PM   #3
mbncp
Human being with feelings
 
Join Date: Mar 2008
Posts: 197
Default

I guess by using Project|add existing item.. and select your new cpp.

If you make multiple projects with pretty much always the same files, you can create new configs and then exclude some files from the different builds (right click a file, property, exclude from build yes)
mbncp is offline   Reply With Quote
Old 05-02-2008, 05:58 PM   #4
Deric
Human being with feelings
 
Join Date: Mar 2007
Posts: 794
Default

Thanks mbncp,

Yes I was just coming back to post! You are right - I 'needed' to right-click the 'csurfs' directory in the 'Solution Explorer' window (of VS) and select 'Add'->'Existing Item' and just needed to select my csurf_01X.cpp.

Many thanks for responding.

I now have some new errors but that's not unusual lately!
__________________
REAPER? Oh yes...
Deric is offline   Reply With Quote
Old 05-02-2008, 05:59 PM   #5
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,750
Default

It should work just to drag the file directly into the project in the solution explorer, too.
schwa is offline   Reply With Quote
Old 05-02-2008, 07:37 PM   #6
Deric
Human being with feelings
 
Join Date: Mar 2007
Posts: 794
Default

Hey! Great! I now can select 'YAMAHA 01X' from the control surface menu! I'm really pleased!

(have a few (seemingly) minor issues with LEDs no longer illuminating - but otherwise all the functions seem to be working!)


Quote:
Originally Posted by schwa View Post
It should work just to drag the file directly into the project in the solution explorer, too.
Thanks for this schwa, as you can no doubt tell, this all a bit new, I still haven't much of an idea, and am new to the environment (VS) as a tool let alone an app.).

I appreciate all and any help I get here as a lot of the time I don't know whether something not happening is due to a Command/Function I need to add or an operation on VS...

Cheers all!
__________________
REAPER? Oh yes...
Deric is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 02:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.