Jump to content
Sign in to follow this  
art590

Are Const Members Supported?

Recommended Posts

Hello.

I am wondering if "const int" or "static const int" class members are supported ? Compiles ok but linker doesn't seem to be able to resolve. I tried with both in class and out of class initialization.

 

Any help would be much appreciated.

 

...

success
"C:\Program Files\SourceBoost\boostlink_picmicro.exe" -idx 1 /ld "C:\Program Files\SourceBoost\lib" libc.pic16.lib Debug\member_constant.obj /t PIC16F84 /d "Debug" /p member_constant
Error: Failed to resolve external:Foo$a
Error: Failed to resolve external:Foo$a
BoostLink Optimizing Linker Version 7.30
Copyright© 2004-2015 Pavel Baranov
Copyright© 2004-2015 David Hobday
failure
Failed to locate output file 'Debug\member_constant.hex'
Done
Failed

 

-----------------------------------------------------------------------------------

class Foo{
static const int a=0x08;
public:
int xPlus8(int x){ return (a+x); };
};
Foo foo;
void main()
{
int res;
res = foo.xPlus8(10);
}

 

 

 

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×