Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: expected primary-expression before ‘struct’ #780

Open
ghost opened this issue Apr 20, 2014 · 5 comments
Open

error: expected primary-expression before ‘struct’ #780

ghost opened this issue Apr 20, 2014 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 20, 2014

Hello again,

I try compilation openlierox 0.58_rc3 and :

-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
SYSTEM_DATA_DIR = /usr/share/games
DEBUG = ON
DEDICATED_ONLY = OFF
G15 = OFF
X11 = ON
HAWKNL_BUILTIN = ON
LIBZIP_BUILTIN = OFF
STLPORT = OFF
GCOREDUMPER = OFF
BREAKPAD = Off
CMAKE_C_COMPILER = /usr/bin/cc
CMAKE_C_FLAGS = -O2 -fPIC
CMAKE_CXX_COMPILER = /usr/bin/c++
CMAKE_CXX_FLAGS = -O2 -fPIC
OLX_VERSION = 0.58_rc3
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/SBo/openlierox-0.58_rc3/build
Scanning dependencies of target openlierox
[  0%] Building CXX object CMakeFiles/openlierox.dir/src/main.o
In file included from /tmp/SBo/openlierox-0.58_rc3/./include/FileDownload.h:30:0,
                 from /tmp/SBo/openlierox-0.58_rc3/./include/CClient.h:31,
                 from /tmp/SBo/openlierox-0.58_rc3/src/main.cpp:20:
/tmp/SBo/openlierox-0.58_rc3/./include/HTTP.h:24:24: fatal error: curl/types.h: No such file or directory
 #include <curl/types.h>
                        ^
compilation terminated.
make[2]: *** [CMakeFiles/openlierox.dir/src/main.o] Error 1
make[1]: *** [CMakeFiles/openlierox.dir/all] Error 2
make: *** [all] Error 2

This error fixed after change the curl header curl/types.h ---> curl/typecheck-gcc.h in HTTP.h file.
but I also the same error in file HTTP.cpp not corrected in the same way.
compilation crash at 68% :

  curl_easy_setopt(curl, CURLOPT_HTTPPOST, curlForm);
  ^
/tmp/SBo/openlierox-0.58_rc3/src/common/HTTP.cpp:277:2: error: expected primary-expression before ‘__typeof__’
  curl_easy_setopt(curl, CURLOPT_HTTPPOST, curlForm);
  ^
/tmp/SBo/openlierox-0.58_rc3/src/common/HTTP.cpp:277:2: error: expected primary-expression before ‘const’
  curl_easy_setopt(curl, CURLOPT_HTTPPOST, curlForm);
  ^
/tmp/SBo/openlierox-0.58_rc3/src/common/HTTP.cpp:277:2: error: expected primary-expression before ‘__typeof__’
  curl_easy_setopt(curl, CURLOPT_HTTPPOST, curlForm);
  ^
/tmp/SBo/openlierox-0.58_rc3/src/common/HTTP.cpp:277:2: error: expected primary-expression before ‘char’
...
make[2]: *** [CMakeFiles/openlierox.dir/src/common/HTTP.o] Error 1
make[1]: *** [CMakeFiles/openlierox.dir/all] Error 2
make: *** [all] Error 2
@ghost
Copy link
Author

ghost commented Apr 20, 2014

openlierox-0.58_rc3/include/HTTP.h
curl/types.h ----> curl/typecheck-gcc.h

openlierox-0.58_rc3/src/common/HTTP.cpp
curl/types.h ----> curl/typecheck-gcc.h

@albertz
Copy link
Owner

albertz commented Apr 21, 2014

Hm, that is GCC 4.8.2? What is your Curl version? Do I understand you correctly that after you changed those two include files, it works?

That is of course not the correct solution for us because we need a solution which works everywhere. Someone should check the Curl docs about the correct include. Also someone should check out why curl/types.h fails. It might be easy to work around that.

@karelp
Copy link
Collaborator

karelp commented Apr 21, 2014

Apparently the header was removed from new CURL versions and will not be reinstated: http://sourceforge.net/p/curl/bugs/1020/

The bug discussion mentions that "the header was blanked out almost 7 years ago". Shouldn't just removing the include work?

@ghost
Copy link
Author

ghost commented Apr 21, 2014

ooopss Works !!! Thanks again !!!

SOLVED

@ghost ghost closed this as completed Apr 21, 2014
@albertz
Copy link
Owner

albertz commented Apr 21, 2014

This should be fixed first.

@albertz albertz reopened this Apr 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants