Compile Error: Incomplete Type

This is a discussion on Compile Error: Incomplete Type within the C Programming forums, part of the General Programming Boards category; Hi All- I am using Eclipse and trying to build a release version of a program I have written in ...

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    3

    Question Compile Error: Incomplete Type

    Hi All-

    I am using Eclipse and trying to build a release version of a program I have written in ANSI C for a project. I am able to get it to build as a Debug version with just a couple of warnings but when I do a release version I get a lot more errors and no build. Here is the output from the full (release) version of the build:

    **** Clean-only build of configuration Release for project UpdateSysState ****

    make clean
    rm -rf ./src/upd_sys_st.o ./src/upd_sys_st.d UpdateSysState


    **** Build of configuration Release for project UpdateSysState ****

    make all
    Building file: ../src/upd_sys_st.c
    Invoking: GCC C Compiler
    gcc -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/upd_sys_st.d" -MT"src/upd_sys_st.d" -o"src/upd_sys_st.o" "../src/upd_sys_st.c"
    In file included from ../src/upd_sys_st.c:22:
    /usr/include/mysql.h:113: error: field ‘type’ has incomplete type
    /usr/include/mysql.h:149: error: expected specifier-qualifier-list before ‘MEM_ROOT’
    /usr/include/mysql.h:253: error: expected specifier-qualifier-list before ‘NET’
    /usr/include/mysql.h:316: error: expected specifier-qualifier-list before ‘MEM_ROOT’
    /usr/include/mysql.h:342: error: expected specifier-qualifier-list before ‘NET’
    /usr/include/mysql.h:660: error: field ‘buffer_type’ has incomplete type
    /usr/include/mysql.h:672: error: expected ‘)’ before ‘*’ token
    /usr/include/mysql.h:673: error: expected ‘;’ before ‘void’
    /usr/include/mysql.h:683: error: expected specifier-qualifier-list before ‘MEM_ROOT’
    ../src/upd_sys_st.c: In function ‘main’:
    ../src/upd_sys_st.c:97: warning: implicit declaration of function ‘my_init’
    ../src/upd_sys_st.c:98: warning: implicit declaration of function ‘load_defaults’
    ../src/upd_sys_st.c:196: warning: assignment makes integer from pointer without a cast
    make: *** [src/upd_sys_st.o] Error 1

    All the errors related to mysql.h I have no control over... They are part of the header file for MySQL that I need. The warnings are invalid, as these are functions used by mysql and should also be included... At least I am able to call them from a Debug version. Here is the output I get when I do that:

    **** Build of configuration Debug for project UpdateSysState ****

    make all
    Building file: ../src/upd_sys_st.c
    Invoking: GCC C Compiler
    gcc -I/usr/include/mysql -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/upd_sys_st.d" -MT"src/upd_sys_st.d" -o"src/upd_sys_st.o" "../src/upd_sys_st.c"
    ../src/upd_sys_st.c: In function ‘main’:
    ../src/upd_sys_st.c:98: warning: passing argument 2 of ‘load_defaults’ from incompatible pointer type
    ../src/upd_sys_st.c:196: warning: assignment makes integer from pointer without a cast
    Finished building: ../src/upd_sys_st.c

    Building target: UpdateSysState
    Invoking: GCC C Linker
    gcc -o"UpdateSysState" ./src/upd_sys_st.o -lmysqlclient
    Finished building target: UpdateSysState


    Can anyone give me an idea of what might be causing this, or some options to make the compiler less anal-retentive here?

    Thanks,
    Eric

  2. #2
    Registered User
    Join Date
    Jul 2008
    Posts
    3
    OK, looking at the compiler commands, it looks like the release version is not looking for the libraries that are included with the debug version... As well as the optimization is different. I would still appreciate any thoughts.

    -E

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    3
    Nevermind, got it working. Nice forums though, I will remember this.

    -E

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 03-20-2008, 08:59 AM
  2. Question on l-values.
    By Hulag in forum C++ Programming
    Replies: 6
    Last Post: 10-13-2005, 05:33 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  4. Dynamic array of pointers
    By csisz3r in forum C Programming
    Replies: 8
    Last Post: 09-25-2005, 03:06 PM
  5. pointer to array of objects of struct
    By undisputed007 in forum C++ Programming
    Replies: 12
    Last Post: 03-02-2004, 04:49 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21