Jump to content

IDE issue finding the Leadwerks C++ code.


wdna
 Share

Recommended Posts

Although my project compiles after I added 'pthread' and 'X11' to linker in build options, the Code::Blocks IDE is unable to find the declarations of the 'Leadwerks' namespace.

 

For example:

window = Leadwerks::Window::Create("MyGame", 200, 150, 1024, 768, Leadwerks::Window::Titlebar);

 

When pressing LMB on 'Create' and choosing "Go to deceleration ..." the action results an error.

My version of Code::Blocks is 13.12, the default install on Ubuntu 14.04.

 

I did not find any 'special' way to add the files to IDE, their path is clearly in the include.

 

Should I add what's inside /home/myuser/Leadwerks/Include/ to the project files or anything like that?

Link to comment
Share on other sites

Actually this should not be necessary. Did you create the project from within the Leadwerks-Editor?

 

Yes, I opened the files from ~/Documents/Leadwerks/Projects/Test/Projects/Linux with Code::Blocks -- this was generated by creating new C++ project.

Link to comment
Share on other sites

Since I am currently on windows, I can't try this myself, but you could try the following:

  1. Create a backup of your .cbp - file
     
  2. Open it with the text editor of your choice (if you are new to Linux, you might find a graphical one like "gedit" might fit your needs)
     
  3. Find the lines containing
     
  4. <Environment>
     <Variable name="LeadwerksPath" value='"..."' />
    </Environment>


    (In my file they were lines 46ff)

  5. Make sure, the path between the quots is your Leadwerks directory (this should be the top-level directory, containing the folders Library, libs, Include, etc.
     
  6. Safe the file and load it into code::blocks

If this works for you, something might have gone wrong with setting up the $LEADWERKS_LINUX_PATH variable.

Edited by Ma-Shell
Link to comment
Share on other sites

Yes, that seems to be the the case:

<Environment>
<Variable name="LeadwerksPath" value='"/home/wdna/Leadwerks"' />
</Environment>

 

I'm starting to think this is some kind of Code::Blocks bug?

By looking at build configuration, without this variable compile should not work, but it does.

Link to comment
Share on other sites

I've noticed the same thing (running on Ubuntu 14.04 64bit & CB 13.12). It doesn't use the Leadwerks namespace even in the default App.cpp file but I have to refer to all that stuff with Leadwerks::Time::Update(), Leadwerks::Window and so on. I don't have any spaces in any of the paths, either.

 

Could the .cbp file have the <Add library="pthread" /> and <Add library="X11" /> lines added to it by default?

  • Upvote 1
Link to comment
Share on other sites

Yes they can!

 

The Time and Window classes interfere with existing ones that only appear on Linux, unfortunately, thus the need to specify the namespace.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Josh, Toaster, found the issue, I replaced:

 

<Variable name="LeadwerksPath" value='"/home/wdna/Leadwerks"' />

 

with:

 

<Variable name="LeadwerksPath" value="/home/wdna/Leadwerks" />

 

Looking at other definitions in project, this seemed a bit strange to set value like that with the '"' escape.

Now everything works fine and I can view the source files.

 

Like mentioned, it would be nice if this libraries will be auto added upon new projects:

<Add library="pthread" />
<Add library="X11" />

  • Upvote 1
Link to comment
Share on other sites

Josh, Toaster, found the issue, I replaced:

 

<Variable name="LeadwerksPath" value='"/home/wdna/Leadwerks"' />

 

with:

 

<Variable name="LeadwerksPath" value="/home/wdna/Leadwerks" />

 

Looking at other definitions in project, this seemed a bit strange to set value like that with the '"' escape.

Now everything works fine and I can view the source files.

 

Like mentioned, it would be nice if this libraries will be auto added upon new projects:

<Add library="pthread" />
<Add library="X11" />

Done.
  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...