Click here to Skip to main content
15,743,427 members
Please Sign up or sign in to vote.
3.75/5 (3 votes)
See more:
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,
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.

I tried a few of those already, any other ideas?
Share this answer
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
Share this answer
Ok, thanks to superman and sorren for your quick answers. I had already tried them but I finally figured out my problem :).

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
Share this answer

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900