QHYCCD

Error Compiling Sample Script from Linux SDK

varwww

Error Compiling Sample Script from Linux SDK
« on: July 16, 2017, 05:11:03 AM »
Hello,

I have compiled the SDK successfully, but if I compile the "SingleFrameSample.cpp" I got an error:
Code: [Select]
user@PC:~/QHYCCD_Linux/sample$ g++ -Wall -I/usr/include/libqhy -L/usr/lib/libqhy -lqhy SingleFrameSample.cpp -o SingleFrameSample
SingleFrameSample.cpp: In function ‘int main(int, char**)’:
SingleFrameSample.cpp:191:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if( ret != QHYCCD_ERROR )
                 ^
SingleFrameSample.cpp:17:9: warning: unused variable ‘camtime’ [-Wunused-variable]
     int camtime = 100000,camgain = 0,camoffset = 140,camspeed = 0,cambinx = 1,c
         ^
SingleFrameSample.cpp:17:26: warning: unused variable ‘camgain’ [-Wunused-variable]
     int camtime = 100000,camgain = 0,camoffset = 140,camspeed = 0,cambinx = 1,c
                          ^
SingleFrameSample.cpp:17:38: warning: unused variable ‘camoffset’ [-Wunused-variable]
     int camtime = 100000,camgain = 0,camoffset = 140,camspeed = 0,cambinx = 1,c
                                      ^
SingleFrameSample.cpp:17:54: warning: unused variable ‘camspeed’ [-Wunused-variable]
     int camtime = 100000,camgain = 0,camoffset = 140,camspeed = 0,cambinx = 1,c
                                                      ^
/tmp/ccoObhlW.o: In Funktion `main':
SingleFrameSample.cpp:(.text+0x75): Nicht definierter Verweis auf `InitQHYCCDResource'
SingleFrameSample.cpp:(.text+0x91): Nicht definierter Verweis auf `ScanQHYCCD'
SingleFrameSample.cpp:(.text+0xf4): Nicht definierter Verweis auf `GetQHYCCDId'
SingleFrameSample.cpp:(.text+0x141): Nicht definierter Verweis auf `OpenQHYCCD'
SingleFrameSample.cpp:(.text+0x167): Nicht definierter Verweis auf `SetQHYCCDStreamMode'
SingleFrameSample.cpp:(.text+0x197): Nicht definierter Verweis auf `InitQHYCCD'
SingleFrameSample.cpp:(.text+0x1f8): Nicht definierter Verweis auf `GetQHYCCDChipInfo'
SingleFrameSample.cpp:(.text+0x2c2): Nicht definierter Verweis auf `IsQHYCCDControlAvailable'
SingleFrameSample.cpp:(.text+0x30d): Nicht definierter Verweis auf `SetQHYCCDDebayerOnOff'
SingleFrameSample.cpp:(.text+0x337): Nicht definierter Verweis auf `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x361): Nicht definierter Verweis auf `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x38b): Nicht definierter Verweis auf `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x39c): Nicht definierter Verweis auf `IsQHYCCDControlAvailable'
SingleFrameSample.cpp:(.text+0x3cf): Nicht definierter Verweis auf `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x402): Nicht definierter Verweis auf `IsQHYCCDControlAvailable'
SingleFrameSample.cpp:(.text+0x435): Nicht definierter Verweis auf `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x468): Nicht definierter Verweis auf `IsQHYCCDControlAvailable'
SingleFrameSample.cpp:(.text+0x49b): Nicht definierter Verweis auf `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x4e7): Nicht definierter Verweis auf `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x530): Nicht definierter Verweis auf `SetQHYCCDResolution'
SingleFrameSample.cpp:(.text+0x557): Nicht definierter Verweis auf `SetQHYCCDBinMode'
SingleFrameSample.cpp:(.text+0x58c): Nicht definierter Verweis auf `IsQHYCCDControlAvailable'
SingleFrameSample.cpp:(.text+0x5b7): Nicht definierter Verweis auf `SetQHYCCDBitsMode'
SingleFrameSample.cpp:(.text+0x5e5): Nicht definierter Verweis auf `ExpQHYCCDSingleFrame'
SingleFrameSample.cpp:(.text+0x628): Nicht definierter Verweis auf `GetQHYCCDMemLength'
SingleFrameSample.cpp:(.text+0x686): Nicht definierter Verweis auf `GetQHYCCDSingleFrame'
SingleFrameSample.cpp:(.text+0x6ee): Nicht definierter Verweis auf `CancelQHYCCDExposingAndReadout'
SingleFrameSample.cpp:(.text+0x70d): Nicht definierter Verweis auf `CloseQHYCCD'
SingleFrameSample.cpp:(.text+0x733): Nicht definierter Verweis auf `ReleaseQHYCCDResource'
collect2: error: ld returned 1 exit status


