PDA

View Full Version : clanlib & codeblock on windows



creatxr
11-27-2014, 02:54 PM
i've success compile clanlib by vs2010 express.
i've also added *.lib which built by vs2010 to codeblocks environment as i do on linux.
but:
D:\WORK\first\main.cpp|17|undefined reference to `clan::SetupCore::SetupCore()'|
... ...



#define WIN32

#include <ClanLib/core.h>
#include <ClanLib/application.h>
using namespace clan;
class ConsoleProgram
{
public:
static int main(const std::vector<std::string> &args);
};
// Create global application object:
// You MUST include this line or the application start-up will fail to
// locate your console application object.
Application app(&ConsoleProgram::main);
int ConsoleProgram::main(const std::vector<std::string> &args) // Setup clanCore:
{
SetupCore setup_core;
// Create a console Window if one does not exist:
ConsoleWindow console_window("Console");
// Write a line to the console:
Console::write_line("Hello World!");
// Wait for a key so the window won't close immediately.
Console::wait_for_key();
return 0;
}

rombust
12-02-2014, 02:26 PM
I'm not sure why you are using Visual Studio 2010 Express.

Try http://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx "Visual Studio Community 2013"

creatxr
12-03-2014, 11:12 PM
use vs 2013 cannot compile


1>------ Build started: Project: Core, Configuration: DebugMT Win32 ------
1> tls_client_impl.cpp
1> work_queue.cpp
1>..\Sources\Core\Crypto\tls_client_impl.cpp(92): error C2039: 'min' : is not a member of 'std'
1>..\Sources\Core\Crypto\tls_client_impl.cpp(92): error C3861: 'min': identifier not found
1>..\Sources\Core\Crypto\tls_client_impl.cpp(109): error C2039: 'min' : is not a member of 'std'
1>..\Sources\Core\Crypto\tls_client_impl.cpp(109): error C3861: 'min': identifier not found
1>..\Sources\Core\Crypto\tls_client_impl.cpp(223): error C2039: 'min' : is not a member of 'std'
1>..\Sources\Core\Crypto\tls_client_impl.cpp(223): error C3861: 'min': identifier not found
1>..\Sources\Core\System\work_queue.cpp(141): error C2039: 'max' : is not a member of 'std'
1>..\Sources\Core\System\work_queue.cpp(141): error C3861: 'max': identifier not found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

rombust
12-04-2014, 12:48 PM
If I remember correctly, use cl_min instead. You may need to also include another clanlib header.

creatxr
12-05-2014, 12:22 AM
ClanLib 3.0 compiles on VC2013

With minimal changes to boot;

Add #include <algorithm> to;
tls_client_impl.cpp (Core)
work_queue.cpp (Core)
input_device_provider_win32hid.cpp (Display)
iodevice_provider_tls_connection.cpp (Network)
gui_css_used_values.h (GUI)

This fixes missing min/max declarations.



use vs 2013 cannot compile


1>------ Build started: Project: Core, Configuration: DebugMT Win32 ------
1> tls_client_impl.cpp
1> work_queue.cpp
1>..\Sources\Core\Crypto\tls_client_impl.cpp(92): error C2039: 'min' : is not a member of 'std'
1>..\Sources\Core\Crypto\tls_client_impl.cpp(92): error C3861: 'min': identifier not found
1>..\Sources\Core\Crypto\tls_client_impl.cpp(109): error C2039: 'min' : is not a member of 'std'
1>..\Sources\Core\Crypto\tls_client_impl.cpp(109): error C3861: 'min': identifier not found
1>..\Sources\Core\Crypto\tls_client_impl.cpp(223): error C2039: 'min' : is not a member of 'std'
1>..\Sources\Core\Crypto\tls_client_impl.cpp(223): error C3861: 'min': identifier not found
1>..\Sources\Core\System\work_queue.cpp(141): error C2039: 'max' : is not a member of 'std'
1>..\Sources\Core\System\work_queue.cpp(141): error C3861: 'max': identifier not found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

creatxr
12-05-2014, 12:33 AM
but, i still cannot use the libs in codeblocks & mingw.

i've change tools->options->debugging->general->Use Managed Compatibility Mode