CEDAR Logic

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: CEDAR Logic

Post by doublemax »

Fahad wrote:thrice have the same location i.e: C:\Users\Asad\Documents\Visual Studio 2015\Projects\wxWidgets-2.8.12
Well, if the project uses the WXWIN variable, that can't be true.

Let's suppose WXWIN is set to that path, then the include paths should look like this:

Code: Select all

$(WXWIN)\lib\vc_lib\mswud
$(WXWIN)\include\
The first one depends on how you built wxWidgets and can look different. That's the directory where "setup.h" is included from.
The second path points to all other header files.
Use the source, Luke!
User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: CEDAR Logic

Post by Fahad »

i just include "wx/wxprec.h" in all over the project .cpp files. and now i got only one error about main project file. by setting up Precompiled Headers

the only error is : Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'wx/wxprec.h': No such file or directory cedar-logic c:\users\asad\documents\visual studio 2015\projects\cedar-logic\src\gui\MainApp.h 14
User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: CEDAR Logic

Post by Fahad »

before opening project in VS 2015 Professional , I opened `x86 native tools` command prompt and run these commands.
cd %WXWIN%\build\msw
nmake /f makefile.vc USE_OPENGL=1 RUNTIME_LIBS=static
nmake /f makefile.vc BUILD=release USE_OPENGL=1 RUNTIME_LIBS=static
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: CEDAR Logic

Post by doublemax »

Error C1083 Cannot open include file: 'wx/wxprec.h': No such file or directory
This happens only for one source file and for the others it works? That would be very strange. Check that you haven't accidentally set different path settings for this one source file. What happens if you comment that line out?
before opening project in VS 2015 Professional , I opened `x86 native tools` command prompt and run these commands.
That's probably ok. But i would still try if building through the solution file works.
Use the source, Luke!
User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: CEDAR Logic

Post by Fahad »

here is the code of MainApp.h

#ifndef MAINAPP_H_
#define MAINAPP_H_

#include "wx/wxprec.h"
#include "wx/wx.h"
#include "wx/thread.h"
#include "wx/image.h"
#include "wx/docview.h"
#include "wx/help.h"
#include "wx/fs_zip.h"
#include "threadLogic.h"
#include "autoSaveThread.h"
#include "../logic/logic_values.h"
#include "LibraryParse.h"
#include "gl_defs.h"
#include "klsMessage.h"
#include <deque>
#include <string>
#include <fstream>
#include <sstream>
#include <cmath>

class MainFrame;

using namespace std;

struct ApplicationSettings {
string gateLibFile;
string textFontFile;
string helpFile;
string lastDir;
unsigned int mainFrameWidth;
unsigned int mainFrameHeight;
int mainFrameLeft;
int mainFrameTop;
unsigned int timePerStep;
int refreshRate;
float wireConnRadius;
bool wireConnVisible;
bool gridlineVisible;
};

class MainApp : public wxApp {
public:
MainApp();
virtual bool OnInit();

public:
// crit section protects access to all of the arrays below
wxCriticalSection m_critsect;

// semaphore used to wait for the threads to exit, see MainFrame::OnQuit()
wxSemaphore m_semAllDone;
wxSemaphore simulate;
wxSemaphore readyToSend;

wxMutex mexMessages;
deque< klsMessage::Message > dGUItoLOGIC;
deque< klsMessage::Message > dLOGICtoGUI;
// Use a stopwatch for timing between step calls
wxStopWatch appSystemTime;
unsigned long timeStepMod;

// We need to have a map of libraries for palette organization, and knowledge
// of which one we are currently displaying. We also have a map of which gate
// belongs to which library (child to parent)
string currentLibrary;
LibraryParse libParser;
map < string, map < string, LibraryGate > > libraries;
map < string, string > gateNameToLibrary;

// the last exiting thread should post to m_semAllDone if this is true
// (protected by the same m_critsect)
bool m_waitingUntilAllDone;

// Help system
wxHelpController* helpController;

bool showDragImage;
string newGateToDrag;

ApplicationSettings appSettings;

threadLogic* logicThread;
autoSaveThread* saveThread;

ofstream logfile;

//this pointer is added so that pop-ups can
//resume simulation
MainFrame* mainframe;

//this string is necisary when the working directory
//is not were the executeable is.
string pathToExe;

// OK, honestly, this shouldn't be here
// Basically exporting bitmaps doesn't like GL display
// lists, so we flag them
bool doingBitmapExport;

private:
void loadSettings( void );
};

#endif /*MAINAPP_H_*/


// When I make one line comment than it shows error next line and when i make 2nd line comment too than it shows error over 3rd line and so on.
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: CEDAR Logic

Post by doublemax »

Well, if the file is not found, there are only two things you have to do:
Check that the file exists and that the include paths are correct.

There isn't really anything else i can add to this.
Use the source, Luke!
User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: CEDAR Logic

Post by Fahad »

Thanks alot #doublemax,

my code works successfully, i just close VS and then again start it and open project from C:\Users\Asad\Documents\Visual Studio 2015\Projects\cedar-logic . build it successfully and than I start debugging and so on.
User avatar
Fahad
Earned a small fee
Earned a small fee
Posts: 22
Joined: Wed May 03, 2017 10:46 am

Re: CEDAR Logic

Post by Fahad »

kindly find the attached file consisting on cedar logic images.
Attachments
output metrices.jpg
cedarlogic.jpg
Build succeeded.jpg
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7479
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: CEDAR Logic

Post by ONEEYEMAN »

Hi,
The application is running but there are memory leaks.
You need to fix the first.

Try to install VLD (Visual Leak Detector) - it will help with memory leaks hunting under MSVC.

Thank you.
vecmat
In need of some credit
In need of some credit
Posts: 1
Joined: Thu Nov 02, 2017 6:24 pm

Re: CEDAR Logic

Post by vecmat »

Fahad wrote:Thanks alot #doublemax,

my code works successfully, i just close VS and then again start it and open project from C:\Users\Asad\Documents\Visual Studio 2015\Projects\cedar-logic . build it successfully and than I start debugging and so on.
Hello!

I tried to compile the code but I have been unable. Please, can you send me a source code copy to compile it under VS? Please include if possible the wx libraries you are uisng.

I have modified the component library but I need to modify and compile the code to improve some aspect of the gui.

If you want we can talk about new features and share solutions. The CEDAR LOGIC project is very interesting and it is a pity that it does not follow its development.

Thanks in advance.
Post Reply