473,396 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Cancelio( ) function

4
I'm trying to compile a C++ program and I'm getting the error:

implicit declaration of function 'int CancelIo(...)'

if it will help it's a program for using USB.

If anyone has any ideas that would be great. Thanks.
Feb 21 '08 #1
3 2681
Laharl
849 Expert 512MB
That error means you're trying to use a function whose prototype the compiler doesn't recognize, so it assumes you're returning an integer. Since you are returning an int, you can /technically/ get away without #including or writing the prototype if you have dire speed or size requirements, but it's not recommended if you can possibly avoid it. Meaning 99.999999% of the time, just #include.

To give you an example,
Expand|Select|Wrap|Line Numbers
  1. int main(int argc, char** argv){
  2.  int a = atoi(argv[1]);
  3.  return 0;
  4. }
  5.  
This gives the same warning because <cstdio> has not been #included, so the compiler doesn't recognize it, but it can generate calling code anyway since it assumes an integer return type. Luckily, atoi() returns an int, so you can get away with this, but you really shouldn't try. Like ever.
Feb 21 '08 #2
weaknessforcats
9,208 Expert Mod 8TB
This gives the same warning because <cstdio> has not been #included, so the compiler doesn't recognize it, but it can generate calling code anyway since it assumes an integer return type.
What C++ compiler does that?? Function prototypes are required in C++ for all functions except main(). Your C++ compil;er shoulod produce an error

What you say may be true of C but not C++.
Feb 23 '08 #3
Laharl
849 Expert 512MB
What C++ compiler does that?? Function prototypes are required in C++ for all functions except main(). Your C++ compil;er shoulod produce an error

What you say may be true of C but not C++.
That's what I get for assuming C ~= C++ at too broad of a level...
Feb 23 '08 #4

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

Similar topics

12
by: ORC | last post by:
Shouldn't 'ReadFile' block when timeouts are specified even when running in overlapped mode or am I wrong ??? Thanks Ole
6
by: Ken | last post by:
When running a program in the debugger, what would cause it to crash without any error messages? I get "The program has exited with code 0 (0x0)". The program is a MDI app with threading for...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.