[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RE: "undefined reference" error message when using mkoctfile to crea
From: |
Tatsuro MATSUOKA |
Subject: |
Re: RE: "undefined reference" error message when using mkoctfile to create oct file |
Date: |
Wed, 22 Feb 2017 13:54:59 +0900 (JST) |
----- Original Message -----
> From: Yan Zhang
> To: "help-octave
> Cc:
> Date: 2017/2/22, Wed 11:15
> Subject: RE: RE: "undefined reference" error message when using mkoctfile to
> create oct file
>
>T hanks a lot for the kind help. I tried the dlltool and pexports and
> successfully got a new lib file which I renamed as "usbdllnew.lib".
> Unfortunately, I still couldn't make it work. Following are the messages I
> got:
>
>
> -----------------------------------------------------
>>> mkoctfile PowerMeter.cc -L. -lusbdllnew
> PowerMeter.o: In function `Z12CloseDevicesv':
> C:\Users\yan\Desktop\TestCam_Project\Oct_Src\cc/PowerMeter.cc:20:
> undefined reference to address@hidden'
> PowerMeter.o: In function `Z11OpenDevicesi':
> C:\Users\yan\Desktop\TestCam_Project\Oct_Src\cc/PowerMeter.cc:30:
> undefined reference to address@hidden'
> C:\Users\yan\Desktop\TestCam_Project\Oct_Src\cc/PowerMeter.cc:31:
> undefined reference to address@hidden'
> PowerMeter.o: In function `Z4ReadiPciPm':
> C:\Users\yan\Desktop\TestCam_Project\Oct_Src\cc/PowerMeter.cc:41:
> undefined reference to address@hidden'
> PowerMeter.o: In function `Z5WriteiPc':
> C:\Users\yan\Desktop\TestCam_Project\Oct_Src\cc/PowerMeter.cc:67:
> undefined reference to address@hidden'
> collect2.exe: error: ld returned 1 exit status
> warning: mkoctfile exited with failure status
> warning: called from
> mkoctfile at line 171 column 5
> -----------------------------------------------------
>
>
> Thanks,
>
> Yan
>
Mmmm
Seeing error messages for "undefined reference to" like
undefined reference to address@hidden'
Perhaps your problem is related @n (n is interger) symbol issue
I googled and found the below
Two possibilities.
1. order of linker flag. Sometimes "undefined reference error" occur
in wrong order of library option.
Adding '-v' option, one can echo commands as they are executed.
>> mkoctfile -v PowerMeter.cc -L. -lusbdllnew
I do not see problems but I do not have enough knowledge to judge with
confidence.
2. @n (n is number like @0) symbols problems for pexports.
https://sourceforge.net/p/mingw-w64/wiki2/gendef/
However, unlike pexports, gendef scans and attempts to decode the dll file
to find out relevant details such as call convention used. It will try to
append the @n to symbols detected as using stdcall?.
Unfortunately gendef binary distributed with mingw-w64.
Download mingw-w64-v5.0.1.zip (source)
https://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/mingw-w64-v5.0.1.zip/download
Place mingw-w64-v5.0.1.zip at your preferable folder
Using windows explorer, copy "gendef" in folder "mingw-w64-tools" in
mingw-w64-v5.0.1.zip in to another folder.
Start octave
>> system bash
bash-3.1$ cd "(path to 'gendef' folder )"
bash-3.1$ ./configure
bash-3.1$ make
After "make", gendef.exe is generated at (path to 'gendef' folder ) and copy it
to appropriate place.
gendef - xxx.dll
(Do not forget '-' option to output console)
You can see the symbol generated by gendef.
gendef - xxx.dll > xxx.def
You can generate def file.
Tatsuro
- RE: "undefined reference" error message when using mkoctfile to create oct file, address@hidden, 2017/02/17
- Re: RE: "undefined reference" error message when using mkoctfile to create oct file, address@hidden, 2017/02/19
- Re: RE: "undefined reference" error message when using mkoctfile to create oct file, address@hidden, 2017/02/21
- Re: RE: "undefined reference" error message when using mkoctfile to create oct file, address@hidden, 2017/02/21
- RE: RE: "undefined reference" error message when using mkoctfile to create oct file, Yan Zhang, 2017/02/21
- Re: RE: "undefined reference" error message when using mkoctfile to create oct file, Tatsuro MATSUOKA, 2017/02/21
- RE: RE: "undefined reference" error message when using mkoctfile to create oct file, Yan Zhang, 2017/02/21
- Re: RE: "undefined reference" error message when using mkoctfile to create oct file,
Tatsuro MATSUOKA <=
- Re: RE: "undefined reference" error message when using mkoctfile to create oct file, Tatsuro MATSUOKA, 2017/02/22
- Re: RE: "undefined reference" error message when using mkoctfile to create oct file, Tatsuro MATSUOKA, 2017/02/22
- Re: RE: "undefined reference" error message when using mkoctfile to create oct file, Tatsuro MATSUOKA, 2017/02/23
- RE: RE: "undefined reference" error message when using mkoctfile to create oct file, Yan Zhang, 2017/02/23
- Re: RE: "undefined reference" error message when using mkoctfile to create oct file, Tatsuro MATSUOKA, 2017/02/23
- RE: RE: "undefined reference" error message when using mkoctfile to create oct file, Yan Zhang, 2017/02/23
- Re: RE: "undefined reference" error message when using mkoctfile to create oct file, Tatsuro MATSUOKA, 2017/02/23
- Re: RE: "undefined reference" error message when using mkoctfile to create oct file, Tatsuro MATSUOKA, 2017/02/24