Thanks for help


astrosoft

  • *
  • 104
  • Astronomical software developer C,C++,Java,Android
    • View Profile
    • Email
Re: Error Compiling Sample Script from Linux SDK
« Reply #1 on: July 19, 2017, 10:20:48 PM »
Hi,
could you please try the qhyccdsdk-0.1.10-linux.tar.gz release from our https://github.com/qhyccd-lzr
inside the QHYCCD_Linux_New subdirectory ?
Thanks,
Jan
Jan Soldan 
Astronomical software development
QHYCCD distributor and European Warranty, Repair,
Warehouse centre

V Lukach 451,
251 65 Ondrejov,
Czech Republic

Email : astrosoft@email.cz
Mobile : +420 728 403 811
http://www.linkedin.com/in/jansoldan

Re: Error Compiling Sample Script from Linux SDK
« Reply #2 on: September 26, 2017, 10:13:40 PM »
Jan,
I think it would be helpful to varwww if you could provide the command line text necessary to get the sample to compile for you.  (For some reason I am encountering the same issue with v1.0.2).
Jeff

astrosoft

  • *
  • 104
  • Astronomical software developer C,C++,Java,Android
    • View Profile
    • Email
Re: Error Compiling Sample Script from Linux SDK
« Reply #3 on: November 23, 2017, 12:15:04 PM »
I am very sorry for my very late answer. I daily work on updating SDK for linux/mac, so I do not read this forum frequently, but I will... So, we are now fixing some issues inside the SDK running on Mac OSX , especially problems with QHY5III-290c.
When done, next plan is to generate Linux version of SDK driver and the same for ARM v8 processors.
I will post message when ready to download.
Regards,
Jan
Jan Soldan 
Astronomical software development
QHYCCD distributor and European Warranty, Repair,
Warehouse centre

V Lukach 451,
251 65 Ondrejov,
Czech Republic

Email : astrosoft@email.cz
Mobile : +420 728 403 811
http://www.linkedin.com/in/jansoldan

Re: Error Compiling Sample Script from Linux SDK
« Reply #4 on: November 23, 2017, 09:03:00 PM »
Hi,
    Why your header file is in /usr/include/libqhy and library is in /usr/lib/libqhy,you take them tthere by yourself?Normally,after you installed our SDK,them should in /usr/local/include and /usr/local/lib.
    Well,it is not possible,if you can guarantee header file is in /usr/include/libqhy and library is in /usr/lib/qhy,you need go to /usr/lib/libqhy and use "ls -l" check if library is linked.
    $ls -l libqhy.*
    *omit* libqhy.so->libqhy.so.1
    *omit* libqhy.so.1->libqhy.so.1.0.1
    *omit* libqhy.so.1.0.1
QinXiaoXu

Re: Error Compiling Sample Script from Linux SDK
« Reply #5 on: November 27, 2017, 06:06:39 PM »
Somewhat late to the party on this one, but I'd suggest the original problem is that "-lqhy" should be at the end of the command line.

