Click here to Skip to main content
11,925,851 members (62,312 online)
Rate this:
Please Sign up or sign in to vote.
See more: C++ USB
Hi guys!!

I'm trying to develop a program that communicates with a USB device. I've just started playing around with some functions and I need some help.
I wrote the code bellow and when I compile it, I have no errors but when i run it i get the following errors:

1>Rev 4.obj : error LNK2001: unresolved external symbol __RTC_Shutdown
1>Rev 4.obj : error LNK2001: unresolved external symbol __RTC_InitBase

I know that the above errors are to do with not linking some libraries but I have no clue what ones are missing and so i'm thinking it's something to do with the type of project i set up...!?
I set up a Win32 Console application but i'm not sure this is right.
I'm reading Jan Axelson's books but I think I need help setting up the environment, any help would be greatly appreciated.

#include <iostream>
#include <fstream>
#include <string>
#include <Windows.h>

extern "C"
#include <hidclass.h>
#include "hidsdi.h"
#include <setupapi.h>
//VOID HidD_GetHidGuid(OUT LPGUID HidGuid);

int main()
	//GUID	HidGuid;		// GUID is a data type that indicates a global variable
	//HANDLE	DeviceInfoSet;

	//std::cout << DeviceInfoSet << std::endl;
	// HidD_GetHidGuid(&HidGuid);
	return 0;

I also read stuff on drivers and that i need to build the environment using "free build environment" or "checked build environment", but do I need to do this when I just want to communicate with a device through another driver. I mean I don't want to build a driver i just want to communicate with the device.

anyway, hope i'm not being to confusing.
Kind regards,
Posted 6-Jun-12 23:23pm
RDBurmon 8-Jun-12 8:27am
Thanks Everyone who replied to this thread , So OP , I think you have got enough response and you should be able to mark it as your answer and close the thread.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I tried a few of those already, any other ideas?
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Check this old thread on CodeGuru:[^]

The problem was solved by using these settings:
Project Explorer > Settings > Linker > Input >
- Additional dependencies: libcp.lib
- Ignore All default libraries : no
- ignore specific library : libc.lib

Soren Madsen
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

Ok, thanks to superman and sorren for your quick answers. I had already tried them but I finally figured out my problem Smile | :) .

Anyway, the problem above resulted from another problem I had.

I had to download SDK 7.1 and then i had to change the platform toolset (configuration properties -> general -> platform toolset) to windows 7.1SDK. Make sure to also have the correct library folder linked in additional library directories (linker -> general).

When you've downloaded windows SDK7.1, do the following:
windows start menu -> microsoft windows SDK7.1 -> visual studios registration -> window SDK version ->7.1 or 7.1A

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web03 | 2.8.151126.1 | Last Updated 8 Jun 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100