Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » SQL tutorial 5 and using namespace Upp; in header file (Solved)
Re: SQL tutorial 5 and using namespace Upp; in header file (Solved) [message #52805 is a reply to message #52791] Sat, 30 November 2019 05:14 Go to previous messageGo to previous message
coolman is currently offline  coolman
Messages: 114
Registered: April 2006
Location: Czech Republic
Experienced Member
Hi,

The solution is simple - in the header and source file enclose include and definitions related to SQL into block "namespace Upp". And move command "using namespace Upp;" from header file to source file.

MyApp.h
#ifndef _MyApp_h_
#define _MyApp_h_

#include <Core/Core.h>
#include <plugin/sqlite3/Sqlite3.h>

namespace Upp {
#define SCHEMADIALECT <plugin/sqlite3/Sqlite3Schema.h>
#define MODEL <Sql05/MyApp.sch>
#include "Sql/sch_header.h"
}

#endif


main.cpp
#include "MyApp.h"

using namespace Upp;

namespace Upp {
#include <Sql/sch_schema.h>
#include <Sql/sch_source.h>
}

CONSOLE_APP_MAIN
{
....

[Updated on: Sat, 30 November 2019 05:14]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: sql innerjoin not working
Next Topic: BUGFIX: MySqlConnection::SetParam(): handling INT64_V is missing
Goto Forum:
  


Current Time: Sun Apr 28 15:33:53 CEST 2024

Total time taken to generate the page: 0.02629 seconds