strange warnings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stromhau
    New Member
    • Sep 2006
    • 12

    strange warnings

    Ok, i have a file with main and an additional .cpp file i include in the main file but i get a lot of strange warnings when including. Both files compile just great separately. It seems that it have something to do with the inclusions of header files.

    Here are the files i include in main.cpp file
    #include "SDL.h" // SDL: window & input library
    #include "SDL_opengl .h" // platform independent OpenGL include
    #include "Polygonstruct. cpp"
    #include <stdio.h>
    #include <stdlib.h>

    Polygonstruct is my other class file and have these includes

    #include <vector>
    #include <iostream>
    #include <fstream>
    #include <string.h>
    #include <math.h>

    Any suggestions ?
    Tommy,

    Here are the warnings ;

    1>------ Build started: Project: sdl, Configuration: Release Win32 ------
    1>Compiling...
    1>Project.cpp
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include\xl ocnum(590) : warning C4312: 'type cast' : conversion from 'uintptr_t' to 'void *' of greater size
    1> C:\Program Files\Microsoft Visual Studio 8\VC\include\xl ocnum(566) : while compiling class template member function 'std::istreambu f_iterator<_Ele m,_Traits> std::num_get<_E lem,_InIt>::do_ get(_InIt,_InIt ,std::ios_base &,std::ios_base ::iostate &,void *&) const'
    1> with
    1> [
    1> _Elem=char,
    1> _Traits=std::ch ar_traits<char> ,
    1> _InIt=std::istr eambuf_iterator <char,std::char _traits<char>>
    1> ]
    1> C:\Program Files\Microsoft Visual Studio 8\VC\include\xl ocnum(1365) : see reference to class template instantiation 'std::num_get<_ Elem,_InIt>' being compiled
    1> with
    1> [
    1> _Elem=char,
    1> _InIt=std::istr eambuf_iterator <char,std::char _traits<char>>
    1> ]
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include\xl ocnum(590) : warning C4312: 'type cast' : conversion from 'uintptr_t' to 'void *' of greater size
    1> C:\Program Files\Microsoft Visual Studio 8\VC\include\xl ocnum(566) : while compiling class template member function 'std::istreambu f_iterator<_Ele m,_Traits> std::num_get<_E lem,_InIt>::do_ get(_InIt,_InIt ,std::ios_base &,std::ios_base ::iostate &,void *&) const'
    1> with
    1> [
    1> _Elem=wchar_t,
    1> _Traits=std::ch ar_traits<wchar _t>,
    1> _InIt=std::istr eambuf_iterator <wchar_t,std::c har_traits<wcha r_t>>
    1> ]
    1> C:\Program Files\Microsoft Visual Studio 8\VC\include\xl ocnum(1371) : see reference to class template instantiation 'std::num_get<_ Elem,_InIt>' being compiled
    1> with
    1> [
    1> _Elem=wchar_t,
    1> _InIt=std::istr eambuf_iterator <wchar_t,std::c har_traits<wcha r_t>>
    1> ]
    1>Polygonstruct .cpp
    1>Linking...
    1>Generating code
    1>Finished generating code
    1>Embedding manifest...
    1>Build log was saved at "file://e:\c++\sdl\sdl\ Release\BuildLo g.htm"
    1>sdl - 0 error(s), 2 warning(s)
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    cpp files should really be included, it is bad form. You should compile the second cpp file and then link the 2 files together.

    cc -c 1.cpp
    cc -c 2.cpp
    link 1.obj 2.obj

    Comment

    Working...