Thread: invalid conversion from (void *) to unsigned char

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    5

    invalid conversion from (void *) to unsigned char

    Hello!

    I'm having trouble compiling my application. I was using gcc to compile the code, but now i have to compile it using g++...
    But when using g++, i always get the error "invalid conversion from void* to unsigned char"...

    I know, that the g++ compiler is ment for C++...

    I'f you require the code, I would be happy to post it.

    Is there a straight-forward solution for my problem?

    thanks

    Rok

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Post the smallest and simplest program that demonstrates the problem. Chances are you need to use a cast where C allows an implicit conversion from void*, but that is for a conversion from void* to a pointer type, not unsigned char.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 05-13-2007, 08:55 AM
  2. Heap corruption using zlib inflate
    By The Wazaa in forum C++ Programming
    Replies: 0
    Last Post: 03-29-2007, 12:43 PM
  3. Need help understanding info in a header file
    By hicpics in forum C Programming
    Replies: 8
    Last Post: 12-02-2005, 12:36 PM
  4. Can't Find Conio.h?
    By drdroid in forum C++ Programming
    Replies: 27
    Last Post: 09-26-2002, 04:24 AM
  5. simulate Grep command in Unix using C
    By laxmi in forum C Programming
    Replies: 6
    Last Post: 05-10-2002, 04:10 PM