Click here to Skip to main content
Rate this: bad
good
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;

	//HidD_GetHidGuid(&HidGuid);
	//DeviceInfoSet = SetupDiGetClassDevs(&HidGuid, NULL, NULL, DIGCF_PRESENT|DIGCF_INTERFACEDEVICE);
	//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,
Clio
Posted 6-Jun-12 23:23pm
Comments
RDBurmon at 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
good
Please Sign up or sign in to vote.

Solution 2

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

Solution 3

Check this old thread on CodeGuru: http://forums.codeguru.com/showthread.php?t=346998[^]
 
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
  Permalink  
Rate this: bad
good
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
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 269
1 OriginalGriff 240
2 CPallini 195
3 Maciej Los 177
4 BillWoodruff 173
0 OriginalGriff 5,655
1 DamithSL 4,506
2 Maciej Los 3,997
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,180


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 8 Jun 2012
Copyright © CodeProject, 1999-2014
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