I've used variables $I and $L here for the paths to the include files and libraries because they're not properly installed at the moment and I've dropped the "-Wall" flag to improve readability, but with the library reference in the middle of the command line:
Code: [Select]
$ g++ -I$I -L$L -lqhy SingleFrameSample.cpp -o SingleFrameSample
/tmp/ccx2n0Rg.o: In function `main':
SingleFrameSample.cpp:(.text+0x75): undefined reference to `InitQHYCCDResource'
SingleFrameSample.cpp:(.text+0x91): undefined reference to `ScanQHYCCD'
SingleFrameSample.cpp:(.text+0xf4): undefined reference to `GetQHYCCDId'
SingleFrameSample.cpp:(.text+0x141): undefined reference to `OpenQHYCCD'
SingleFrameSample.cpp:(.text+0x167): undefined reference to `SetQHYCCDStreamMode'
SingleFrameSample.cpp:(.text+0x197): undefined reference to `InitQHYCCD'
SingleFrameSample.cpp:(.text+0x1f8): undefined reference to `GetQHYCCDChipInfo'
SingleFrameSample.cpp:(.text+0x2c2): undefined reference to `IsQHYCCDControlAvailable'
SingleFrameSample.cpp:(.text+0x30d): undefined reference to `SetQHYCCDDebayerOnOff'
SingleFrameSample.cpp:(.text+0x337): undefined reference to `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x361): undefined reference to `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x38b): undefined reference to `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x39c): undefined reference to `IsQHYCCDControlAvailable'
SingleFrameSample.cpp:(.text+0x3cf): undefined reference to `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x402): undefined reference to `IsQHYCCDControlAvailable'
SingleFrameSample.cpp:(.text+0x435): undefined reference to `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x468): undefined reference to `IsQHYCCDControlAvailable'
SingleFrameSample.cpp:(.text+0x49b): undefined reference to `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x4e7): undefined reference to `SetQHYCCDParam'
SingleFrameSample.cpp:(.text+0x530): undefined reference to `SetQHYCCDResolution'
SingleFrameSample.cpp:(.text+0x557): undefined reference to `SetQHYCCDBinMode'
SingleFrameSample.cpp:(.text+0x58c): undefined reference to `IsQHYCCDControlAvailable'
SingleFrameSample.cpp:(.text+0x5b7): undefined reference to `SetQHYCCDBitsMode'
SingleFrameSample.cpp:(.text+0x5e5): undefined reference to `ExpQHYCCDSingleFrame'
SingleFrameSample.cpp:(.text+0x628): undefined reference to `GetQHYCCDMemLength'
SingleFrameSample.cpp:(.text+0x686): undefined reference to `GetQHYCCDSingleFrame'
SingleFrameSample.cpp:(.text+0x6ee): undefined reference to `CancelQHYCCDExposingAndReadout'
SingleFrameSample.cpp:(.text+0x70d): undefined reference to `CloseQHYCCD'
SingleFrameSample.cpp:(.text+0x733): undefined reference to `ReleaseQHYCCDResource'
collect2: error: ld returned 1 exit status

and at the end:
Code: [Select]
$ g++ -I$I -L$L SingleFrameSample.cpp -o SingleFrameSample -lqhy
$ ls -l SingleFrameSample
-rwxr-xr-x 1 james james 14040 Nov 28 00:01 SingleFrameSample

To the best of my knowledge the Linux/UNIX linker has only ever linked libraries against objects that precede them on the command line, so if there are none then the library is effectively ignored.

James

astrosoft

  • *
  • 104
  • Astronomical software developer C,C++,Java,Android
    • View Profile
    • Email
Re: Error Compiling Sample Script from Linux SDK
« Reply #6 on: December 17, 2017, 11:50:37 PM »
There is improved SingleFrameMode.cpp source code inside the latest SDK delivery. Please try it, it should work properly.
Jan
Jan Soldan 
Astronomical software development
QHYCCD distributor and European Warranty, Repair,
Warehouse centre

V Lukach 451,
251 65 Ondrejov,
Czech Republic

Email : astrosoft@email.cz
Mobile : +420 728 403 811
http://www.linkedin.com/in/jansoldan