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 sp_TopicIcon
info - > error
No permission to create posts
January 18, 2016
2:02 am
Avatar
marga
Member
Members
Forum Posts: 7
Member Since:
January 16, 2016
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

January 18, 2016
3:26 am
Avatar
marga
Member
Members
Forum Posts: 7
Member Since:
January 16, 2016
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

January 18, 2016
3:46 am
Avatar
Tom
Admin
Forum Posts: 65
Member Since:
April 3, 2014
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.

January 18, 2016
2:43 pm
Avatar
marga
Member
Members
Forum Posts: 7
Member Since:
January 16, 2016
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.

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

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

January 18, 2016
7:24 pm
Avatar
W Pirkle
Admin
Forum Posts: 143
Member Since:
January 28, 2017
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: 36

Currently Online:
3 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Skyler: 47

Peter: 41

Derek: 41

clau_ste: 39

Frodson: 38

Gwen: 32

EZB: 24

lppier: 23

Msaldaña: 18

Jorge: 17

Member Stats:

Guest Posters: 1

Members: 476

Moderators: 1

Admins: 4

Forum Stats:

Groups: 11

Forums: 30

Topics: 482

Posts: 1876

Newest Members:

sam, annaharris, Marie Weaver, kev, Steven, Mr Anderson, mguy, omelc

Moderators: W Pirkle: 143

Administrators: Tom: 65, JD Young: 80, Will Pirkle: 0, W Pirkle: 143