undefined

C++ Hello World Undefined symbols for architecture x86_64:

岁酱吖の 提交于 2019-12-06 01:31:48
Should be straightforward, but when I compile the C++ Hello World code returns a bunch of undefined symbol errors. // my first program in C++ #include <iostream> using namespace std; int main () { cout << "Hello World!"; return 0; } Heres how I compile: Open terminal, cd to the directory, gcc hello.cpp Then I get the errors. Any thoughts? I feel like I may have broken somehting... or I am just missing something really obvious. Any help is greatly appreciated! Heres the errors: Undefined symbols for architecture x86_64: "std::cout", referenced from: _main in ccfUAf5i.o "std::basic_ostream<char,

malloc undefined

断了今生、忘了曾经 提交于 2019-12-06 00:58:33
问题 I am currently working on rewriting a linked list module and I am receiving some weird errors. In two IDEs (Netbeans & Visual Studio Express), I am getting a warning that malloc is undefined and that a function found in my linkedlist.c file is not defined either. below are my 3 files. main.c #include <stdlib.h> #include <stdio.h> #include "linkedlist.h" int main(void){ struct linked_list * l_list; l_list = new_list(); printf("%i", l_list->length); getchar(); return (EXIT_SUCCESS); }

clang++ mac os x c++11 linker issue

。_饼干妹妹 提交于 2019-12-06 00:50:27
I have a problem compiling a program with "-std=c++11 -stdlib=libc++" under mac os x 10.8.3 using clang++ from xcode 4.6.2. When I try to use std::mem_fn() or (deprecated) std::mem_fun_ref(), I get linker error "symbol(s) not found". The same code (with std::mem_fun_ref instead of std::mem_fn) compiles and links without any issues under the c++03 standard. If I call the same member function on an object without referring to it via mem_fn or mem_fun_ref, the program compiles and runs without any problems. Is it a clang++ problem, a mac os problem, or am I doing something wrong? The code:

Call a function only if a value is neither null nor undefined

僤鯓⒐⒋嵵緔 提交于 2019-12-06 00:32:28
When a button is clicked I check if something exists in a localstorage key as such: var a = localStorage.getItem('foo'); if (typeof a != 'undefined') { // Function } but if the key doesn't exists at all, it return null. How can I call if not undefined and not null do function , else return true(?) or continue? JavaScript has a concept of falsy values... i.e. 0, null , undefined and an empty string. Because of this, you should be able to just check if a is "truthy" (i.e. not one of the values I've mentioned above), by doing this: var a = localStorage.getItem('foo'); if (a) { // Function } More

Error with javascript in firefox

↘锁芯ラ 提交于 2019-12-06 00:00:43
I have a problem with JavaScript running in Firefox. The script below runs without a problem in other browsers except Firefox. var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[i]] = hash[1]; } if (vars[0] != ' ') { document.all['companyURL'].innerHTML = vars[0]; document.getElementById('domain').value = vars[0]; } So this code runs during page load and should grab the values after the URL and replace a line of text in the page with

Cannot read property 'then' of undefined with JavaScript promises

自古美人都是妖i 提交于 2019-12-05 22:53:43
I understand at first glance this may look like a duplicate but I have seen all the answers for that tell me to put a return in but that is not working. this is my function: function removePastUsersFromArray(){ pullAllUsersFromDB().then(function(users_array){ var cookie_value = document.cookie.split('=') [1]; const promises = [] for (var i = 0; i < _USERS.length; i++) { if (_USERS[i].useruid == cookie_value){ var logged_in_user = _USERS[i].useruid; promises.push( onChildValue(rootRef, 'users/' + logged_in_user + '/disliked_users/').then(formatUsers) ) promises.push( onChildValue(rootRef,

Base class undefined

对着背影说爱祢 提交于 2019-12-05 21:47:31
问题 My code below generates the error 'WorldObject': [Base class undefined (translated from german)] Why is this? Here is the code which produces this error: ProjectilObject.h: #pragma once #ifndef _PROJECTILOBJECT_H_ #define _PROJECTILOBJECT_H_ #include "GameObjects.h" class WorldObject; class ProjectilObject: public WorldObject { public: ProjectilObject(IGameObject* parent,int projectiltype); void deleteyourself(); protected: virtual void VProcEvent( long hashvalue, std::stringstream &stream);

Matlab - Undefined Error for Input Arguments of Type Double [duplicate]

我与影子孤独终老i 提交于 2019-12-05 21:23:21
This question already has an answer here: “Undefined function 'function_name' for input arguments of type 'double'.” 3 answers I'm trying to write a function that does what conv2(h1,h2,A) & conv2(...'shape') does without using the built-in function. (speed is currently not an issue). as defined here: http://www.mathworks.co.uk/help/matlab/ref/conv2.html These are my commands: imgC = imread('camerman.tif'); imgC = double(imgC); sigma = 1; inp = (-1 .*2.5 .*sigma):1:(2.5 .* sigma); gauss1d = (1/(sigma .* sqrt(2*pi))).*exp(-(inp.^2/(2.*sigma.*sigma))); gaussprime = diff(gauss1d); x = conv2fft

Why is this object property undefined?

狂风中的少年 提交于 2019-12-05 18:04:05
问题 Consider the code below. The first console.log correctly logs the image, and you can see its properties in the image below. However, when I try logging one if its properties to the console, I get undefined ! console.log(that.data[0].cards); //works -- see image below console.log(that.data[0].cards.E); //undefined console.log(that.data[0].cards['E']); //undefined console.log(that.data[0].cards.hasOwnProperty('E')); //false var test = JSON.stringify(that.data[0]); console.log(test); // {} for(

Javascript: false || undefined vs undefined || false

狂风中的少年 提交于 2019-12-05 12:05:40
What is the explanation for behavior of the "||" operator (logical OR), when using it with false and undefined on both sides in JavaScript? 1) > false || undefined undefined 2) > undefined || false false The logical OR operator isn't commutative like + , * , etc. It returns the first expression which can be converted into true . (Source Mozilla Doc ) In false || undefined , false can't be converted to true by definition (since it's the opposite), so it returns the second operand ( undefined ) In undefined || false , undefined is a value, but considered as false in Javascript, so the logical