472,993 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,993 software developers and data experts.

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\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
1 2662
Banfa
9,065 Expert Mod 8TB
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

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

Similar topics

2
by: asra_baig | last post by:
I have a MySQL database and I'm able to access it correctly. I am also able to execute select, update and insert queries, however I am getting warnings saying: "supplied argument is not a valid...
10
by: Sony Antony | last post by:
I have the following simple program in Solaris Forte compiler 5.4 producing the warning. Though it produces the warning, it works fine as expected. This has been compiling fine without any...
1
by: george doubleu | last post by:
hi, i'm using "gcc version 3.3.3 (Debian)" to compile the program pasted below. I get the two warnings you can see in the remarks. The second warning is perfectly OK for me, but the first one I...
6
by: Chad | last post by:
I'm not too sure if the question would fall under comp.lang.c or some kind of compiler newsgroup. I'm going to ask anyhow. Given the following: #include <stdio.h> int main(void) { int a =...
24
by: asdf | last post by:
I got a warning from the following statement: fprintf(point_file, "CONTOUR\nCLOSE\n%d\n", curve.size()); warning: format '%d' expects type 'int', but argument 3 has type 'size_t' should I...
28
by: charlie | last post by:
Hi, I found an article on informit.com that talks about C++ casts http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=285&rl=1 The strange thing is the author says the following...
17
by: matevzb | last post by:
I've ran into some fishy code that, at first glance, is buggy, but it seems to work correctly and none of the compilers I've tried (five so far, on various systems) gives any warnings. The code:...
2
by: Chris Peters | last post by:
Hi, I'm using some Fortran 77 code together with C, and the compiler is giving me some strange warnings. Can anyone help explain what's going on? The code runs just fine. 1) Fortran code
1
by: raylopez99 | last post by:
The below did not set off my compiler, perhaps because I set the warnings to a higher (less nag) level. Strange. FYI, no question being asked. RL double d2030;
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.