Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
info - > error
Avatar
marga
Member
Members
January 18, 2016 - 2:02 am
Member Since: January 16, 2016
Forum Posts: 7
sp_UserOfflineSmall Offline

hi guys ,
I was following the module 4 to learn the management of text label but when I tried it , I get an error on varibile "info " exactly the point :
if ( info- > customViewName.compare ( " TextInfoLabel " ) == 0 ) { ... } . the error says, the expression must have the type and class
Error C2228 element to the left of ' .compare ' must be a class , structure or union .
if I change the condition that problems like this: if ( strcmp ( info- > customViewName , " TextInfoLabel " ) == 0 ) I get weird linker errors.
we are precisely in the function : void * __stdcall showGUI ( void * pInfo- )
case GUI_CUSTOMVIEW :

thanks to all in advance and thank to will Pirkle for this amazing and sophisticated development environment.Confused

Avatar
marga
Member
Members
January 18, 2016 - 3:26 am
Member Since: January 16, 2016
Forum Posts: 7
sp_UserOfflineSmall Offline

The linker error is due to the statement : CVSTGUIHelper m_GUIHelper ;
necessary to create the text label object :

Error LNK2001 external symbol " public: __thiscall CVSTGUIHelper :: CVSTGUIHelper ( void ) " (?? 0CVSTGUIHelper @@ QAE @ XZ )

Error LNK2001 external symbol " public: __thiscall CVSTGUIHelper :: ~ CVSTGUIHelper ( void ) " (?? 1CVSTGUIHelper @@ QAE @ XZ )

the statement is made in the file headers precisely in public section

Avatar
Tom
Admin
January 18, 2016 - 3:46 am
Member Since: April 3, 2014
Forum Posts: 74
sp_UserOfflineSmall Offline

Hi,

the changed code will not compile as the customViewName is just a pointer-to-char and thus can not provide methods to be called. You would have to copy both strings into an actual std::string object before using the .compare method.
Are you using the correct visual studio version / did you change the compiler version?
Did you accidentially delete the .cpp file where CVSTGUIHelper is implemented?
The linker error looks truncated to me - it usually should say where the not found symbol was referenced.

Avatar
marga
Member
Members
January 18, 2016 - 2:43 pm
Member Since: January 16, 2016
Forum Posts: 7
sp_UserOfflineSmall Offline

hello thank you for your answer , but I could not solve .
the problem isnt't on the condition ( if i declare first string variable in works) but he problem is : CVSTGUIHelper m_GUIHelper;

when i declare it ,the project don't compile because there are linker error. the file CVSTGUIHelper.cpp is present.i use 2015 visual studio community and I never had problems.

Avatar
marga
Member
Members
January 18, 2016 - 3:14 pm
Member Since: January 16, 2016
Forum Posts: 7
sp_UserOfflineSmall Offline

Fixed including file manually VSTGUIHelper.cpp the source file folder of the project ( from visual studio )

Avatar
W Pirkle
Admin
January 18, 2016 - 7:24 pm
Member Since: January 28, 2017
Forum Posts: 391
sp_UserOfflineSmall Offline

Adding the helper files to VS is covered in Module 2 of the tutorials (and yes, I made this a "manual" operation on purpose).

- Will

Forum Timezone: America/New_York

Most Users Ever Online: 152

Currently Online:
7 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 48

Derek: 46

Frodson: 45

Peter: 43

TheSmile: 43

clau_ste: 39

JimmyM: 33

Gwen: 32

EZB: 24

lppier: 23

Member Stats:

Guest Posters: 1

Members: 594

Moderators: 1

Admins: 4

Forum Stats:

Groups: 12

Forums: 37

Topics: 617

Posts: 2428

Newest Members:

channa, bvaccaro, HCassell, Max, Sim1, Chris Wade-Evans, Marlow, kcmixs2, DanieleR, jimjulian

Moderators: W Pirkle: 391

Administrators: Tom: 74, JD Young: 80, Will Pirkle: 0, W Pirkle: 391