Forums

cobra.targets not found!! Please help me guys

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

cobra.targets not found!! Please help me guys

Postby lesterpanlilio » Fri Sep 19, 2014 7:20 am

Im a first time user of cobra programming language.. I'am a computer science student and trying to know the cobra.. but i got this ERROR



Building: HelloWorld (Debug|x86)
C:\Users\Lester\Documents\Projects\HelloWorld\HelloWorld\HelloWorld.cobraproj(32,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Cobra\Cobra.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

---------------------- Done ----------------------

Build: 1 error, 0 warnings



Pls help me guys fixing this error
lesterpanlilio
 
Posts: 4

Re: cobra.targets not found!! Please help me guys

Postby nerdzero » Fri Sep 19, 2014 1:08 pm

Hi lester,

I am assuming you are using MonoDevelop or Xamarin Studio based on the error message.

What's happening here is that the HelloWorld.cobraproj file is making a reference to the common MSBuild file Cobra.targets but it doesn't appear that the file exists where it expects it to.

This can happen if you are using an older version of Cobra that did not include the Cobra.MSBuild.dll and Cobra.targets files which are required if you want to build HelloWorld.cobraproj using MSBuild. First, I would check to see if the file "C:\Program Files (x86)\MSBuild\Cobra\Cobra.targets" exists and if not then reinstall Cobra. It is also possible, that you never installed Cobra and just installed the MonoDevelop add-in. The add-in requires Cobra to already be installed in order to compile code. Install Cobra in that case: http://cobra-language.com/downloads/Cobra-0.9.6.zip

If Cobra is installed and you still can't get it to work, you can try to disable building with MSBuild by modifying the project options. Go to "Project" > "[YourProjectName] Options" menu entry and you will get a configuration screen. On the left side, select "Build" > "General" and uncheck the box that says "Use MSBuild build engine (recommended for this project type)". You may have to remove the default reference to "System.Core" to get the build to work when going this route.

Let us know how it goes.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: cobra.targets not found!! Please help me guys

Postby lesterpanlilio » Sat Sep 20, 2014 7:38 am

I already download the cobra-0.9.6 including cobra.target.. Can please help me choose a good IDE for cobra sir? What IDE could be easy to me(beginner)
lesterpanlilio
 
Posts: 4

Re: cobra.targets not found!! Please help me guys

Postby torial » Sat Sep 20, 2014 1:51 pm

The Xamarin Studio IDE w/ the Cobra plugin is awesome -- but w/ the updates that they (Xamarin) have been making, I find I run into that error alot as it it seems to clean out the Cobra environment. At least for me, I have to reinstall (installfromworkspace.cobra at root/admin level permissions) Cobra each time Xamarin Studio is updated.
torial
 
Posts: 227
Location: IA

Re: cobra.targets not found!! Please help me guys

Postby nerdzero » Sat Sep 20, 2014 7:53 pm

Here are your options for IDE and editor support:

http://cobra-language.com/trac/cobra/wiki/IDESupport
http://cobra-language.com/trac/cobra/wiki/EditorSupport

A reinstall of Cobra wouldn't hurt. Did you try unchecking the "Use MSBuild build engine" checkbox in the project options and removing the reference to System.Core? The cobra.targets file is not needed in that case.
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: cobra.targets not found!! Please help me guys

Postby lesterpanlilio » Sat Sep 20, 2014 9:52 pm

I already uncheck "Use MSbuild" and remove the System.core on the reference, and I get this new error


Building: cobraex (Debug|x86)
Performing main compilation...
Build complete -- 1 error, 0 warnings

---------------------- Done ----------------------

Could not find cobra command. Try adding its location to your PATH environment variable.
Build: 1 error, 0 warnings
lesterpanlilio
 
Posts: 4

Re: cobra.targets not found!! Please help me guys

Postby nerdzero » Mon Sep 22, 2014 11:29 am

This is because cobra.bat or cobra.exe is not in your system path. This is an environment variable that Windows will use to resolve the location of a program that you try to run without giving the fully qualified path.

For example, if you open a command prompt window and just type "notepad", then the Windows Notepad app opens. You didn't need to type "C:\Windows\System32\notepad.exe" because the path "C:\Windows\System32" is in the PATH system environment variable.

When you install Cobra, one of the last messages you'll see is:

Code: Select all
The Cobra compiler is not in your PATH. To remedy you can:
1. Add C:\Cobra\bin to your PATH
2. Copy C:\Cobra\bin\cobra.bat to any directory in your PATH


So, you need to add "C:\Cobra\bin" or wherever you have cobra.bat to your PATH. See here for some instructions on how to change this environment variable: http://stackoverflow.com/questions/9546 ... in-windows I bet after you make this change, your issue with VisualCobra will also get fixed.

By the way, normally, the only time you have to do this to get the MD/XS add-in to work is if you install Cobra to a non-default location (which is kind of hard to do by accident). The add-in will try to find cobra.bat and cobra.exe even if they are not in your PATH variable. If you haven't moved the default installation folder and it can't find the Cobra compiler command, I suspect that Cobra did not actually install successfully. That would also explain the error message regarding cobra.tagets.
nerdzero
 
Posts: 286
Location: Chicago, IL


Return to Discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron