Compile error

51 views
Skip to first unread message

William Maybaum

unread,
Nov 28, 2012, 10:32:09 AM11/28/12
to andro...@googlegroups.com
Hi All,
 
I have upgraded to r8c from r8b, Now I get the following error on the malloc.

   Context    *context = (Context*)malloc(sizeof(Context))

I would appreciate ideas on correcting the problem.

Thanks,

Bill Maybaum

SignaKey

 

Christian Linne

unread,
Nov 28, 2012, 10:45:05 AM11/28/12
to andro...@googlegroups.com
Hey Bill,

Besides the aspect that using malloc for an object is (in general) a very bad idea – I don't see any error message in your post, did you forget about it ?
-- 
Mit freundlichen Grüßen
Yours sincerely

Christian Linne

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.

William Maybaum

unread,
Nov 28, 2012, 10:48:37 AM11/28/12
to andro...@googlegroups.com
The error is "Invalid arguments' when I place the cursor on the error the suggested fix it (void*).
Thanks,
Bill

David Given

unread,
Nov 28, 2012, 10:54:35 AM11/28/12
to andro...@googlegroups.com
William Maybaum wrote:
> The error is "Invalid arguments' when I place the cursor on the error
> the suggested fix it (void*).

Yes, but what's the actual error produced when you try to compile it?

--
┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
│ "There is nothing in the world so dangerous --- and I mean *nothing*
│ --- as a children's story that happens to be true." --- Master Li Kao,
│ _The Bridge of Birds_

signature.asc

William Maybaum

unread,
Nov 28, 2012, 11:14:36 AM11/28/12
to andro...@googlegroups.com
I am attaching a screen shot of the output.
Android error.jpg

David Given

unread,
Nov 28, 2012, 11:18:46 AM11/28/12
to andro...@googlegroups.com
William Maybaum wrote:
> I am attaching a screen shot of the output.

Oh, I see the confusion --- you're looking at the IDE rather than the
actual compilation log. The IDE is mangling the error messages, which is
why you're not seeing what's actually going on. You need to find what
the compiler is actually saying, which is probably going to be somewhere
in the Console tab.
signature.asc

William Maybaum

unread,
Nov 28, 2012, 11:26:21 AM11/28/12
to andro...@googlegroups.com
I am attaching the console ouput. I scanned looking for "error" and found none.
 
Thanks,
Bill

Android Log file 11-27.txt

David Given

unread,
Nov 28, 2012, 11:39:57 AM11/28/12
to andro...@googlegroups.com
William Maybaum wrote:
> I am attaching the console ouput. I scanned looking for "error" and
> found none.

That's because there weren't any --- it compiled and linked fine. (If
you look at the bottom of the log you can see it copying the compiled
.so into your package.)

So the real question is why your IDE is reporting an error when the
compilation itself isn't producing any. I'm afraid I don't build via an
IDE, so I can't help there. It's probably worth making sure that the
project is using the right NDK directory. It's also always useful to do
a complete clean and rebuild, just in case the IDE has gotten confused
(which happens a lot, and is one of the reasons why I don't build via an
IDE).
signature.asc

William Maybaum

unread,
Nov 28, 2012, 11:46:05 AM11/28/12
to andro...@googlegroups.com
Thanks for the assistance. I will look into the IDE and see what I can determine as to the problem. I have been using the Motodev environment to simplify the development environment. If you have another approach I would be happy the hear it and give it a try.
 
Thanks,
Bill

Tim Mensch

unread,
Nov 28, 2012, 1:12:52 PM11/28/12
to andro...@googlegroups.com
It's Eclipse, which is...notorious for having issues like this, especially with C++.

Try "deleting" the error and see if it gets regenerated. I've had that fix issues before.

Though really if it's C++ you should just say "new Context".

Tim

William Maybaum

unread,
Nov 28, 2012, 1:15:53 PM11/28/12
to andro...@googlegroups.com
Hi Tim,
 
I deleted the .metadata from the project then imported it again. It seems there was some artifacts to clean up when I made the change. I appreciate the assistance.
 
Bill

Reply all
Reply to author
Forward
0 new messages