By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 804 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

strange warnings

P: 12
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\xlocnum(590) : warning C4312: 'type cast' : conversion from 'uintptr_t' to 'void *' of greater size
1> C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(566) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std: :ios_base &,std::ios_base::iostate &,void *&) const'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>,
1> _InIt=std::istreambuf_iterator<char,std::char_trai ts<char>>
1> ]
1> C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1365) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
1> with
1> [
1> _Elem=char,
1> _InIt=std::istreambuf_iterator<char,std::char_trai ts<char>>
1> ]
1>C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(590) : warning C4312: 'type cast' : conversion from 'uintptr_t' to 'void *' of greater size
1> C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(566) : while compiling class template member function 'std::istreambuf_iterator<_Elem,_Traits> std::num_get<_Elem,_InIt>::do_get(_InIt,_InIt,std: :ios_base &,std::ios_base::iostate &,void *&) const'
1> with
1> [
1> _Elem=wchar_t,
1> _Traits=std::char_traits<wchar_t>,
1> _InIt=std::istreambuf_iterator<wchar_t,std::char_t raits<wchar_t>>
1> ]
1> C:\Program Files\Microsoft Visual Studio 8\VC\include\xlocnum(1371) : see reference to class template instantiation 'std::num_get<_Elem,_InIt>' being compiled
1> with
1> [
1> _Elem=wchar_t,
1> _InIt=std::istreambuf_iterator<wchar_t,std::char_t raits<wchar_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\BuildLog.htm"
1>sdl - 0 error(s), 2 warning(s)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Sep 16 '06 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,916
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
Sep 16 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.