I am trying to use a Cypress USB Library and I am having linker problems.
It appears to be a Name Mangling problem.
Here is my build log:
-------------- Build: default in HelloWorld ---------------
mingw32-g++.exe -LC:\MinGW\lib -o HelloWorld.exe .objs\main.o W:\tom\BORGPC\CyAPI.lib
.objs\main.o: In function `Z41__static_initialization_and_destruction_0ii':
W:/tom/prj/HelloWorld/main.cpp:5: undefined reference to `CCyUSBDevice::CCyUSBDevice(void*, _GUID, int)'
W:/tom/prj/HelloWorld/main.cpp:5: undefined reference to `CCyUSBDevice::~CCyUSBDevice
()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
2 errors, 0 warnings
I created the project using the Console Application C++ Template which works fine before I
added the #include for the library. (Which has a handful of class definitions and works fine in VC++ 6.0 and borland from talking to other developers)
I also have attached the project directory.
I think it is a mangling problem because the error does not change if I remove the library
from the linker library list...
I am kinda surprised that the extern gcc created is class::function...
but then again I am new at this...
Here's HelloWorld.c (it's in the archive too)
#include <iostream>
#include <windows.h>
#include "cyAPI.h"
CCyUSBDevice USBDevice;
int main()
{
int counts;
// counts = USBDevice.DeviceCount();
std::cout << "Hello world!" << std::endl;
return counts;
}
---
Ah yes... critical details...
I am using nightly build:
Version 1.0 revision 2199 (gcc 3.4.4 Windows/unicode, build: Mar 15 2006 20:19:14)
mingw
binutils-2.16.91-20050827-1.tar.gz
gcc-core-3.4.4-20050522-1.tar.gz
gcc-g++-3.4.4-20050522-1.tar.gz
mingw-runtime-3.9.tar.gz
mingw-utils-0.3.tar.gz
mingw32-make-3.80.0-3.tar.gz
w32api-3.5.tar.gz
Which is basically the mingw install from the wiki
tom
[attachment deleted by admin]