seandepagnier / rtlsdr_pi

rtlsdr plugin for opencpn for AIS vhf and more on tv tuner usb dongle
30 stars 14 forks source link

Compile error #19

Closed houlejm closed 5 years ago

houlejm commented 5 years ago

While compiling I get the following error:

/home/jean-marie/src/rtlsdr_pi/src/rtlsdr_pi.cpp: In member function ‘virtual int rtlsdr_pi::GetPlugInVersionMajor()’:
/home/jean-marie/src/rtlsdr_pi/src/rtlsdr_pi.cpp:194:7: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
       return PLUGIN_VERSION_MAJOR;
       ^~~~~~
/home/jean-marie/src/rtlsdr_pi/src/rtlsdr_pi.cpp: In member function ‘virtual int rtlsdr_pi::GetPlugInVersionMinor()’:
/home/jean-marie/src/rtlsdr_pi/src/rtlsdr_pi.cpp:199:7: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
       return PLUGIN_VERSION_MINOR;
       ^~~~~~

Thanks

rgleason commented 5 years ago

It is associated with these changes

https://github.com/seandepagnier/rtlsdr_pi/commit/bdf9f8a0f32d00b523c368d6bf138c09a7736073

See the commented out SET(VERSION_MAJOR "1") SET(VERSION_MINOR "2")

These have moved to a new file. VERSION.cmake

Can you adapt the linux section for that? get it working and make a PR to Sean? I would like to add those changes too.

houlejm commented 5 years ago

@rgleason I tried but could not. I found about "VERSION.cmake" but I could not find where it is included.

For a test, In "rtlsdr_pi.cpp" I forced the version (return 1 and return 3). I could compile without error but then Opencpn would not recognize the PI. Got the error: 11:16:42 EST: Erreur : /usr/lib/opencpn/librtlsdr_pi.so: undefined symbol: _Z15VHFFrequencyMHZib Sorry, I am not fluent enough in all this.

rgleason commented 5 years ago

Ok, I think I need to add .travis file and perhaps edit some cmake.

rgleason commented 5 years ago

rtlsdr_pi.cpp line 194 and 197

int rtlsdr_pi::GetPlugInVersionMajor()
{
      return PLUGIN_VERSION_MAJOR;
}

int rtlsdr_pi::GetPlugInVersionMinor()
{
      return PLUGIN_VERSION_MINOR;
}

"could not find where it is included." This may be the problem. The time I ran removed the # comment out and it worked. SET(VERSION_MAJOR "1") SET(VERSION_MINOR "2") but I don't think it was right. I get the error too now. I believe it is from Sean's "Update Build" a line is missing.

rgleason commented 5 years ago

Think I found it Line 19 cmakelists.txt Will try it and then make a PR

INCLUDE( VERSION.cmake )
SET(PLUGIN_VERSION "${PLUGIN_VERSION_MAJOR}.${PLUGIN_VERSION_MINOR}.${PLUGIN_VERSION_PATCH}" )
INCLUDE("cmake/PluginConfigure.cmake")
houlejm commented 5 years ago

I tried it. Same error.

rgleason commented 5 years ago

Yes, I've done some more but reached a point that I think Sean should look at it as I don't want to mess up his QT, Android, etc setup and he is clearly working towards resolving all this to it compiles for everything.

I am going to make a PR of the changes I've made so far so Sean can review or accept and then resolve the ENDIF

https://github.com/seandepagnier/rtlsdr_pi/pull/20

CMake Error at cmake/PluginPackage.cmake:199 (ENDIF):
  ENDIF An ENDIF command was found outside of a proper IF ENDIF structure.
  Or its arguments did not match the opening IF command.

Long Version

-- Detecting CXX compile features - done
-- *** Building rtlsdr_pi ***
-- Build type: 
-- *** Build Architecture is 
-- *** Staging to build rtlsdr_pi ***
-- Setting C++11 standard via cmake standard mecahnism
-- Found OpenGL: opengl32   
-- Found OpenGL...
--     Lib: opengl32glu32
--     Include: 
-- Found wxWidgets: debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxbase30ud.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxbase30u.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxmsw30ud_core.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxmsw30u_core.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxbase30ud_net.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxbase30u_net.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxbase30ud_xml.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxbase30u_xml.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxmsw30ud_html.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxmsw30u_html.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxmsw30ud_adv.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxmsw30u_adv.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxmsw30ud_gl.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxmsw30u_gl.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxpngd.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxpng.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxtiffd.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxtiff.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxjpegd.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxjpeg.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxzlibd.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxzlib.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxregexud.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxregexu.lib;debug;C:/wxWidgets-3.0.2/lib/vc_dll/wxexpatd.lib;optimized;C:/wxWidgets-3.0.2/lib/vc_dll/wxexpat.lib;opengl32;glu32;winmm;comctl32;oleacc;rpcrt4;shlwapi;version;wsock32 (found version "3.0.2") 
-- Found Gettext: C:/Program Files/Git/usr/bin/msgmerge.exe (found version "0.19.8.1") 
-- Install Prefix: C:/Program Files (x86)/rtlsdr_pi
-- FILE: rtlsdr_pi-1.3.-win32.exe
CMake Error at cmake/PluginPackage.cmake:199 (ENDIF):
  ENDIF An ENDIF command was found outside of a proper IF ENDIF structure.
  Or its arguments did not match the opening IF command.
Call Stack (most recent call first):
  CMakeLists.txt:73 (INCLUDE)
-- Configuring incomplete, errors occurred!
See also "C:/project/projections_pi/build/CMakeFiles/CMakeOutput.log".
Command exited with code 1
houlejm commented 5 years ago

Ok it will compile after last commit by Sean