473,888 Members | 1,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

strange warnings

12 New Member
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 ==========
Sep 16 '06 #1
1 2718
Banfa
9,065 Recognized Expert Moderator Expert
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
1608
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 MySQL result resource" and the result set returned is empty (for queries other than select). Strangely, my die function includes the query but the query is not printed. I've however printed the queries before executing and they are fine too. Can...
10
2447
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 warnings in the older 5.1 compiler. Since the latest compiler produces a warning, it makes me suspecious about my own code. I still cannot find any problems with it though. It essentially produces a warning whenever a copy constructor of a class with...
1
2123
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 don't understand. Isn't the "const int *" construct in the signature of func1 a hint for the user, that func1 doesn't modify **arg? Why then is it dangerous to pass an alterable argmument?
6
1512
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 = 0; if(a == 0) {
24
2323
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 change the coding to fprintf(point_file, "CONTOUR\nCLOSE\n%u\n", curve.size());
28
2159
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 code will *not* compile: double d=15.95; int n= static_cast<int(d);
17
1880
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: ============================ #include <stdio.h> void fcn (char *str)
2
1910
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
2731
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
9961
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9800
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10439
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7990
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5817
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4244
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3252
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.