General help with the core C language of which eC is a superset, integrating eC with other languages such as C++ at the C level, using C libraries in eC, etc.
I will be using Ecere both the Language and SDK with this group but I will also need to see how to be able to call external static or DLL C library from Ecere (static is more important), just in case the need arise.
Both projects have the regular Debug and Release project configurations, which use shared libraries (DLLs), and an additional configuration called 'Static' creating and linking in the static C library.
A few preprocessor definitions are defined in the Win32 project to control how the functions are exported and imported from the C library: USE_DLLEXPORT, USE_DLLIMPORT, USE_STDCALL.
USE_DLLEXPORT is defined when building the shared library, while USE_DLLIMPORT is defined when linking with it. USE_STDCALL is defined to standardize the function name mangling and calling convention ( a typical practice with Windows DLLs to use them across different compilers ).
As you can see, there is very little to using a library. You simply use #include to include the C library header (note: you can run into some conflicts doing this, where using #define / #undef can help, ask for help if you run into this).
Then you need sure the path to your C headers are included in your 'Additional include directories', within 'Project Settings / Compiler Settings'.
Then you add the name of the library to the 'Additional libraries' in Project Settings / Linker Settings, as well as the path to the built library (.lib or .dll for dynamic, .a for static) in 'Additional library directories'. Note that static library built with/for MinGW will always be preceded by the 'lib' prefix. That lib prefix should not be included when adding it to the 'Additional libraries' line: e.g. cLibrary even though the static library is libcLibrary.a .
You can see in the eCproject workspace that the cLibrary project was added to the workspace as well. This will allow the IDE to automatically find and use the proper configuration DLL when debugging or running the application (even though it is located in a separate folder).
It is the second time I encountered the same issue when using a C lib in eC project (both static and dll).Last time was to build a c container library,this time is to make use of curl lib.The issue is the same:when I tested both sample codes in pure c workspace (Code::Blocks +mingw for example),everything is perfect;but when I compiled the sample codes in eC,it complained "syntax error." from inside the code right begining to use the c lib.
Below is the project I test curl lib,the sample code void testCurl() just copied from the sample inside the distribute package.
Please help me to fix this issue(I mean things need to know when I have to talk with exsiting c libs),I wish I can use C to do everything that can do in other workspace can also do in eC.
If you define CURL_DISABLE_TYPECHECK in the preprocessor definitions, it will avoid including typecheck-gcc.h which uses internal GCC things like __builtin_types_compatible_p which eC does not support. This is automatically disabled on non-GCC/older GCC and for C++ by a check in curl.h.
- The CURLOPT_* do not have an underscore between CURL and OPT (CURLOPT_URL, CURLOPT_FOLLOWLOCATION)
BTW,just for your reference:for http://taobao.com and http://hao123.com things worked very differently:
SmartFileOpen and all libararies based curl I have at hands(wxWidgets+wxCurl ,or curld+ D2 ,for example) or lNet with Lazarus(in freepascal) worked the same:can't recognize Chinese character;
You could try to output to a text file and open it in the IDE to see what happens with both of these.
Agriculture and Rural Development Better Regulation, Inter-Institutional Relations, Rule of Law and Charter of Fundamental Rights Budget and Human Resources Climate Action and Energy Communication Competition Digital Economy and Society Digital Single Market Economic and Financial Affairs, Taxation and Customs Education, Culture, Youth and Sport Employment, Social Affairs, Skills and Labour Mobility Energy Union Environment, Maritime Affairs and Fisheries European Neighbourhood Policy and Enlargement Negotiations Financial Stability, Financial Services and Capital Markets Union Foreign Affairs and Security Policy Health and Food Safety Humanitarian Aid and Crisis Management Institutional Affairs Internal Market, Industry, Entrepreneurship and SMEs International Cooperation and Development Jobs, Growth, Investment and Competitiveness Justice, Consumers and Gender Equality Migration, Home Affairs and Citizenship Regional Policy Research, Science and Innovation Security Union The Euro and Social Dialogue Trade Transport Withdrawal of the United Kingdom from the EU
Roberto is a businessman and father of four children. When his son, Andrea came out, Roberto focused on educating himself and their fellow colleagues on the LGBTI equality and diversity.
European Commission President Jean-Claude Juncker and European Parliament President Antonio Tajani participate in the ceremony for the Armistice centenary, in Paris, France....
European Commission - Daily News Daily News 12 / 11 / 2018 Brussels, 12 November 2018 Competition: Registration opens for upcoming conference on competition policy and digitisation The Commission has opened today the registrations for the upcoming conference "Shaping competition policy in the era of digitisation", which will take place...
European Commission - Press release Brussels, 9 November 2018 Half of the skimmed milk powder bought into public stock since 2015 (190,000 out of 380,000 tonnes) has been put back into the market without jeopardising its functioning and the recovery of the sector.
European Commission - Press release Brussels, 9 November 2018 The European Commission is inviting comments from interested parties on commitments offered by Disney to address competition concerns relating to contractual clauses preventing the cross-border provision of pay-TV.
European Commission - Press release Brussels, 9 November 2018 Today, the Council adopted the Commission's proposal to strengthen eu-LISA, the EU Agency responsible for the operational management of large-scale information systems in the area of freedom, security and justice.
European Commission - Press release Brussels, 9 November 2018 Ukraine has made progress in a number of important areas over the past year, but several outstanding reforms still need to be reinforced so that Ukrainian citizens can fully reap the benefits of the EU-Ukraine Association Agreement and its Deep and...
Commission - Press release European Brussels, 9 November 2018 Today marks the end of the 2018 edition of the European Vocational Skills Week, organised by the European Commission in cooperation with the Austrian Presidency.