Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: why i cannot use extern array in iOS app.(c++)


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Feb 13, 2016 8:26 PM Last Post By: Sheng Yin
Sheng Yin

Posts: 6
Registered: 1/8/16
why i cannot use extern array in iOS app.(c++)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 30, 2016 8:01 PM
I declared follow array in head file.

extern short sample_12_2250[12*2250];

and define a array in cpp file

short sample_12_2250[12*2250] = {0,1,2,.......};

but when I use the array as follow, iOS while occur error

char* m_pBuffer = new char[12*2250* sizeof(short)];
memcpy(m_pBuffer, sample_12_2250, 12*2250* sizeof(short));
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: why i cannot use extern array in iOS app.(c++)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 30, 2016 10:13 PM   in response to: Sheng Yin in response to: Sheng Yin
Sheng wrote:

but when I use the array as follow, iOS while occur error

What is the actual error message?

--
Remy Lebeau (TeamB)
Sheng Yin

Posts: 6
Registered: 1/8/16
Re: why i cannot use extern array in iOS app.(c++)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 30, 2016 10:39 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Sheng wrote:

but when I use the array as follow, iOS while occur error

What is the actual error message?

--
Remy Lebeau (TeamB)

In IDE , run with debug,

[Exec Error] The command ""c:\program files (x86)\embarcadero\studio\17.0\bin\dsymlink.exe" "E:\temp\xe10\sample\iOSDevice32\Debug\sample"" exited with code 3.

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: why i cannot use extern array in iOS app.(c++)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 1, 2016 11:05 AM   in response to: Sheng Yin in response to: Sheng Yin
Sheng wrote:

In IDE , run with debug,

[Exec Error] The command ""c:\program files
(x86)\embarcadero\studio\17.0\bin\dsymlink.exe"
"E:\temp\xe10\sample\iOSDevice32\Debug\sample""
exited with code 3.

What makes you think that is related to your extern'ed array? Please be
more specific.

--
Remy Lebeau (TeamB)
Sheng Yin

Posts: 6
Registered: 1/8/16
Re: why i cannot use extern array in iOS app.(c++)  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 13, 2016 8:26 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Sheng wrote:

In IDE , run with debug,

[Exec Error] The command ""c:\program files
(x86)\embarcadero\studio\17.0\bin\dsymlink.exe"
"E:\temp\xe10\sample\iOSDevice32\Debug\sample""
exited with code 3.

What makes you think that is related to your extern'ed array? Please be
more specific.

--
Remy Lebeau (TeamB)

Because I change the code like this, the App is Ok.

char* m_pBuffer = new char[12*2250* sizeof(short)];
//memcpy(m_pBuffer, sample_12_2250, 12*2250* sizeof(short));
memset(m_pBuffer, 0, 12*2250* sizeof(short));

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02